# Is this an appropriate use of a GLM? and if so how do I predict a specific outcome?

I am hoping that someone might be able to provide me with some assistance. A colleague of mine was told to use a GLM of family binomial and a logit link function for some of the data they submitted in a paper. They are looking at the effects of temperature regimes on the proportion of seeds that germinated of an endangered plant species. Given the status of the plant the samples sizes are small.

Three populations of plants were sampled, each time with 10 seeds being germinated under various temperature conditions (note: the 30/20 is indicative of a 30 to 20 degree cycing regime). My data in R looks like this:

> data
Temperature Population_Year numGerm
1            5      Pop_C_2009    0.00
2            5      Pop_C_2010    0.00
3           10      Pop_C_2009    0.00
4           10      Pop_C_2010    0.00
5           15      Pop_C_2009    4.50
6           15      Pop_C_2010    3.50
7           20      Pop_C_2009    9.00
8           20      Pop_C_2010    9.00
9           20      Pop_S_2009    7.84
10          25      Pop_C_2009    9.00
11          25      Pop_C_2010    9.00
12          25      Pop_S_2009    9.00
13          30      Pop_C_2009    9.00
14          30      Pop_C_2010    9.00
15          30      Pop_S_2009    8.00
16          35      Pop_C_2009    7.84
17          35      Pop_C_2010    9.00
18          35      Pop_S_2009    7.84
19          40      Pop_C_2009    1.84
20          40      Pop_C_2010    3.50
21        3020      Pop_C_2009    9.00
22        3020      Pop_C_2010    9.00
23        3020      Pop_S_2009    9.00


With numGerm being the number of seeds that germinated. I then developed the following model:

GM<-cbind(numGerm, numNoGerm = 10-numGerm)
GM
Model1<- glm(GM ~ Temperature,family=binomial(logit), data=data)
summary(Model1)


The following output was generated:

Call:
glm(formula = GM ~ Temperature, family = binomial(logit), data = data)

Deviance Residuals:
Min      1Q  Median      3Q     Max
-4.174  -1.491   1.328   2.218   2.227

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.3225745  0.1446465   2.230  0.02574 *
Temperature 0.0006383  0.0002129   2.998  0.00272 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 142.16  on 22  degrees of freedom
Residual deviance: 128.48  on 21  degrees of freedom
AIC: 172.93

Number of Fisher Scoring iterations: 4


So now this tells me that temperature is positively (and significantly) influencing the proportion of seeds germinated. However, I would now like to predict the temperature at which all seeds might germinate or alternatively the probability of all seeds germinating at a given temperature (I hope my wording of this is adequate). This is where I get stuck as I am not entirely sure how to go about this. I have done the following, but I may be confusing things and cannot determine what the qualitative value is of the output I am getting.

predictor<-data.frame(Temperature=c(5,10,15,20,25,30,35,40,3020))
predict(Model1,predictor,type = "response")

1         2         3         4         5         6         7         8         9
0.5807288 0.5815057 0.5822821 0.5830581 0.5838338 0.5846090 0.5853838 0.5861581 0.9046656


Any help would be GREATLY appreciated!

updated with new results, adding in a covariate for cycling:

> data
Temperature cycling Population_Year numGerm
1            5       0      Pop_C_2009    0.00
2            5       0      Pop_C_2010    0.00
3           10       0      Pop_C_2009    0.00
4           10       0      Pop_C_2010    0.00
5           15       0      Pop_C_2009    4.50
6           15       0      Pop_C_2010    3.50
7           20       0      Pop_C_2009    9.00
8           20       0      Pop_C_2010    9.00
9           20       0      Pop_S_2009    7.84
10          25       0      Pop_C_2009    9.00
11          25       0      Pop_C_2010    9.00
12          25       0      Pop_S_2009    9.00
13          30       0      Pop_C_2009    9.00
14          30       0      Pop_C_2010    9.00
15          30       0      Pop_S_2009    8.00
16          35       0      Pop_C_2009    7.84
17          35       0      Pop_C_2010    9.00
18          35       0      Pop_S_2009    7.84
19          40       0      Pop_C_2009    1.84
20          40       0      Pop_C_2010    3.50
21          25       1      Pop_C_2009    9.00
22          25       1      Pop_C_2010    9.00
23          25       1      Pop_S_2009    9.00

Model1<- glm(GM ~ Temperature+cycling,family=binomial(logit), data=data)
summary(Model1)


output is now:

Call:
glm(formula = GM ~ Temperature + cycling, family = binomial(logit),
data = data)

Deviance Residuals:
Min      1Q  Median      3Q     Max
-4.758  -1.399   0.000   1.548   2.563

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.57717    0.38555  -4.091 4.30e-05 ***
Temperature  0.08397    0.01577   5.324 1.02e-07 ***
cycling      1.67510    0.62981   2.660  0.00782 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 142.164  on 22  degrees of freedom
Residual deviance:  95.445  on 20  degrees of freedom
AIC: 139.43

Number of Fisher Scoring iterations: 5


Update 2:Addition of population as a covariate

Model1<- glm(GM ~ Temperature+cycling+Population_Year,family=binomial(logit), data=data)
summary(Model1)

Call:
glm(formula = GM ~ Temperature + cycling + Population_Year, family = binomial(logit),
data = data)

Deviance Residuals:
Min       1Q   Median       3Q      Max
-4.1807  -1.3694   0.3702   1.3162   3.0337

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)     -2.23022    0.51507  -4.330 1.49e-05 ***
Temperature      0.07985    0.01578   5.059 4.21e-07 ***
cycling          1.64228    0.63302   2.594  0.00948 **
Population_Year  0.41742    0.20929   1.994  0.04611 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 142.164  on 22  degrees of freedom
Residual deviance:  91.354  on 19  degrees of freedom
AIC: 136.84

Number of Fisher Scoring iterations: 5

• Can we trust 3020$^\circ$C (presumably Celsius is being used here) as a temperature? Wouldn't it incinerate the seeds? This is not just a detail as the temperature dependency depends on it. – Nick Cox Oct 25 '16 at 11:25
• If you entered 3020 into the analysis, results need to be redone. Perhaps use 25 and add a covariate for cycling, except that you aren't exactly drowning in degrees of freedom. – Nick Cox Oct 25 '16 at 11:27
• @mdewey, perfect, thanks! I will do this and update the question to address my other issues. – Wesley Hattingh Oct 25 '16 at 11:36
• Being interested in it and whether it makes a difference are two different matters. If I were a reviewer of your paper/examiner of your dissertation/whatever, I would look askance at lumping together different kinds of seeds without checking for a difference. – Nick Cox Oct 25 '16 at 11:52
• How can you have 7.84 out of 10 seeds germinating? – JAD Oct 25 '16 at 12:01