Presentation
- # Two stage regression
- dt<-brabant[samp,]
- dt$logitrate=predict(rfm.logit, type="response")
- dt<-dt[which(ca97>0),]
- attach(dt)
- rfm.2stage<-lm(ca97 ~r6 + rr6 + f6m + m6m + mm6m + caa96 + cda96 + logitrate)
- dt<-brabant[-samp,]
- dt$logitrate=predict(rfm.logit, type="response", newdata=dt)
- attach(dt)
- predictv<-predict(rfm.2stage, newdata=dt)*predict(rfm.logit, type="response", newdata=dt)
- names(predictv)<-1:length(predictv)
- gc<-gainchart_cont(predictv,ca97)
- par(mfrow=c(2,2))
- plot_gaincharts_cont(gc)
Loading required package: tcltk
Loading required package: lattice
Loading required package: foreign
Loading required package: abind
Loading required package: lmtest
Loading required package: multcomp
Loading required package: relimp
Loading required package: effects
Loading required package: rgl
Loading required package: mgcv