[R] Missing values in glm

Becki Deacon beckideacon at hotmail.com
Sat Aug 25 12:57:27 CEST 2001


Dear r-help

I am trying to fit a logistic regression with a dataset that has some 
missing values in the categorical response (sjukdom). These are generated 
'false' values that I want predicited values for.

Looking at the help, I think the correct commands to deal with these missing 
values are as follows:

options(na.action=napredict)
my.dum<-glm(sjukdom~as.factor(sex)+age+log.nrg+five.d+five2+five3+d1+d2+d3+d4+d5,na.action,family="binomial")

However, I get the following error message:
'Error in as.data.frame.default(data) : can't coerce function into a 
data.frame'

I have not been able to come up with anything better as other things treat 
the variable sjukdom as a different length and so will not do the regression 
either.

Could you let me know how to solve this please?

Many thanks

Rebecca Deacon
Post-Grad Statistics Student


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list