OnlineNursingOwl
← All nursing posts

Statistics · Studypool

UP Statistics Linear Regression Analysis & Model Assumptions Project

Overview

Submit a .pdf and the corresponding (r code) .Rmd code which you used to answer the following questions.

1.Checking model assumptions – linearity and equal variance. For the simple linear regression model, the most essential assumption is the linearity assumption. We also care about the equal variance assumption in justifying the least squares method. For seven datasets files (data1.txt – data7.txt), use ggplot to plot the scatterplot and residual plot, and state whether the two assumptions hold or not and why

2. Understanding the QQ plot. Use the five datasets (data8.txt – data12.txt) as examples to understand the Normal Q-Q plot. For each dataset, first plot the scatterplot to get an initial idea of the data. Then, fit the model and obtain the standardized residuals. Plot the histogram of the standardized residuals and comment on the shape the histogram. Then plot the QQ plot of the standardized residuals using ggplot, and add the reference line. Comment on the QQ plot and discuss whether there is any skew or heavy/light tails. For each dataset, comment on how comfortable you would be performing inference given the QQ plot results.

3. Data transformation. When one or more assumptions for the simple linear regression model do not hold, we may want to seek possible transformations on X and/or Y so that the linear model is a suit- able model for the transformed variables. For three datasets (data13.txt – data15.txt), first check whether the three assumptions (linearity of X and Y, equal variance, and normality of residuals) hold based on the scatterplot and diagnostic plots. Then, try different transfor- mations on X and/or Y, state the transformation you would take so that the simple linear regression model is proper on the transformed data. Draw the scatter plot of the transformed data and the diagnostic plots of the new model. Comment on if the issues encountered before were resolved by transformation.