Midterm - Copy

Midterm - Copy - Midterm STAT 331 Fall 2008 1. Derive a...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Midterm STAT 331 Fall 2008 1. Derive a covariance between OLS intercept and slope estimates. COV ( ) = E ( ) – E( )E( ) Since Therefore, COV ( ) = E ( ) – E( )E( ) = E ( ) – (E( E( ) = = = = = - 2. DESCRIPTIVE ABSTRACT: The observations contain five series, consisting of annual hog supply (AnHogSp), hog prices (HogPr), corn supply (CornSp), corn prices (CornPr) and farm wages (Wages) for the period 1868-1948. Values are aligned and delimited by blanks. YOUR TASK: To forecast hog prices in 1947 and 1948, i.e. you use the data from 1868 to 1946 as a training set for your model. You should construct a simple linear regression model with a potential predictor annual hog supply (AnHogSp). You should a) obtain a scatter plot of dependent variable vs. regressor and discuss your findings; 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Scatterplot > plot(data$AnHogSp,data$HogPr, xlab="Annual hog supply", ylab="Hog prices",main="Hog Prices Against Annual Hog Supply") > abline(lm(data$HogPr~data$AnHogSp)) 1. Outliers 2. Residuals values are very high 3. Slope not zero important predictor 4. ANhogSUP are positivly related and important predictor b) construct a linear regression of hog prices vs. annual hog supply; Summary > l<-lm(data$HogPr~data$AnHogSp) > summary(l) Call: lm(formula = data$HogPr ~ data$AnHogSp) Residuals: Min 1Q Median 3Q Max -0.49812 -0.14989 0.01380 0.13189 0.45736 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.4326 1.2391 -1.156 0.251 data$AnHogSp 1.2504 0.1894 6.600 4.7e-09 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.2048 on 77 degrees of freedom Multiple R-squared: 0.3613, Adjusted R-squared: 0.353 F-statistic: 43.56 on 1 and 77 DF, p-value: 4.7e-09 2
Background image of page 2
Therefore the linear regression model is Y i = -1.4326+ 1.2504X i + i c) construct 90% confidence interval for the intercept and slope; T-Value > qt(.95,77) [1] 1.664885 Intercept β 0 = -1.4326 ± 1.664885 * 1.2391 = (-3.495559, 0.630359 Slope β 1 = 1.2504 ± 1.664885 * 0.1894 = (0.9350708, 1.565729) d) test whether your slope is significant at 99% confidence level using t-statistic; T-Value > qt(.995,77) [1] 2.641198 > anova(l) Analysis of Variance Table Response: data$HogPr Df Sum Sq Mean Sq F value Pr(>F) data$AnHogSp 1 1.8279 1.8279 43.564 4.7e-09 *** Residuals 77 3.2309 0.0420 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 T-statistics = (SSR/(SSE/n-2))^1/2 = (1.8279/0.0420)^1/2 = 6.597077275 Since 6.597077275 is bigger than 2.641198 therefore we can reject slope equals to zero with 99% confidence interval. AnHOGSP is a very useful predictor e) provide residual diagnostics, i.e. verify that residuals are homoscedastic (residual plot), uncorrelated (acf plot, the Durbin-Watson test, the runs test) and normally distributed 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
(Shapiro-Wilk test, QQ plot, histogram). HOMOSCEDASTIC
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/10/2010 for the course STAT 331 taught by Professor Yuliagel during the Spring '08 term at Waterloo.

Page1 / 15

Midterm - Copy - Midterm STAT 331 Fall 2008 1. Derive a...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online