Hi there, I am new to the package glmmadmb, but need it to perform a zero-inflated gzlmm with a binomial error structure. I can't seem to get it to work without getting some strange error messages. I am trying to find out what is affecting the number of seabird calls on an array of recorders placed at 4 sites on 6 islands. I have nightly variables (weather and moonlight), site variables (proximity to a source population of seabirds and proximity to a refugia from predators). and island variables (island size and number of years since predator eradication). Here's a sample of my data: Date ISLAND SITE Calls Years Erad Island size Refugia Dist Source Moon Wind Speed 5/28/2009 Amatignak East 9 19 3543 3 58.6 0.2 2.54 5/29/2009 Amatignak East 120 19 3543 3 58.6 0.3 4.63 5/30/2009 Amatignak East 18 19 3543 3 58.6 0.4 13.09 6/4/2009 Amatignak North 23 19 3543 2 54.2 0.9 4.14 6/5/2009 Amatignak North 69 19 3543 2 54.2 1 2.06 6/6/2009 Amatignak North 62 19 3543 2 54.2 1 3.94 6/7/2009 Buldir N Bight 357 100 2000 4 0 1 7.49 6/8/2009 Buldir N Bight 567 100 2000 4 0 1 4.17 6/9/2009 Buldir N Bight 150 100 2000 4 0 1 4.13 My model is as follows: number of seabird calls ~ weather+moonlight+distance to source population+island size+years since predator eradication+nearby refugia from predators+ (1|Site/Island) first I removed na's from my data callsna <- na.omit(calls) Then I started simple, with only "moonlight" and "weather" included in a model (just as a test): mod <- glmmadmb(Calls~ Moon+Wind.Speed+(1|SITE/ISLAND), data=callsna, zeroInflation=TRUE, family="nbinom") I get the following error message: Error in II[, ii] = II[, ii] + REmat$codes[[i]] : replacement has length zero In addition: Warning message: In matrix(rep(q, m), nrow = n, ncol = sum(m), byrow = TRUE) : data length exceeds size of matrix I get the same error message when I try with the full model or a null model! I don't understand what this means. The model works ok in lmer4 with a poisson distribution (althought it's very overdispersed), so it's not as though it wont work at all. Any help with this would be greatly appreciated cheers Rachel -- View this message in context: http://r.789695.n4.nabble.com/glmmADMB-tp4616701.html Sent from the R help mailing list archive at Nabble.com.
rbuxton <moyble <at> hotmail.com> writes:> I am new to the package glmmadmb, but need it to perform a > zero-inflated gzlmm with a binomial error structure. I can't seem > to get it to work without getting some strange error messages.# I am trying to find out what is affecting the number of seabird # calls on an array of recorders placed at 4 sites on 6 islands. I # have nightly variables (weather and moonlight), site variables # (proximity to a source population of seabirds and proximity to a # refugia from predators). and island variables (island size and # number of years since predator eradication). [snip]> My model is as follows: > > number of seabird calls ~ weather+moonlight+ > distance to source population+island size+ > years since predator eradication+nearby refugia from > predators+ (1|Site/Island)> first I removed na's from my data > > callsna <- na.omit(calls) > > Then I started simple, with only "moonlight" and "weather" included in a > model (just as a test): > > mod <- glmmadmb(Calls~ Moon+Wind.Speed+(1|SITE/ISLAND), data=callsna, > zeroInflation=TRUE, family="nbinom") > > I get the following error message: > Error in II[, ii] = II[, ii] + REmat$codes[[i]] : > replacement has length zero > In addition: Warning message: > In matrix(rep(q, m), nrow = n, ncol = sum(m), byrow = TRUE) : > data length exceeds size of matrixI can't tell without a reproducible example. You're not making any obvious mistakes. Can you send your data or post it somewhere? Followups should probably go to the r-sig-mixed-models <at> r-project.org mailing list ... Ben Bolker
http://r.789695.n4.nabble.com/file/n4618871/Data_for_list_serve.csv Data_for_list_serve.csv Here is my data, hope this helps. The "LESP CHUCKLE" , "FTSP FLIGHT", and "ANMU CHIRRUP" are the dependent variables, I want to run one model for each. So, again the desired model is: mod <- glmmadmb(LESP.CHUCKLE~ Years.Erad+IS+Ref+Dist.Buldir+Food+Moon+Wind.Speed+(1|SITE/ISLAND), data=callsna, zeroInflation=TRUE, family="nbinom") cheers! Rachel -- View this message in context: http://r.789695.n4.nabble.com/glmmADMB-tp4616701p4618871.html Sent from the R help mailing list archive at Nabble.com.
Update! I changed the "site" categories. I noticed that I had coded them as "North, South, East, West" on different islands, which may have caused confusion in the model. Now I get a whole new error message! Error in glmmadmb(LESP.CHUCKLE ~ 1 + (1 | SITE/ISLAND), data = callsna, : The function maximizer failed (couldn't find STD file) In addition: Warning message: running command 'C:\windows\system32\cmd.exe /c "C:/Users/Rachel/Documents/R/win-library/2.14/glmmADMB/bin/windows32/glmmadmb.exe" -maxfn 500 -maxph 5 -noinit -shess' had status 1 I followed the instruction you gave to a similar error message posted in google groups (I downloaded version 0.7 and installed it): http://groups.google.com/group/admb-users/browse_thread/thread/56d665acfb756ac4 With no avail! Still get the same lousy error message! The following models work ok: mod <- glmmadmb(LESP.CHUCKLE~ 1+(1|SITE), data=callsna, zeroInflation=TRUE, family="nbinom") and mod <- glmmadmb(LESP.CHUCKLE~ 1+(1|ISLAND), data=callsna, zeroInflation=TRUE, family="nbinom") Any thoughts? Thanks so so much! Rachel Buxton -- View this message in context: http://r.789695.n4.nabble.com/glmmADMB-tp4616701p4619221.html Sent from the R help mailing list archive at Nabble.com.
Hi there, I am using R version 2.14.2, package glmmADMB Here is the entire script: calls <- read.csv(file.choose())> callsna <- na.omit (calls) > mod <- glmmadmb(LESP.CHUCKLE~ > Years.Erad+IS+Ref+Moon+Wind.Speed+Dist.Buldir+(1|SITE/ISLAND), > data=callsna, zeroInflation=TRUE, family="nbinom") > summary(mod)Error in glmmadmb(LESP.CHUCKLE ~ 1 + (1 | SITE/ISLAND), data = callsna, : The function maximizer failed (couldn't find STD file) In addition: Warning message: running command 'C:\windows\system32\cmd.exe /c "C:/Users/Rachel/Documents/R/win-library/2.14/glmmADMB/bin/windows32/glmmadmb.exe" -maxfn 500 -maxph 5 -noinit -shess' had status 1 Here is my data: http://r.789695.n4.nabble.com/file/n4621934/FOR_ANALYSIS.csv FOR_ANALYSIS.csv If the data attachment isn't working properly, I can email it to you directly cheers! Rachel ps can you not use continuous random variables in glmmADMB? When I try to use the term (1|Day of year) - Day of year is a continuous random variable - I get the following error message: Error in Droplevels(eval(parse(text = x), data)) : all grouping variables in random effects must be factors -- View this message in context: http://r.789695.n4.nabble.com/glmmADMB-tp4616701p4621934.html Sent from the R help mailing list archive at Nabble.com.