## import data
snow <- read.csv(choose.files())
## plot Snowfall vs. Return Period
plot(snow$Return.Period, snow$SNOWFALL, xlab = "Return Period", ylab = "SNOWFALL")
snow$Return.Period.Log = log(snow$Return.Period)
plot(snow$Return.Period.Log, snow$SNOWFALL)
lm_snow = lm(snow$SNOWFALL ~ snow$Return.Period.Log)
summary(lm_snow)
##
## Call:
## lm(formula = snow$SNOWFALL ~ snow$Return.Period.Log)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.671 -0.292 0.177 0.616 1.182
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.278 0.162 45.0 <2e-16 ***
## snow$Return.Period.Log 4.681 0.123 38.2 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.863 on 60 degrees of freedom
## Multiple R-squared: 0.961, Adjusted R-squared: 0.96
## F-statistic: 1.46e+03 on 1 and 60 DF, p-value: <2e-16
If we have Return.Period=100 years here, the estimated snowfall magnitude is 28.83 based on the regression model.
Return.Period = 100
snowfall = 7.2781 + 4.6808 * log(Return.Period)
snowfall
## [1] 28.83
Created by: Li Xu; Created on: 02/04/2013; Updated on: 02/04/2013