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.

Chapter 7Logistic regression for thebinomial distributionHere is our first use of a distribution other than the normal. We do a very simpleexample with binomial logistic regression.The dataset comes from ‘Modelling Binary Data’, by D.Collett(1991). The compressivestrength of an alloy fastener used in aircraft construction is studied. Tenpressure loads, increasing in units of 200psi from 2500 psi to 4300 psi, were used.Heren= number of fasteners tested at each loadr= number of these which FAIL.We assume that r i is Binomial(n i , π i ) for i = 1, . . . , 10 and that these 10 randomvariables are independent. We model the dependence of π i on Load i , using graphswhere appropriate.The model assumed below islog(π i /(1 − π i )) = a + b × Load i .[This is the LOGIT link in the glm, here the default link.] Note that we do theregression here with p = r/n as the ‘y-variable’ , and n as ‘weights’. Seehelp(glm)for general syntax.The corresponding data, given at the end of this sheet, is in the file calledalloyfSo, first set up the file ‘alloyf’.data6

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

Saved successfully!

Ooh no, something went wrong!