[R] Proportional data with categorical explanatory variables

Michael Dewey info at aghmed.fsnet.co.uk
Mon Nov 20 17:27:42 CET 2006


At 10:32 20/11/2006, Markus Brändel wrote:
>Dear r-users,
>
>My experiment is an germination experiment in which three types of seeds were
>stratified at one temperature for 0, 3 and 6 weeks, respectively, following
>germination tests at six test temperatures. The 
>question is, are the main factors
>(seed type 3 [‘morphs’below] , stratification 
>time 3 , test temperature 6 ) and
>interactions significant.
>Proportional data with categorical explanatory variables - a three factorial
>analysis of deviance.
>
>Thanks to Micheal Crawley and his books:
>
>bidens<-read.table("K:/Bidens
>tripartita/Stratifikation/Bidens_Strat_Stat_log.txt", header=T)
>attach(bidens)

You can use data= in your call of glm to avoid this

>names(bidens)
>y<-cbind(germinated, total-germinated)
>model<-glm(y~morph*strat*test, quasibinomial)

Could be
model <- glm(cbind(germinated, total-germinated) 
~ morph*strat*test, data = bidens, family = quasibinomial)

>summary(model)
>

[snip many lines of dataframe


>The r-output looks like that:
>
>Call:
>glm(formula = y ~ morph * strat * test, family = quasibinomial)
>
>Deviance Residuals:
>        Min          1Q      Median          3Q         Max
>-4.8938080  -0.2407111   0.0001187   0.1658504   4.6929694
>
>Coefficients:
>                                        Estimate Std. Error   t value Pr(>|t|)
>(Intercept)                           4.974e-16  3.258e-01  1.53e-15 1.000000
>morphinter                           -2.461e+00 
>6.902e-01    -3.565 0.000650 ***
>morphperipher                        -1.638e+00 
>5.567e-01    -2.942 0.004386 **
>stratthree                           -2.207e+01  6.339e+03    -0.003 0.997232
>stratzero                            -2.204e+01  6.332e+03    -0.003 0.997232
>testsixteen                           2.214e+01  6.334e+03     0.003 0.997221
>testtwelve                            2.833e+00 
>7.822e-01     3.622 0.000541 ***
>testtwenty                            2.214e+01  6.334e+03     0.003 0.997221
>morphinter:stratthree                 2.299e+01  6.339e+03     0.004 0.997116
>morphperipher:stratthree              1.592e+00  8.963e+03  1.78e-04 0.999859
>morphinter:stratzero                  2.390e+00  8.957e+03  2.67e-04 0.999788
>morphperipher:stratzero               1.646e+00  8.963e+03  1.84e-04 0.999854
>morphinter:testsixteen                2.406e+00  8.962e+03  2.68e-04 0.999787
>morphperipher:testsixteen             1.605e+00  8.960e+03  1.79e-04 0.999858
>morphinter:testtwelve                 2.995e+00 
>1.344e+00     2.229 0.028946 *
>morphperipher:testtwelve              8.456e-01  1.042e+00     0.812 0.419651
>morphinter:testtwenty                 2.450e+00  8.958e+03  2.73e-04 0.999783
>morphperipher:testtwenty              1.605e+00  8.960e+03  1.79e-04 0.999858
>stratthree:testsixteen                4.432e+00  8.961e+03  4.95e-04 0.999607
>stratzero:testsixteen                -1.192e+00  8.956e+03 -1.33e-04 0.999894
>stratthree:testtwelve                 1.907e+01  6.339e+03     0.003 0.997608
>stratzero:testtwelve                 -2.848e+00  8.962e+03 -3.18e-04 0.999747
>stratthree:testtwenty                 2.206e+01  1.097e+04     0.002 0.998402
>stratzero:testtwenty                  2.754e+00  8.956e+03  3.08e-04 0.999755
>morphinter:stratthree:testsixteen    -2.323e+01  1.098e+04    -0.002 0.998317
>morphperipher:stratthree:testsixteen  1.605e+01  1.417e+04     0.001 0.999100
>morphinter:stratzero:testsixteen     -1.948e+00  1.267e+04 -1.54e-04 0.999878
>morphperipher:stratzero:testsixteen  -1.837e+00  1.267e+04 -1.45e-04 0.999885
>morphinter:stratthree:testtwelve     -2.341e+01  6.339e+03    -0.004 0.997064
>morphperipher:stratthree:testtwelve  -1.488e+00  8.963e+03 -1.66e-04 0.999868
>morphinter:stratzero:testtwelve       1.478e+01  1.097e+04     0.001 0.998929
>morphperipher:stratzero:testtwelve   -8.431e-01  1.268e+04 -6.65e-05 0.999947
>morphinter:stratthree:testtwenty     -2.298e+01  1.417e+04    -0.002 0.998710
>morphperipher:stratthree:testtwenty  -1.594e+00  1.552e+04 -1.03e-04 0.999918
>morphinter:stratzero:testtwenty      -1.643e+00  1.267e+04 -1.30e-04 0.999897
>morphperipher:stratzero:testtwenty   -1.530e+00  1.267e+04 -1.21e-04 0.999904
>---
>Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
>(Dispersion parameter for quasibinomial family taken to be 2.387982)
>
>     Null deviance: 3155.83  on 107  degrees of freedom
>Residual deviance:  193.19  on  72  degrees of freedom
>AIC: NA
>
>Number of Fisher Scoring iterations: 18
>
>
>But in a first step the only thing I like to know is:
>
>
>
>                                        Estimate Std. Error   t value Pr(>|t|)
>(Intercept)
>morph
>strat
>test
>Morph*strat  and so on
>
>What is my fault?

You will not get a single estimate for morph, strat, test.
Have you tried to reproduce an example from your 
textbook which has terms like this which have more than one degree of freedom?


>Thank you very much for your help
>
>Markus
>
>
>
>
>Dr. Markus Brändel
>Biocenter Klein Flottbek and Botanical Garden
>University of Hamburg
>Ohnhorststr. 18
>22609 Hamburg
>Germany
>
>Phone: +4940 42816-577
>Fax:    +4940 42816-254
>
>         [[alternative HTML version deleted]]

Michael Dewey
http://www.aghmed.fsnet.co.uk



More information about the R-help mailing list