SIDI2
SIDI2
> library(ggpubr)
> library(rstatix)
> library(car)
> library(broom)
> SIDI <- read.csv("C:/Users/Cherry mae/Downloads/Sidi-Aissa-Annual-Rainfall-59-
obs.csv")
> #Histogram
> hist(SIDI$observation,
+ main = "SIDI - Annual Rainfall",
+ xlab = "Rainfall Depth (mm)",
+ col = "lightblue",
+ border = "black")
> #Density plot
> plot(density(SIDI$observation),
+ main = "Density Plot of Precipitation Observations (SIDI)",
+ xlab = "Precipitation")
> #Define the intervals (bins)
> BREAKS <- seq(min(SIDI$observation), max(SIDI$observation), by = 100)
> # Create a frequency table based on the intervals
> FREQUENCYTABLE <- cut(SIDI$observation, breaks = BREAKS, right = FALSE)
> #Display the frequency table
> table(FREQUENCYTABLE)
FREQUENCYTABLE
[150,250) [250,350) [350,450) [450,550)
22 21 14 1
> library(fitdistrplus)
> #Fit a normal distribution
> FITNORMAL <- fitdist(SIDI$observation, "norm")
> #Summary of the fit
> summary(FITNORMAL)
Fitting of the distribution ' norm ' by maximum likelihood
Parameters :
estimate Std. Error
mean 290.75763 11.747000
sd 90.23033 8.306375
Loglikelihood: -349.3569 AIC: 702.7139 BIC: 706.869
Correlation matrix:
mean sd
mean 1 0
sd 0 1