Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Table Obs X Y 1 4 2 2 53 3 6 8 4 3 8 5 5 7 Show all work. Put all answers on thi

ID: 3062296 • Letter: T

Question

Table Obs X Y 1 4 2 2 53 3 6 8 4 3 8 5 5 7 Show all work. Put all answers on this sheet. 1. Load the data from Table 1 into STATA a. Run a regression with Y as the dependent variable and X as the independent variable. b. Write the equation (ie with s) you are estimating below: c. Correctly label all values and mark the standard errors. Table 2 Obs ee 2 d, which values are significantly different from 0 at a 5% level? e. Fill out the blank values for Table 2 below. f. Which value does OLS minimize? g. If the value of X increases by 1, how much does the estimated value of increase?

Explanation / Answer

R Code:

a)

x=c(4,5,6,3,5)
> y=c(2,3,8,8,7)
> fit=lm(y~x)
> summary(fit)

Call:
lm(formula = y ~ x)

Residuals:
1 2 3 4 5
-3.462 -2.692 2.077 2.769 1.308

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.5385 6.8449 0.663 0.555
x 0.2308 1.4527 0.159 0.884

Residual standard error: 3.313 on 3 degrees of freedom
Multiple R-squared: 0.008341, Adjusted R-squared: -0.3222
F-statistic: 0.02523 on 1 and 3 DF, p-value: 0.8839

b) regression equation :

y = 4.5385 +  0.2308 x

c) Standard errors:

Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.5385 6.8449 0.663 0.555
x 0.2308 1.4527 0.159 0.884

e)

> e=resid(fit)
> e
1 2 3 4 5
-3.461538 -2.692308 2.076923 2.769231 1.307692

> e^2
1 2 3 4 5
11.982249 7.248521 4.313609 7.668639 1.710059

f) >  sum(e^2)
[1] 32.92308
>

This sum of square of error value is minimised by OLS.

g) If X value is increased by 1 units then y is increased by  0.2308 units.