Here I provide a short code to estimate the size-at-maturity.
Through a generalized linear model under Binomial distribution Bin(n, p) we can estimate the size in which 50% (or other) of population are mature. Such information is pivotal for fishery sciences.
The model needs 3 informations:
- the size class, preferably with intervals of same amplitudes;
- number of sampled individuals mature by size class;
- number of total sampled individuals by size class.
The code also brings a plot (ggplot) and a way to save it in high quality.
Update: I also provided an additional code in order to estimate the size-at-maturity in the Bayesian framework.