10.07.2015 Views

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

Using R for Introductory Statistics : John Verzani

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Two extensions of the linear model 341acceptance modeled by the batting average (BA), the number of lifetime home runs (HR),the number of hits (hits), and the number of games played (games).First, we make binary variable <strong>for</strong> Hall of Famemembership.> hfm=hall.fame$Hall.Fame.Membership != "not a member"Now, fit a logistic regression model of hfm modeled by the variables above. Which arechosen by stepAIC () ?12.5 The esoph data set contains data from a study on esophageal cancer. The datarecords the number of patients with cancer in ncases and the number of patients in thecontrol group with ncontrols. The higher the ratio of these two variables the worse thecancer risk. Three factors are recorded: the age of the patient (agegp), alcoholconsumption (alcgp), and tobacco consumption (tobgp).We can fit an age-adjusted model of the effects of alcohol and tobacco consumptionwith an interaction as follows:> res.full res.add

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!