11.07.2015 Views

INTRODUCTION TO STATISTICAL MODELLING IN R

INTRODUCTION TO STATISTICAL MODELLING IN R

INTRODUCTION TO STATISTICAL MODELLING IN R

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

P.M.E.Altham, University of Cambridge 39# subset=(nfail!=0).# ‘!=’ means ‘not equal to’ and is the negation of ‘==’?"&" # for full information on the logical symbolsDo you have any comments on the design of this experiment?The data (read this by read.table(“...”,header=T)) follow.nfail temp2 531 571 581 630 660 670 670 670 680 690 700 701 701 700 720 730 752 750 760 760 780 790 81first.glm = glm(pfail~ temp, binomial, weights=six)fv = first.glm$fitted.valuesplot(temp, fv, type="l", xlim=c(30,85), ylim=c(0,1), xlab="temperature",ylab="probability of failure")points(temp, pfail)title("The space shuttle failure data, with the fitted curve")The corresponding logistic graph is shown in Figure 8.1. I took the temperaturevalues from 30 degrees to 85 degrees (the x-axis) to emphasize the fact that we haveno data in the range 30 degrees to 50 degrees.Note added June 2012.A very interesting use of a complex logistic regression on a large dataset is given byWesthoff, Koepsell and Littell, Brit Med Journal, 2012, ‘Effects of experience and

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

Saved successfully!

Ooh no, something went wrong!