[R] AICcmodavg
David Winsemius
dwinsemius at comcast.net
Thu Sep 13 18:00:26 CEST 2012
On Sep 13, 2012, at 5:52 AM, KerryGK wrote:
> I am using the AICmodavg package and using R version 2.15.1. I need help
> with code that is instead being read as text.
>
> Below is a subset of code... I actually have 12 models, but I am trying to
> get this to work for 2 below right now.
>
> Everything 'appears' to work through the line starting with Modnames. After
> that the code starting with aictab and beyond is recognized as text and not
> code. What am I doing incorrectly with the code?
>
> buco.models<-list ( )
> buco.models [[1]] <- glm(P.BUCO~faverage+W15CNT, family=binomial(logit),
> data=AmphAIC)
> buco.models [[2]] <- glm(P.BUCO~diam1+W15CNT, family=binomial(logit),
> data=AmphAIC)
> Modnames<-paste (“mod” , 1:length(buco.models), sep=")
------------------------------------------------------^
Not at all surprising. The usual response of a programmer faced with code that goes wrong at a particular point should be to _first_ look for missing commas or parentheses. In your case it is a missing comma.
> aictab(cand.set = buco.models, modnames = Modnames, sort=TRUE))
> print(aictab(cand.set = buco.models, modnames = Modnames, sort=TRUE) digits
> = 4)
>
David Winsemius, MD
Alameda, CA, USA
More information about the R-help
mailing list