I am currently trying to look at how the likelihood of reaching a particular insect life-stage (in this example 1st instar) is influenced by both temperature (factor: 6 levels - 20, 23, 26, 29, 32, 35 degrees Celsius) and species (factor: 2 levels - HA and AP).
Here is an example of what my data looks like
Temperature Species No.eggs.added No.hatched Prop.egg.to.1st
20 AP 56 37 0.66
23 AP 69 61 0.88
26 AP 139 65 0.47
29 AP 162 94 0.58
In order to analyze this data I have chosen to run a logistic regression model in R which produced the following summary output
eggmodel <- glm(cbind(No.hatched,No.eggs.added-No.hatched) ~ Temperature * Species, data=eggto1st, family = binomial(link="logit"))
summary(eggmodel)
Call:
glm(formula = cbind(No.hatched, No.eggs.added - No.hatched) ~
Temperature * Species, family = binomial(link = "logit"),
data = eggto1st)
Deviance Residuals:
[1] 0 0 0 0 0 0 0 0 0 0 0 0
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.6665 0.2822 2.361 0.01821 *
Temperature23 1.3650 0.4702 2.903 0.00369 **
Temperature26 -0.7962 0.3295 -2.416 0.01567 *
Temperature29 -0.3427 0.3240 -1.058 0.29026
Temperature32 -1.4026 0.3250 -4.316 1.59e-05 ***
Temperature35 -28.3452 51586.1741 -0.001 0.99956
SpeciesHA 0.7423 0.4391 1.691 0.09092 .
Temperature23:SpeciesHA -1.8376 0.6354 -2.892 0.00383 **
Temperature26:SpeciesHA 0.3990 0.5027 0.794 0.42735
Temperature29:SpeciesHA -1.0553 0.4896 -2.155 0.03115 *
Temperature32:SpeciesHA -1.3219 0.4976 -2.657 0.00789 **
Temperature35:SpeciesHA -0.4598 73007.1005 0.000 0.99999
Signif. codes: 0 ‘*’ 0.001 ‘’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 5.5111e+02 on 11 degrees of freedom
Residual deviance: 5.5220e-10 on 0 degrees of freedom
AIC: 73.512
Number of Fisher Scoring iterations: 22
I am trying to interpret the results of this model so could anyone please answer the following questions
- Is the intercept the log odds of an individual reaching the 1st instar if they are of species AP and kept at 20 degrees Celsius
- Are each of the TemperatureX coefficients the difference in the log odds of an individual reaching the 1st instar if they are of species AP kept at temperature X compared to 20 degrees Celsius. As such would you add this to the intercept if you wanted to calculate the log odds of an individual reaching the 1st instar of species AP when kept at temperature X.
- Likewise, is the speciesHA coefficient the difference in log odds of an individual reaching the 1st instar at 20 degrees when they are species HA compared to species AP.
- How do I interpret the interaction effect coefficients? In order to, for example, get the log odds of reaching 1st instar for species HA at 23 degrees would the formula be intercept + Temperature23 + SpeciesHA + Temperature23:SpeciesHA? Also, what do the p-values for these interaction terms signify?
Any help anyone can provide me with my questions would be greatly appreciated.
carpackage noted in the answer has such tools, for example itslinearHypothesis()function. Theemmeanspackage is often used for post-modeling analysis. – EdM Nov 15 '22 at 17:52emmeanspackage for post-model analysis. It works on a very wide range of model types. It can seem daunting when you first try to use it, but there are several vignettes describing its use, tutorials on line, and an author who often responds to coding questions on Stack Overflow and to statistical questions on this site. – EdM Nov 15 '22 at 18:05