[R] difficulties with MuMIn model generation with coxph

sgilbert sophielgilbert at gmail.com
Tue Oct 25 02:08:41 CEST 2011


Hi All,

I'm having trouble with the automatized model generation (dredge) function
in the MuMIn package. I'm trying to use it to automatically generate subsets
of models from a global cox proportional hazards model, and rank them based
on AICc. These seems like it's possible, and the Mumin documentation says
that coxph is supported. However, when I run the code (see below), it gives
me the following error message:

Error in UseMethod("logLik") : 
  no applicable method for 'logLik' applied to an object of class "logical"

##RCode

#read in the data

>data1<-read.table('MaleData500.csv', sep=',', header=T) 
survival<-Surv(data1$Wks.at.dth, data1$Died)

#create the full (global) model, a coxph object

>globemodel<-coxph(survival~  edgeden + pctroad + pctcc90+ pctcc80 +
pctcrsog +  ravine + canfrag + pctoldc,  data=data1)

#evaluate all subsets of models using dredge

>exhausting<-dredge(globemodel, eval=TRUE, fixed=c("pctroad"),m.max=3,
marge.ex=TRUE, rank="AICc")

Error in UseMethod("logLik") : 
  no applicable method for 'logLik' applied to an object of class "logical"


any suggestions would be greatly appreciated. The globemodel works on its
own, and prints out a summary just fine. The only thing I can think of is
that in the names of globemodel, there is an attribute called loglik, not
logLik?

Thank you,

Sophie

--
View this message in context: http://r.789695.n4.nabble.com/difficulties-with-MuMIn-model-generation-with-coxph-tp3935078p3935078.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list