Dear Sophie,
The answer is 'typo'. 'dredge' does not have an argument named 'marge.ex'.
k
Dnia 2011-10-25 12:00, r-help-requ...@r-project.org pisze:
Message: 131
Date: Mon, 24 Oct 2011 17:08:41 -0700 (PDT)
From: sgilbert<sophielgilb...@gmail.com>
To:r-help@r-project.org
Subject: [R] difficulties with MuMIn model generation with coxph
Message-ID:<1319501321733-3935078.p...@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
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.