<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Sheryn,<div><br></div><div><div>This might be more of an R-sig-mixed question than an R question, but it's too soon to tell, so I'll give a few suggestions. </div><div><br></div><div>Did you really have 39 treatment levels? You don't have enough data to estimate as many parameters as you're trying to fit: 39*2 fixed effect + 5 random effect parameters. Could some of the stand types be grouped together? Or could you leave out the interaction? Even without the interaction, there still isn't enough data for the rule of thumb requiring at least 10 data points per parameter.</div><div><br></div><div>Did you mean to specify a logit link? A log link is more standard with nbinom models. It is the default so you don't need to specify the link in addition to family.</div><div><br></div><div>Equal sample sizes are not an issue.</div><div><br></div><div>cheers,</div><div>Mollie</div><div><br></div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Mollie Brooks<br>Postdoctoral Researcher, Ponciano Lab<br>Biology Department, University of Florida<br><a href="http://people.biology.ufl.edu/mbrooks">http://people.biology.ufl.edu/mbrooks</a><br><br></div></span></span>
</div>
<br><div><div>On 18 Jan 2013, at 11:22 AM, Sheryn Olson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello,<br><br>Using R ver 2.15.2, package glmmADMB_0.7.3 in Win7,  I've been attempting to run a negative binomial model to determine the effects of season and forest stand types on snowshoe hare pellet densities.   Year is a random (nuisance) variable.  Each stand type (treatment) has unequal sample sizes that vary by year.   The count data are constrained at zero, zero inflated, and range from 0 - 990 (residuals show overdispersion).<br>

<br>Data Structure:<br><br>> str(ps)<br>'data.frame':   387 obs. of  7 variables:<br> $ year     : Factor w/ 5 levels "2008","2009",..: 1 1 1 1 1 1 1 1 1 1 ...<br> $ season : Factor w/ 2 levels "Smr","Wtr": 1 1 1 1 1 1 1 1 1 1 ...<br>

 $ stand    : Factor w/ 39 levels "AF1","AF2","AF3",..: 32 33 25 27 26 34 23 31 24 28 ...<br> $ stndtyp: Factor w/ 3 levels "MT","RG","SEL": 1 1 1 1 1 1 1 1 1 1 ...<br>

 $ pellets:  int  1 1 2 2 4 5 7 9 12 13 ...<br> $ days   : num  114 114 127 127 127 127 122 112 115 112 ...<br> $ ln.days: num  4.74 4.74 4.84 4.84 4.84 ...<br><br>Model:<br>>  nb1 <- glmmadmb(pellets ~ season * stndtyp + offset(ln.days) + (1|year), na.omit, data=ps,family="nbinom", link="logit")<br>

<br>    Warning in glmmadmb(pellets ~ season * stndtyp + offset(ln.days) + (1 |  :<br>      NAs removed in constructing fixed-effect model frame: you should probably remove them manually, e.g. with na.omit()<br>    Warning in II[, ii] + REmat$codes[[i]] :<br>

      longer object length is not a multiple of shorter object length<br>    Error in II[, ii] = II[, ii] + REmat$codes[[i]] : <br>      number of items to replace is not a multiple of replacement length<br><br>Are there syntax problems? - with the na.omit and random specification.  Model problems? - with unequal sample sizes, or wrong specification of the link.   Do the algorithms require equal sample sizes?<br>

I'm also confused about how to know what value of theta to specify, and when it is appropriate to specify?<br><br>Thanks all.<br clear="all">-- <br>Sheryn Olson<br>Graduate Research Assistant, The University of Maine<br>

<br>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@admb-project.org">Users@admb-project.org</a><br>http://lists.admb-project.org/mailman/listinfo/users<br></blockquote></div><br></div></div></body></html>