[R] how to predict with logistic model in package logistf ?

jinlong li lee_poet at hotmail.com
Fri Oct 28 02:35:40 CEST 2005


fit$predict does print the fitted value for training data frame,

but what I want  is to apply the fitted model to new coming data.

maybe I can form the equation manually .

thank you!

jinlong


>From: Elizabeth Lawson <lizzylaws at yahoo.com>
>To: jinlong li <lee_poet at hotmail.com>
>CC: r-help at lists.R-project.org
>Subject: Re: [R] how to predict with logistic model  in package logistf ?
>Date: Thu, 27 Oct 2005 08:19:49 -0700 (PDT)
>
>Did you try fit$predict?
>
>Elizabeth Lawson
>
>jinlong li <lee_poet at 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 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
>
>
>---------------------------------
>  Yahoo! FareChase - Search multiple travel sites in one click.




More information about the R-help mailing list