首页 > > 详细

代做STAT 321 Winter 2025 Assignment 4调试R语言程序

项目预算:   开发周期:  发布时间:   要求地区:

Assignment 4

STAT 321 Winter 2025

Due: Monday March 31, 5:00PM

1.  (5 points) In this problem, you will work with data in 321warpbreaks. csv, located on Learn under Assignments/Datasets.  The data contains information about warp breaks on weaving looms, depending on two categorical variables wool (wool type A or B) and tension (wool tension low, medium or high).

Use ANOVA to test whether the effect of wool tension on number of warp breaks is significantly different between the two types of wool (level α = 0.05).  State the null and alternative hypotheses in terms of MLR model parameters.

2.  (10 points) In this problem, you will work with data in 321divorce . csv, located on Learn under Assignments/Datasets.

(a) Fit a MLR model with divorce as the reponse and all other variates as predictors. Report a 95% prediction interval for the divorce rate in 1997, assuming all other predictors (besides year) are the same as 1996.

(b)  Use the Box-Cox procedure (boxcox in the MASS package) to select a transforma- tion of the response variate.  Plot the output of boxcox.  Draw scatter plots of year against the original response, and your new transformed response.

(c)  Fit a MLR model with your new transformed response and all other variates as predictors.   Based on the new model, report a 95% prediction interval for the divorce rate in 1997, assuming all other predictors (besides year) are the same as 1996.

3.  (11  points) In this problem, you will work with data in 321aatemp even . csv and 321aatemp odd . csv, located on Learn under Assignments/Datasets. The data con- tains information about annual average temperature  (in degrees  F) in Ann Arbor, Michigan between 1900 and 2000.

(a)  Fit three MLR models to the even-numbered year data (in 321aatemp even. csv) with response temp.  As predictors, include polynomial transformations of year up to degree 1, 5 and 12.

(b)  Draw a scatter plot of year against temp. Based on each your three models from part (a), superimpose the estimated relationship between year and expected temp, as well as lower and upper bounds for 95% prediction intervals for the years in the dataset.

(c)  Based on each your three models from part (a), predict the annual average temper- ature for the odd-numbered years and compute the sum of squared errors between these predictions and the actual odd-numbered year data (in 321aatemp odd. csv). Which model gives the smallest sum of squared prediction errors?

4.  (11 points) In this problem, you will work with data in 321chd . csv, located on Learn under Assignments/Datasets.  The data contains information about coronary heart disease among a sample of American men.  The dataset contains three variates:

-  chd (categorical) did this subject develop coronary heart disease?

-  chol (continuous) subject’s cholesterol level (mmol/L).

-  smoke (categorical) does the subject smoke?

(a)  Produce a plot to visualize the relationship between chd and chol.  Does there appear to be a relationship between these two variates?

(b)  Produce a table to summarize the relationship between  chd and  smoke.   Does there appear to be a relationship between these two variates?

(c)  Fit a logistic regression model with response chd and predictors chol and smoke. Report the summary output for this model.

(d) Interpret βchol and βsmokeY  in the context (and units of measurement) of the prob- lem. Report 95% confidence intervals for these two parameters.

Additional instructions:

If you are unsure how to use an R function, its documentation can be viewed by typing a question mark and then the function name (i.e. ?function) into the RStudio console.

Unless otherwise specified, you may use results from lecture without additional justi- fication.  Results from the reference textbooks can be used, but you should show all steps for full marks.

This assignment will be graded out of 37 points.  Per the course outline, in normal circumstances it will count for 5% of your final grade.

Assignment solutions, including code, should be submitted on Crowdmark. Make sure that the uploaded solutions correspond to the correct problem.  If the assignment is submitted with written solutions but no supporting code, it will be graded as normal, but the point total will be multiplied by 0.75.

— If you experience technical difficulties using Crowdmark,

1.  Consult Crowdmark Help

2. Watch this short video about submitting an assignment on Crowdmark

3.  As a last resort, if you cannot upload your assignment to Crowdmark before the deadline, email it to [email protected], so I have proof that you com- pleted your assignment on time.

— If you choose to submit typed solutions, please also email me the  . tex or RMarkdown files used to compile your solutions.

— Rules regarding extensions for  (formally  documented)  absences and grades for late submissions are provided in the course outline on Learn.



软件开发、广告设计客服
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 9951568
© 2021 www.rj363.com
软件定制开发网!