[R] Missing values and geeglm

E elaine.fuertes at gmail.com
Mon Jul 18 17:34:41 CEST 2011


Dear all

I am struggling with how to deal with missing values using geeglm. I know
that geeglm only works with complete datasets, but I cannot seem to get the
na.omit function to work.  For example

assuming DataMiss contains 3 columns, each of which has missing
observations, and an id column with no missing info then identifies the
clusters.

Outcome: 2 level integer
Predictor: numeric variable
Confounder: 3 level integer

 If I "manually" remove the missing values then run the model, there is no
problem. 

#remove missing values
data<-subset(DataMiss, !is.na(outcome) & !is.na(predictor) &
!is.na(confounder))

#run the model
model<-geeglm(outcome~predictor+confounder, family=binomial(link = "logit"), 
data=data, corstr='ar1', id=id, std.err="san.se")

However, I don't always want to have to run this extra step. The R
instructions seem to indicate that na.omit should work, as shown below

model<-geeglm(outcome~predictor+confounder, family=binomial(link = "logit"), 
data=na.omit(DataMiss), corstr='ar1', id=id, std.err="san.se")

But I keep getting this error. Any help would be greatly appreciated!

Error in family$linkfun(mustart) : 
  Argument mu must be a nonempty numeric vector







--
View this message in context: http://r.789695.n4.nabble.com/Missing-values-and-geeglm-tp3675622p3675622.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list