GEOG 3402 Natural Hazards - Exercise 1 Key to Extra Credit Question

1. Import data

## import data
snow <- read.csv(choose.files())

2. Check the linearity of data by plotting Snowfall vs. Return Period.

## plot Snowfall vs. Return Period
plot(snow$Return.Period, snow$SNOWFALL, xlab = "Return Period", ylab = "SNOWFALL")

plot of chunk unnamed-chunk-2

3. Do a logarithmic transformation on Return Period, then plot data.

snow$Return.Period.Log = log(snow$Return.Period)
plot(snow$Return.Period.Log, snow$SNOWFALL)

plot of chunk unnamed-chunk-3

4. The plot after logarithmic transformation seems to fit a line pretty well, so we can do a linear regression now.

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

5. The adjusted R-squared is high (0.9599), and p-values (2e-16) indicate that it is statistically significant. Thus, it is a good regression model.

Snowfall=7.2781+4.6808*log(Return.Period)

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