1. Homepage
  2. Programming
  3. [2022] STA303/1002 Methods of Data Analysis II - Lab 1: Linear Regression Model

[2022] STA303/1002 Methods of Data Analysis II - Lab 1: Linear Regression Model

Engage in a Conversation
STA303Methods of Data Analysis IILinear RegressionRfarawaypimaToronto

STA303 Lab1 CourseNana.COM


CourseNana.COM

This lab is meant to: CourseNana.COM

·      Introduce you to latex CourseNana.COM

·      Review logistic regression concepts CourseNana.COM

·      Get you working with one of the “state-of-the-art” packages for regression CourseNana.COM

You may use any piece of code I have provided. While in class, you may work together, but you must write up the solutions yourself. I do not allow collaboration outside of class. You may not share code with one another at any point. Clearly label each question. CourseNana.COM

The National Institute of Diabetes and Digestive and Kidney Diseases conducted a study on 768 adult female Pima Indians living near Phoenix. The purpose of the study was to investigate factors related to diabetes.  pima dataset is available in the “faraway” package. You will only use a sample of these data. The first 4 lines of code in your .rmd file should be: CourseNana.COM

library(rms) CourseNana.COM

data(pima, package="faraway") CourseNana.COM

set.seed(STUDENTNUMBER) CourseNana.COM

pima = pima[sample(1:nrow(pima), size = 120, replace = FALSE),] CourseNana.COM

  CourseNana.COM

1)    [1 marks] Load the data and focus your attention on the outcome variable (test=1 means they had diabetes) and age, bmi, and pregnancy as predictors. Perform some basic exploratory data analysis and data cleaning as needed. Document any changes you made to the dataset. This question is worth 1 mark, one or two sentences/plots is fine. CourseNana.COM

2)    [3 marks] Fit a logistic regression model with no interactions. CourseNana.COM

a.    Interpret the coefficient for bmi as an odds ratio. CourseNana.COM

b.    Interpret the coefficient as a change in probability near the average bmi (use the exact method). Show your work using latex. Hint: For the other x-values, plug in their means. CourseNana.COM

3)    [3 marks] Fit a new model, adding age/pregnancy and age/bmi interactions to the model in question 2. CourseNana.COM

a.    Perform a likelihood ratio test to determine if the interactions provide an improvement in the fit. Report the test statistic and p-value. CourseNana.COM

b.    Perform a Wald tests on each interaction coefficient. (Null hypothesis is coefficient = 0, significance level = 0.05) CourseNana.COM

4)    [5 marks] Use bootstrap validation on both models with B=500 CourseNana.COM

a.    Which model shows better predictive/discrimination ability in the original dataset? CourseNana.COM

b.    Which model shows better predictive/discrimination ability on new datasets? CourseNana.COM

c.     Comment on the degree of overfitting in both models. CourseNana.COM

d.    For the no-interaction model, compute the re-calibrated regression coefficient for bmi. Show your work using latex. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
STA303代写,Methods of Data Analysis II代写,Linear Regression代写,R代写,faraway代写,pima代写,Toronto代写,STA303代编,Methods of Data Analysis II代编,Linear Regression代编,R代编,faraway代编,pima代编,Toronto代编,STA303代考,Methods of Data Analysis II代考,Linear Regression代考,R代考,faraway代考,pima代考,Toronto代考,STA303help,Methods of Data Analysis IIhelp,Linear Regressionhelp,Rhelp,farawayhelp,pimahelp,Torontohelp,STA303作业代写,Methods of Data Analysis II作业代写,Linear Regression作业代写,R作业代写,faraway作业代写,pima作业代写,Toronto作业代写,STA303编程代写,Methods of Data Analysis II编程代写,Linear Regression编程代写,R编程代写,faraway编程代写,pima编程代写,Toronto编程代写,STA303programming help,Methods of Data Analysis IIprogramming help,Linear Regressionprogramming help,Rprogramming help,farawayprogramming help,pimaprogramming help,Torontoprogramming help,STA303assignment help,Methods of Data Analysis IIassignment help,Linear Regressionassignment help,Rassignment help,farawayassignment help,pimaassignment help,Torontoassignment help,STA303solution,Methods of Data Analysis IIsolution,Linear Regressionsolution,Rsolution,farawaysolution,pimasolution,Torontosolution,