Please show me how I can compute the above expression in R so that I can fix it
ID: 2946895 • Letter: P
Question
Please show me how I can compute the above expression in R so that I can fix it in my R software. Like what will be the expression for the null hypothesis and alternative hypothesis in R. Thanks.
d) The researcher null hypothesis was that the bweight [dependent variable] has a linear association with gestwks. Run the analysis to test the null hypothesis and write down the linear equation. Was there a linear relationship? (10 marks) e) The researcher has been advised that the relationship between bweight and gestwks is confounded by matage and hyp. Run the analysis to test this and write the full multivariable linear regression equation. Did matage or hyp confound the relationship? (10 marks)Explanation / Answer
Write in R
fit <- lm(bweight ~ gestwks, data=dataname)
summary(fit)
# This will give you the p-value of test of significance of the coefficient of independent variable "getswks", if the p-value is less than 0.05, then the linear association is significant. Get the estimate of intercept9say a) and slope(say b) of "gestwks" by the code
fit$coeff
and write the linear equation as
bweight = a + b* gestwks
e) Now, write the following code multiple regression,
fit_mult<-lm(bweight ~ gestwks + matage + hyp, data=dataname)
summary(fit_mult)
## From the summary of the fit, if the p-value of getswks comes insignificant(> 0.05) then, there is evidence that gestwks is confounded by matage and hyp.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.