I think you want
pcount(~obs ~mng + offset(log(area)), umf)
See the example on the glm help page for using offsets in formulas.
There are also some examples in the R scripts here:
https://sites.google.com/site/hierarchicalmodelingcourse/home/r-scripts
Have a good weekend,
Richard
On Fri, Sep 17, 2010 at 7:44 PM, Matt Giovanni
<matthew...@gmail.com> wrote:
> (null <- pcount(~1~1, minkFrog))
Call:
pcount(formula = ~1 ~ 1, data = minkFrog)
Abundance:
Estimate SE z P(>|z|)
-0.172 0.0805 -2.14 0.0325
Detection:
Estimate SE z P(>|z|)
0.157 0.0856 1.84 0.0658
AIC: 1383.131
>
> (null2 <- pcount(~1~offset(log(pondArea)), minkFrog))
Call:
pcount(formula = ~1 ~ offset(log(pondArea)), data = minkFrog)
Abundance:
Estimate SE z P(>|z|)
-1.94 0.0806 -24.0 9.3e-128
Detection:
Estimate SE z P(>|z|)
0.139 0.087 1.60 0.111
AIC: 1369.915
>
On Fri, Sep 17, 2010 at 10:51 PM, Giovanni,Matthew [Reg]
<matthew....@ec.gc.ca> wrote:
> Hi Richard, Andy-
>
> Thanks for your responses. It must be Friday afternoon because I should've typed exactly what Richard suggested (adding the offset term to my covariate for management), which is what I have been doing. Sorry for the typo and confusion.
>
> But, I'm definitely confused because I still get the same summaries from my models, and I also get identical model summaries when I run the script directly and fit the n-mix models to the minkfrog data from class 6 for Richard's hierarchical modeling course:
>
> (null <- pcount(~1~1, minkFrog))
>
> Call:
> pcount(formula = ~1 ~ 1, data = minkFrog)
>
> Abundance:
> Estimate SE z P(>|z|)
> -0.172 0.0805 -2.14 0.0325
>
> Detection:
> Estimate SE z P(>|z|)
> 0.157 0.0856 1.84 0.0658
>
> AIC: 1383.131
>> (null2 <- pcount(~1~offset(log(pondArea)), minkFrog))
>
> Call:
> pcount(formula = ~1 ~ offset(log(pondArea)), data = minkFrog)
>
> Abundance:
> Estimate SE z P(>|z|)
> -0.172 0.0805 -2.14 0.0325
>
> Detection:
> Estimate SE z P(>|z|)
> 0.157 0.0856 1.84 0.0658
>
> AIC: 1383.131
>
>
>
> I also fit a model with "log(area)" as a covariate, and there was no particular correlation in either direction, but I find this hard to believe given the large range of areas among our sampling sites.
>
> If you have a moment, I would be tremendously grateful if you could have a gander at my R and csv files (attached).
>
> Guys, thanks again and have a great weekend.
>
> Matt
>
> ______________________________________
> Matt Giovanni, Ph.D.
> Postdoctoral Visiting Research Fellow
> Canadian Wildlife Service
> 2365 Albert St., Room 300
> Regina, SK S4P 4K1
> 306-780-6121 work
> 402-617-3764 mobile
> Research website:
> http://sites.google.com/site/matthewgiovanni/
Richard