Estimate_Age_Maturity {AquaticLifeHistory} | R Documentation |
Estimate age-at-maturity
Description
Age-at-maturity is estimated from binary maturity data using a logistic ogive. Two options are available depending on error structure. If binary data are used then a binomial error structure is required. If the user wishes to bin the data by age class then a quasi binomial error structure is needed with the data weighted by the sample size of each bin. This is handled automatically by the function.
Usage
Estimate_Age_Maturity(
data,
error.structure = "binomial",
n.bootstraps = 1000,
display.points = FALSE,
return = "parameters"
)
Arguments
data |
A dataframe that includes age and a binary maturity status (immature = 0 and mature = 1). Columns should be named "Age" and "Maturity" but the function is robust enough to accept some reasonable variations to these |
error.structure |
The distribution for the glm used to produce the logistic ogive. Must be either "binomial" for binary data or "quasi binomial" for binned maturity at age. Proportion mature at each age is automatically calculated within the function |
n.bootstraps |
Number of bootstrap iterations required to produce 95% confidence intervals about the logistic ogive |
display.points |
Should the raw data be plotted for the binomial model? |
return |
Either:
|
Value
Either:
- parameters
a dataframe of the estimated logistic parameters and their standard error (A50 and A95)
- estimates
a dataframe of logistic ogive predictions with 95 percent confidence intervals
- plot
a ggplot object of the logistic ogive
Examples
# load example data set
data("maturity_data")
# Run function to estimate age-at-maturity parameters
Estimate_Age_Maturity(maturity_data)
# A plot can also be returned with bootstrapped CI's. Use 100 bootstraps for
# testing and then increase to at least 1000 for actual model runs.
Estimate_Age_Maturity(maturity_data, return = "plot",n.bootstraps = 100)