[R] GLM with Binomial Distribution
Leif Rasmuson
rasmuson at uoregon.edu
Tue Jul 23 20:53:16 CEST 2013
Hi All,
I am working on re-analyzing per a reviewers request.
The goal of the project was to determine if the presence of predatory
fishes caused female crabs to delay the release of larvae. Number of
releases were recorded at three time periods: 1 hour before the
simulated tide, 3 hours after the simulated tide and 6 hours after the
tide. Predators were introduced at high tide and removed just following
the 3 hour observation. Thus we have two categorical variables with
three levels each. Time: pre-introduction, after introduction and after
removal. Predator: no-predator, predator of adults and predator of larvae.
The number of females was not consistent between trials so my initial
method was to use the SRH extension of the Kruskal wallace test to
examine the percent of of larvae released.
A reviewer suggested that I use a GLM with a binomial distribution and
logit link to analyze the larval release patterns. I used Crawley's book
to analyze the data based on proportions. See code below. The problem I
am running into is that the model is not including the predator control
and interaction is excluding the predator control and the introduction
time periods. Is this just the nature of using a binomial distribution
(and/or our small sample size) or is there a way to force R to include
all the factors and run all the interactions?
Thanks,
Leif
N=GLM$NumFemale-GLM$NumFemaleRelease
y=GLM$NumFemaleRelease
rv <-cbind(y,N)
> model1=glm(y~GLM$Time*GLM$Treatment-1,family=binomial)
> summary(model1)
Call:
glm(formula = y ~ GLM$Time * GLM$Treatment - 1, family = binomial)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.6024 -0.7146 -0.4284 -0.2512 3.9885
Coefficients:
Estimate Std. Error z value Pr(>|z|)
GLM$TimeAfterIntroduction -1.8289 0.2297 -7.963 1.68e-15 ***
GLM$TimeAfterRemoval -3.6571 0.5064 -7.222 5.14e-13 ***
GLM$TimePreIntro -5.0626 1.0029 -5.048 4.46e-07 ***
GLM$TreatmentPlanktivore -0.0123 0.3211 -0.038 0.969
GLM$TreatmentPredator -0.1589 0.3311 -0.480 0.631
GLM$TimeAfterRemoval:GLM$TreatmentPlanktivore 0.5339 0.7132 0.749 0.454
GLM$TimePreIntro:GLM$TreatmentPlanktivore 0.6561 1.2708 0.516 0.606
GLM$TimeAfterRemoval:GLM$TreatmentPredator -0.1791 0.8399 -0.213 0.831
GLM$TimePreIntro:GLM$TreatmentPredator 1.7496 1.1496 1.522 0.128
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1720.2 on 270 degrees of freedom
Residual deviance: 258.3 on 261 degrees of freedom
AIC: 378.23
Number of Fisher Scoring iterations: 6
T
--
Leif K. Rasmuson
Doctoral Candidate
Oregon Institute of Marine Biology
Phone: (253)961-1763
E-Mail: Rasmuson at uoregon.edu
><((((º>`·.¸¸.·´¯`·...¸><((((º>
More information about the R-help
mailing list