Learn R Programming

LifeHist (version 1.0-1)

MatCount: Build Databases for Sexual Maturity Modeling by Logistic Regression

Description

From a data.frame of one continuous predictor (length, age, etc), and keys for ordinal precictor sex, month, and maturity stage, this function will builds a list of variable ready to be used in a 2- or 3-parameter logistic model

Usage

MatCount(matdat, fem.key, mal.key, stage.key, season.key)

Arguments

matdat
A data.frame where each row is an individual fish, and the columns are a continuous predictor, and ordinal keys for sex, month, and maturity stage
fem.key
Integer, the ordinal key identifying females
mal.key
Integer, the ordinal key identifying males
stage.key
Integer, the ordinal key identifying the last maturity stage of juveniles. This key will split the individual into immature (all having stage
season.key
Integer vector with two components, the first and last month of the reproductive season

Value

mal.nrep
A data.frame with the continuous predictor duplicated and sorted, a binary for mature individuals, a binary for juveniles, and the count of males in the non reproductive season
mal.rep
A data.frame with the continuous predictor duplicated and sorted, a binary for mature individuals, a binary for juveniles, and the count of males in the reproductive season
fem.nrep
A data.frame with the continuous predictor duplicated and sorted, a binary for mature individuals, a binary for juveniles, and the count of females in the non reproductive season
fem.rep
A data.frame with the continuous predictor duplicated and sorted, a binary for mature individuals, a binary for juveniles, and the count of females in the reproductive season

Details

The year is divided into two seasons, the reproductive season and the non-reproductive season

References

R. Roa, B. Ernst, F. Tapia. 1999. Estimation of size at sexual maturity: evaluation of analytical and resampling procedures. Fishery Bulletin (US) 97:570-580.

Examples

Run this code
data(BlackAngler.lenmatdat)
MatCount(matdat=BlackAngler.lenmatdat, fem.key=2, mal.key=1, stage.key=2,
         season.key=c(5,7))

Run the code above in your browser using DataLab