jinlong li
2005-Oct-27 08:18 UTC
[R] how to predict with logistic model in package logistf ?
dear community, I am a beginer in R , and can't predict with logistic model in package logistf, could anyone help me ? thanks ! the following is my command and result :>library(logistf) >data(sex2) >fit<-logistf(case ~ age+oc+vic+vicl+vis+dia, data=sex2) >predict(fit,newdata=sex2)Error in predict(fit, newdata = sex2) : no applicable method for "predict"
Elizabeth Lawson
2005-Oct-27 15:19 UTC
[R] how to predict with logistic model in package logistf ?
Did you try fit$predict? Elizabeth Lawson jinlong li <lee_poet@hotmail.com> wrote: dear community, I am a beginer in R , and can't predict with logistic model in package logistf, could anyone help me ? thanks ! the following is my command and result :>library(logistf) >data(sex2) >fit<-logistf(case ~ age+oc+vic+vicl+vis+dia, data=sex2) >predict(fit,newdata=sex2)Error in predict(fit, newdata = sex2) : no applicable method for "predict" ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html --------------------------------- [[alternative HTML version deleted]]
David Firth
2005-Oct-27 17:22 UTC
[R] how to predict with logistic model in package logistf ?
On 27 Oct 2005, at 09:18, jinlong li wrote:> dear community, > I am a beginer in R , and can't predict with logistic model in > package > logistf,Not exactly the answer to your question, but an alternative to the logistf package, which purports to do similar things, is brlr (which does provide a predict method). Does this work for you? library(brlr) data(sex2) fit <- brlr(case ~ age + oc + vic + vicl + vis + dia, data = sex2) predict(fit, newdata = sex2) David> could anyone help me ? thanks ! > > the following is my command and result : > >> library(logistf) >> data(sex2) >> fit<-logistf(case ~ age+oc+vic+vicl+vis+dia, data=sex2) >> predict(fit,newdata=sex2) > Error in predict(fit, newdata = sex2) : no applicable method for > "predict" > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html