1
PPOL205 Assignment 4
Name
Institution
Course
Instructor
Date
2
PPOL205 Assignment 4
Question 1
Does the mother’s height (mheight) affect the birth weight of newborns (Birthweight)? [5
points]
1. Which variable is the dependent variable? What type of variable is it?
The dependent variable is the weight of the newborns (Birthweight). Birthweight is a
continuous variable.
2. Which variable is the independent variable? What type of variable is it?
The independent variable mother's height (mheight). It is also a continuous variable.
3. What is the null hypothesis?
The null hypothesis (H0) is such that: Mother's height does not affect weight of the
newborns.
4. What is the alternative hypothesis?
The alternative hypothesis (H1) is such that: Mother's height affects birth weight.
5. Running the model
# Run linear regression
model <- lm(Birthweight ~ mheight, data = data)
summary(model)
Call:
lm(formula = Birthweight ~ mheight, data = data)
Residuals:
Min 1Q Median 3Q Max
-1.31503 -0.32047 0.02239 0.35715 1.31981
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.23073 2.25127 -0.991 0.3277
mheight 0.03371 0.01368 2.464 0.0181 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.5697 on 40 degrees of freedom
Multiple R-squared: 0.1318, Adjusted R-squared: 0.1101
F-statistic: 6.073 on 1 and 40 DF, p-value: 0.01812
3
6. Interpret the result (intercept, coefficient and r-squared)
The linear regression shows that the height of the mother has a significant effect on
the weight at birth with a p-value of 0.0181. The intercept for the birthweight when
the mother's height is zero is -2.231, but according to the model, this intercept is not
statistically significant. The coefficient for the varying height of the mother shows
that for every increment in the mother’s height, the birthweight increases by 0.0337
kilograms, which is statistically significant (p-value=0.0181. The R-squared value in
the model explains approximately 13.18% of the variance in birth weight. as indicated
by the.
7. What is the estimated birthweight when the mother is 163 cm?
Estimated birthweight=Intercept + ( Coefficient∗mothe r ' s height )
¿−2.23 1+ ( 0.0337∗163 )
¿ 3.264 kg
8. Please visualize this linear relationship:
4
Question 2
Does whether the mother is a smoker or not (smoker) affect the birth weight of newborns
(Birthweight)? [5 points]
1. Which variable is the dependent variable? What type of variable is it?
The dependent variable is the birth weight of newborns (Birthweight). Birthweight is
a continuous variable.
2. Which variable is the independent variable? What type of variable is it?
The independent variable is “smoker”, which is a categorical variable with mothers
who smoke denoted with 1, while the non-smoking mothers denoted with 0.
3. What is the null hypothesis?
The null hypothesis (H0) is such that the birth weight of a newborn is not affected by
whether the mother is a smoker or a non-smoker
5
4. What is the alternative hypothesis?
The alternative hypothesis (H1) is such that the weight of a newborn is affected by
whether the mother smokes or not.
5. Run the test
summary(model)
Call:
lm(formula = Birthweight ~ smoker, data = data)
Residuals:
Min 1Q Median 3Q Max
-1.21409 -0.39159 0.02591 0.41935 1.43591
Coefficients:
Estimate Std. Error t value
(Intercept) 3.5095 0.1298 27.040
smoker -0.3754 0.1793 -2.093
Pr(>|t|)
(Intercept) <2e-16 ***
smoker 0.0427 *
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.5804 on 40 degrees of freedom
Multiple R-squared: 0.09874, Adjusted R-squared: 0.07621
F-statistic: 4.382 on 1 and 40 DF, p-value: 0.0427
6. Interpret the result (intercept, coefficient and r-squared)
The intercept (3.5095) in the model is the estimated birth weight when the mother is a
non-smoker, which is statistically significant (p-value <2e-16). Therefore, there is
strong evidence to suggest that birth weight differs significantly for non-smokers. The
coefficient for a smoker (-0.3754) indicates the estimated difference in birth weight
between smokers and non-smokers, which is statistically significant with a (p-value
=0.0427) in the model. This indicates that there is evidence tosupport the claim that a
smoking mother is associated with a decrease in birth weight of the newborn. The R-
squared value of 0.0978 shows that approximately 9.87% of the variance in birth
weight is explained by the linear relationship with the mother’s smoking status.
7. What is the estimated birthweight when the mother is a smoker?
6
Estimated birthweight for smoker =Intercept +Coefficient (smoker )
Intercept=3.5095
Coefficient for smoker =−0.375 4
Therefore, Estimated birthweight for smoker =3.5095+ (−0.3754 )
¿ 3.5095−0.3754
¿ 3.1341 kg