bweight gestwks hyp sex
1 2974 38.5200004577637 0 female
2 3270 NA 0 male
3 2620 38.150001525878899 0 female
4 3751 39.799999237060497 0 male
5 3200 38.889999389648402 1 male
6 3673 40.970001220703097 0 female
bweight=baby weight
gestwks=gestation period in week
hyp=presence of maternal hypertension
sex=sex of baby
I haven this sample , and I have created a multiple linear regression model with the following code:
lm2 = lm(bweight ~ gestwks + hyp + male)
Where male and female is a vector of 1's for the male and 0's for the females.
How do I find the unbiased estimate of the variance of the errors sigma^2? Is the code:
summary(lm2)$sigma^2
going to give me the answer i'm looking for?
Also, how do I find the estimate of the variance of estimator for the effect of hypertension.
So, say I have that the presence of hypertension affects the baby's weight with -200 (i.e 1 unit increase in hypertension causes the average weight to decrease in 200). What would be the estimate of the variance of estimators for the effect of hypertension?