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.
Kamil BartoĊ
2011-Oct-26 10:26 UTC
[R] difficulties with MuMIn model generation with coxph
Dear Sophie, The answer is 'typo'. 'dredge' does not have an argument named 'marge.ex'. k Dnia 2011-10-25 12:00, r-help-request at r-project.org pisze:> Message: 131 > Date: Mon, 24 Oct 2011 17:08:41 -0700 (PDT) > From: sgilbert<sophielgilbert at gmail.com> > To:r-help at r-project.org > Subject: [R] difficulties with MuMIn model generation with coxph > Message-ID:<1319501321733-3935078.post at n4.nabble.com> > Content-Type: text/plain; charset=us-ascii > > 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 >
Seemingly Similar Threads
- Error message in dredge function (MuMIn package) with binary GLM
- Error message in dredge function (MuMIn package) used with binary GLM
- Difference between stats.steps() and MuMIn.dredge() to select best fit model
- dredge solely offset models in MuMIn
- Package MuMIn (dredge): Error in ret[, ] <- cbind(x, se, rep(if (is.null(df)) NA_real_ else df, : number of items to replace is not a multiple of replacement length.