[R] producing a graph with glm poisson distributed respons count data and categorical independant variables

babs bas_pauwels at hotmail.com
Sat Jul 28 12:10:09 CEST 2012


Hi,

I do have replicates, but not many. The offsets are my the number of
replicates actually, i misled myself by thinking i could add the counts of
the replicates all up and then go further with the offset function. I 
decided to split up my experiments in order to interpret them, they were
actually from the beginning split up experiments. Because i thought i could
see if the bees reacted in a same manner to the different experiments i
thought i could analyse it with an interaction factor to reveal whether this
was true. But i want now want to analyse them apart so i can draw
conclusions from the both experiments apart.
I did the following  with the counts from p1, including the replicates so  i
have only the type of field-margin as a variable, as i was only interested
in this from the beginning:
 
mengsel	count
C	39
C	38
A	79
A	96
A	278
D	15
D	15
B	322
B	449
B	262

a.data.p1<-read.table("a.data.p1.txt",header=TRUE,sep="")
a.data.p1
fit.sat.a.p1<-glm(count~mengsel,data=a.data.p1,family=poisson)
anova(fit.sat.a.p1,test="Chisq")
fit.main.a.p1<-glm(count~1,data=a.data.p1,family=poisson)
anova(fit.sat.a.p1,fit.main.a.p1,test="Chisq")
extractAIC(fit.sat.a.p1)
extractAIC(fit.main.a.p1)
summary(fit.sat.a.p1)

This tells me that the saturated model is better explaning then the other
so:

Call:
glm(formula = count ~ mengsel, family = poisson, data = a.data.p1)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-6.4531  -3.7799  -0.0404   0.0603   9.2385  

Coefficients:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)  5.01728    0.04698  106.79   <2e-16 ***
mengselB     0.82433    0.05635   14.63   <2e-16 ***
mengselC    -1.36662    0.12327  -11.09   <2e-16 ***
mengselD    -2.30923    0.18852  -12.25   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 1385.58  on 9  degrees of freedom
Residual deviance:  202.01  on 6  degrees of freedom
AIC: 273.15

Number of Fisher Scoring iterations: 5

How can i produce a graph for this?

I am worried that i still do not have enough replicates to actually draw
descent conclusions or conclusions at all...in my second experiment i do not
have replicates  for 2 out of four types of field margins, for the other two
i only have 2 replicates. 

this being the counts from the second experiment:

C	3	p2
C	1	p2
A	90	p2
A	29	p2
D	0	p2
B	157	p2

thanks,

babs



--
View this message in context: http://r.789695.n4.nabble.com/producing-a-graph-with-glm-poisson-distributed-respons-count-data-and-categorical-independant-variabs-tp4638110p4638192.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list