Calculating SPI index from RStudio

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 2024
  • using R studio to calculate the SPI index
    File Link:
    drive.google.c...

ความคิดเห็น • 34

  • @Alisen12
    @Alisen12 ปีที่แล้ว +5

    Thanks for your video, it helped me a lot. Unfortunately, I still have a problem computing the SPI values: I set up my data exactly as you did (year, month, prcp), but when running the SPI call it does not return the "Jan", "Feb"...etc. headings. plot.spei also does not seem to exist. Do you have any idea what I am doing wrong? Thanks so much for your help!

  • @sriparnapaik
    @sriparnapaik ปีที่แล้ว +3

    How to get the column names as 'Jan' 'feb'? my data is arranged exactly like the shown excel yet it doesn't show the column names

  • @butteredcat3297
    @butteredcat3297 ปีที่แล้ว

    Thanks for your video. May I ask one question? For calculating the SPI, I choose the Gamma distribution which is also default for SPI. And I used the maximum likelihood as the estimated method to calculate the parameters of the fitted Gamma distribution. But all the output are NA. I also change it to plotting position, values still NA. If I choose the default one “un-pmw” as same as the video, I could get right output values. I don’t know why the method maximum likelihood can’t work.

  • @christianbigirimana5900
    @christianbigirimana5900 5 หลายเดือนก่อน

    How to configurate colors for plot ? Positive and negative have same colors in R studio plots

  • @naveenkumar-nj5qc
    @naveenkumar-nj5qc 3 ปีที่แล้ว +2

    I think this is not monthly average data, because July 1980 average rainfall is more than 100 mm. how can it possible for monthly average data. it is monthly sum data

    • @theteddychannel2770
      @theteddychannel2770  3 ปีที่แล้ว

      yes it should be the sum. i miss pronounced . sorry for the error

  • @faranakomidi5960
    @faranakomidi5960 ปีที่แล้ว

    thank you, how to change the spei class to dbl? I am looking for a method to add the column to the database in R itself , by mutating

  • @amaniamouna5843
    @amaniamouna5843 7 หลายเดือนก่อน

    Hello, thnak you for this vidéo and explication may i ask you question about how to organise my data in excel to convert my data from daily to mounthly and thank you wish you good Luck

  • @hachaniamal7433
    @hachaniamal7433 3 ปีที่แล้ว

    Hi I have some missing rainfall value so how can I solve the problem

  • @shanikhan783
    @shanikhan783 3 ปีที่แล้ว

    hello in my data lots of zeros thats why my index values are not correct. what could i do for that?

  • @kavinraj.a6183
    @kavinraj.a6183 ปีที่แล้ว

    [1] "Calculating the Standardized Precipitation Evapotranspiration Index (SPEI) at a time scale of 6. Using kernel type 'rectangular', with 0 shift. Fitting the data to a Gamma distribution. Using the ub-pwm parameter fitting method. Checking for missing values (`NA`): all the data must be complete. Using the whole time series as reference period. Input type is vector. No time information provided, assuming a monthly time series."
    Sir how can i encounter these problems ?

    • @shweyi2769
      @shweyi2769 2 หลายเดือนก่อน

      ME too
      Please can you advise me how to solve it?

  • @behnamkhorrami594
    @behnamkhorrami594 3 ปีที่แล้ว

    Hi Could you pls tell us how we can download the SPEI package for Rstudio?

  • @SunilKumar-nd2iq
    @SunilKumar-nd2iq 3 ปีที่แล้ว

    How I can export result of SPEI into excel or csv file? I tried but I found error "Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
    cannot coerce class ‘"spei"’ to a data.frame"

    • @theteddychannel2770
      @theteddychannel2770  3 ปีที่แล้ว

      store the variable in a data frame first with
      df

    • @theteddychannel2770
      @theteddychannel2770  3 ปีที่แล้ว

      After that u have to actuvate the writexls package.
      and use write_xlsx( df, " file path [ add an extra \ to each \") to export into excel

    • @theteddychannel2770
      @theteddychannel2770  3 ปีที่แล้ว

      you can easily find how to do it if you google it once. how to export R data into excel.
      The things i have mwntioned above might have some typo and syntax error

  • @arindamchattaraj4862
    @arindamchattaraj4862 ปีที่แล้ว

    Thanks for the video, it mad the work easier but I encountered this issue, [could not find function "plot.spei"] Is there any solution to it? Thanks in advance

    • @enockbett4567
      @enockbett4567 10 หลายเดือนก่อน

      hello did you find a solution for this

  • @soumago911
    @soumago911 3 ปีที่แล้ว

    please how can I modify the horizontal axis value, to use dates instead of numbers?

  • @HELLOCHAND100
    @HELLOCHAND100 3 ปีที่แล้ว

    Could you please clarify what data should we take for SPI Monthly (Sum) or Monthly (Average) RF ???

  • @aarizahmed4514
    @aarizahmed4514 4 ปีที่แล้ว

    Hi, Nice video. I have one query related to Rainfall data generally, we add(sum) all the RF monthly data but in this video, you mentioned monthly average value.
    So could you please clarify what data should we take for SPI Monthly (Sum) or Monthly (Average) RF?

    • @theteddychannel2770
      @theteddychannel2770  3 ปีที่แล้ว

      Monthly average as in the average rainfall value for the month. :)
      A question to you: Do you sum up all the daily RF values of a month for calculating SPI?

  • @Emeritus63s
    @Emeritus63s 4 ปีที่แล้ว

    Could you please share the download link

    • @theteddychannel2770
      @theteddychannel2770  3 ปีที่แล้ว +1

      drive.google.com/file/d/1PwpFvsyHcf42x7pdRs54YsvvnQjtGjS_/view

  • @Emeritus63s
    @Emeritus63s 4 ปีที่แล้ว

    Good day I did properly understand how you calculated the SPI
    Also how do you account for missing data values

    • @theteddychannel2770
      @theteddychannel2770  3 ปีที่แล้ว

      For mIssing data values, i have simply filled in the average values around the study period :D

    • @Emeritus63s
      @Emeritus63s 3 ปีที่แล้ว

      Ohk thanks for your feedback sir
      When plotting spi 3 do we use the 3rd spi value

    • @Emeritus63s
      @Emeritus63s 3 ปีที่แล้ว +1

      @@theteddychannel2770 mr ted thanks for the data
      Could I please send you my paper for you invaluable inputs about my data

    • @theteddychannel2770
      @theteddychannel2770  3 ปีที่แล้ว

      @@Emeritus63s yes sure. please mail them to me manbrawl270@gmail.com