# TYÖARKKI 7. # # Logistinen regressio ja turvallisuus avaruudessa. # Swan ja Rigby (GLIM Newsletter 24, 1995) käsittelevät oheista aineistoa # käyttäen binomiaalista logistista regressiota. # Lainaus artikkelista: # "In 1986 the NASA space shuttle Challenger exploded shortly after it # was launched. After an investigation ... # ... # The temperatures for the 23 previous launches ranged from 53 to 81 degrees # Fahrenheit (ie, -0.6 degrees Centigrade)" # # data <- read.table(("A:\\Kurssit\\TMallit\\Datat\\Shuttle.txt"),header=T) six <- rep(6,times=23) # "O" renkaiden lkm 6 kaikissa laukaisuissa attach(data) pfail <- nfail/six # pettäneiden renkaiden suht. osuus pfail plot(temp,pfail) # vastaava lämpötila plot(temp,pfail,type="l") summary(data) sh <- glm(pfail ~ temp,binomial,weights=six) sh; summary(sh) # Kommentoi tuloksia # Piirrä sopivia kuvioita names(sh) plot(sh,ask=T) # Hit 0)) plot(temp,pfail) sh0 summary(sh0) plot(sh0,ask=T) # Hit