I am trying to calculate 'reaction norms' for a fish species. This is essentially the length at which the probability that a fish become mature equals 50% for a particular age class.
I know I have to use a logistic regression model with binomial errors but I can't work out how to calculate this from the summary outputs or plot the regression successfully!
I have a data set that has: 'age' classes in (1,2,3,4,5,6),'Lngth' data in mm and 'Maturity' data (Immature/Mature - 0/1).
I am running a glm as follows
Model<-glm(Maturity~Lgnth, family=binomial(logit))
This however does not take into account the different age classes (I would really like to avoid creating whole new data sets for each age classes as I have multiple year ranges to test).
And even so, I do not understand how I interpret the summary output to give me a length at which the probability of being mature equals 50%, along with the standard errors of this figure.
I also can't quite get the code right to plot this. Ideally id have one plot with lngth along the x axis, probability along the y and six lines/curves representing each age classes.
I would really appreciate any help any one could provide! I know this can all be achieved but I am really struggling.
Cheers
MASS::dose.p
; (3) tryMaturity~Lgnth:factor(Age)
$\endgroup$mylogit <- glm(Maturity ~ Lngth + age, data = clupea.data, family = "binomial")
My question now is, once I have run this how do I use dose.p to calculate length at p50% maturity for each age class? Is there a way of doing it from this one modelmylogit
or do I have to run an individual model for each age class? $\endgroup$