morph_mature: Estimate morphometric mature

View source: R/morphMat-main.R

morph_matureR Documentation

Estimate morphometric mature

Description

Estimate size at morphometric maturity.

Usage

morph_mature(data, method = "fq", niter = 999, seed = 70388)

Arguments

data

an object of class 'classify' with the allometric variables ("X", "Y") and classification of maturity (juveniles = 0, adults = 1).

method

a character string indicating the method to be applied, "fq" frequentist GLM, or "bayes" Bayes GLM (MCMClogit function).

niter

number of iterations (bootstrap resampling).

seed

a single value, interpreted as an integer.

Details

Estimate the size at morphometric maturity using a logistic regression with X variable and maturity classification (two categories: juveniles and adults).

The function requires an object of class "classify" with the X, Y (allometric variables) and classification of maturity (juveniles = 0, adults = 1).

The argument method requires a character string indicating which regression will be used for the test. If method = "fq" the logistic regression is based on GLM (frequentist) and if method = "bayes" a sample from the posterior distribution of a logistic regression model using a random walk Metropolis algorithm is generated (see MCMClogit function).

The argument niter requires a number. For the GLM regression (method = "fq"), a non-parametric bootstrap method consists in generate B bootstrap samples, by resampling with replacement the original data. Then all statistics for each parameter can be calculated from each bootstrap sample (median and confidence intervals). For the method = "bayes", the argument 'niter' is related to the number of Metropolis iterations for the sampler.

Value

An object of class 'morphMat'.

model the summary statistics of the model.

A_boot the 'n iter' values of parameter A.

B_boot the 'n iter' values of parameter B.

L50 the 'n iter' values of parameter L50 (size at morphometric maturity).

out a dataframe with the allometric variables "X" and "Y", classification of maturity, the fitted values for logistic regression and confidence intervals (95%). Also the summary statistics of the model is provided.

Examples

data(crabdata)

classify_data = classify_mature(crabdata, varNames = c("carapace_width", "chela_height"),
varSex = "sex_category", selectSex = NULL, method = "ld")

my_mature = morph_mature(classify_data, method = "fq", niter = 50)

# 'niter' parameters:
my_mature$A_boot
my_mature$B_boot
my_mature$L50_boot
my_mature$out

ejosymart/ssmRG documentation built on Jan. 4, 2024, 9:06 p.m.