Homework 11

Due: 2022-11-28, 11:59pm

All homework must be submitted via Blackboard. Your answers must be in a MS Word (DOCX) or PDF format. Your submitted document should have sections corresponding to those in this homework.

Please make sure that you have watched the videos and have done the readings. Everyone should do this independently; you can discuss the process, but the answers are expected to be different.

Include graphs as images in your document. Make sure you comment on the Stata output, figures and tables. Include all code used to complete the homework so that your results can be reproduced (you may edit out irrelevant portions). Use the lecture notes as a guide.

1. Neidert data (50%)

Use the Neidert body composition data for this exercise.

  • Regress fat/lean ratio on sex. Compare the output with the results of a two sample t-test comparing the fat/lean ratio for males vs females. To use sex in regression, you will have to convert the string variable into a numeric variable. This can be done using the encode command to generate the variable sexvar as follows:

    encode sex, gen(sexvar)
    
  • Regress fat/lean ratio on BMI, age and sex.
    Which of the variables appear to contribute to prediction of fat/lean ratio? Justify your answers.
  • Plot the residuals against the fitted values for the model above. Are the assumptions of linear regression met?

2. Agren data (50%)

Use the Agren data for this exercise.

  • Predict the fitness in Sweden in 2011 using fitness in Sweden in 2010. Plot the residuals against the fitted values and assess the assumptions of linear regression.
  • Transform both response and predictor variables using the log transformation. Interpret the prediction equation when transformed back to the original scale.
  • Assess the assumptions of the log transformed model; compare with the untransformed model and comment on which one is better.

3. Acknowledgements

Please acknowledge individuals who helped you or resources thay were helpful in completing the homework.