Advertisement
federico_carosio

Esercizio_2a

Dec 27th, 2023 (edited)
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.63 KB | None | 0 0
  1. #     ESERCIZIO 2a
  2.  
  3. rm(list=ls())
  4. library(moments)
  5. library(car)
  6.  
  7. data <- read.table("Exercise2a.txt", header = T, sep = "\t")
  8.  
  9. rain <- data$discharge
  10.  
  11. n <- length(rain)
  12. media <- mean(rain)
  13. standard_dev <- sd(rain)
  14. sample_skewness <- skewness(rain)
  15.  
  16. h <- hist(rain, plot=T)
  17. h$xname <- "frequencies of rain"
  18. h$counts <- h$counts/n
  19. plot(h, ylim=c(0,1))
  20. bxp <- boxplot(h$counts, horizontal = T, names = "frequenze cumulate")
  21.  
  22. h$xname <- "cumulative rain"
  23. h$counts <- cumsum(h$counts)
  24. plot(h, ylim=c(0,1))
  25.  
  26. bxp <- boxplot(h$counts, horizontal = T, names = "frequenze cumulate")
  27.  
  28. media
  29. standard_dev
  30. sample_skewness
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement