Cat Cowie
2013-Mar-29 10:53 UTC
[R] Error message in dredge function (MuMIn package) used with binary GLM
Hi all, I'm having trouble with the model generating 'dredge' function in the MuMIn 'Multi-model Inference' package. Here's the script: globalmodel<- glm(TB~lat+protocol+tested+ streams+goats+hay+cattle+deer, family="binomial") chat<- deviance(globalmodel)/59 #There we 59 residual degrees of freedom in this global model. models<- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank="AICc", chat=chat, fixed=NULL, trace=FALSE) And the error message is: Error in UseMethod("logLik") : no applicable method for 'logLik' applied to an object of class "logical" I have trawled the literature and it seems to be ok to use a binary GLM as the global model - could this be the problem? The variables are a mix of binary and continuous data. Any thoughts? Thanks, Cat
Kamil Barton
2013-Mar-30 01:48 UTC
[R] Error message in dredge function (MuMIn package) used with binary GLM
'rank' should be "QAICc". AICc does not have argument 'chat', hence the error. kamil CatCowie wrote> Hi all, > > I'm having trouble with the model generating 'dredge' function in the > MuMIn > 'Multi-model Inference' package. > > Here's the script: > > globalmodel<- glm(TB~lat+protocol+tested+ > streams+goats+hay+cattle+deer, > family="binomial") > chat<- deviance(globalmodel)/59 #There we 59 residual degrees of freedom > in > this global model. > models<- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank="AICc", > chat=chat, fixed=NULL, trace=FALSE) > > And the error message is: > > Error in UseMethod("logLik") : > no applicable method for 'logLik' applied to an object of class > "logical" > > I have trawled the literature and it seems to be ok to use a binary GLM as > the global model - could this be the problem? The variables are a mix of > binary and continuous data. > > Any thoughts? > Thanks, > Cat-- View this message in context: http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662881.html Sent from the R help mailing list archive at Nabble.com.
Kamil BartoĊ
2013-Apr-01 14:17 UTC
[R] Error message in dredge function (MuMIn package) used with binary GLM
Hi Cat, are you using some very old version of MuMIn? That would explain the missing 'QAICc'. As for the error message about 'logLik', it usually occurs when there are some misspelled arguments (that go into "..." and are passed to the rank function, 'AICc' in your case). Check if there is some argument (of type "logical") in your call to 'dredge' that is not its formal argument. kamil On 2013-03-30 03:13, cat.e.cowie at gmail.com wrote:> Hi Kamil, > > Thanks for your help. I do want to use rank="QAICc", but I when I try it I get the following error message: > > Error in get(as.character(FUN), mode = "function", envir = envir) : > object 'QAICc' of mode 'function' was not found > > Do I need to install another package that would recognise this? > > When I leave the script with rank="AICc" (to see if it will run), and having removed "chat" (which I put in after previously recieving an error message about it being missing from the formula), I still get my original error message: > > Error in UseMethod("logLik") : > no applicable method for 'logLik' applied to an object of class "logical" > > Any further thoughts? > Thanks, Cat > > > <quote author='Kamil Barton'> > 'rank' should be "QAICc". > AICc does not have argument 'chat', hence the error. > > kamil > > > > Hi all, > > I'm having trouble with the model generating 'dredge' function in the MuMIn > 'Multi-model Inference' package. > > Here's the script: > > globalmodel<- glm(TB~lat+protocol+tested+ > streams+goats+hay+cattle+deer, > family="binomial") > chat<- deviance(globalmodel)/59 #There we 59 residual degrees of freedom in > this global model. > models<- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank="AICc", > chat=chat, fixed=NULL, trace=FALSE) > > And the error message is: > > Error in UseMethod("logLik") : > no applicable method for 'logLik' applied to an object of class "logical" > > I have trawled the literature and it seems to be ok to use a binary GLM as > the global model - could this be the problem? The variables are a mix of > binary and continuous data. > > Any thoughts? > Thanks, > Cat > > > </quote> > Quoted from: > http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662881.html >The University of Aberdeen is a charity registered in Scotland, No SC013683.