getN: Extract Sample Size

Description Usage Arguments Value Note See Also Examples

View source: R/getN.R

Description

Extract the sample size that was used in a model, from catch-at-age or catch-at-length data.

Usage

1
getN(model, what="CAc", series=NULL, digits=NULL)

Arguments

model

fitted scape model containing catch-at-age and/or catch-at-length data.

what

name of model element: "CAc", "CAs", "CLc", or "CLs".

series

vector of strings indicating which gears or surveys to analyze (all by default).

digits

number of decimal places to use when rounding, or NULL to suppress rounding.

Value

Numeric vector of year-specific sample sizes, or a list of such vectors when analyzing multiple series.

Note

Thin wrapper to access model$element$SS, providing a uniform interface with other get* and est* functions.

See discussion in the estN documentation.

See Also

getN, getSigmaI, getSigmaR, estN, estSigmaI, and estSigmaR extract and estimate sample sizes and sigmas.

scape-package gives an overview of the package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Exploring candidate sample sizes:

getN(x.sbw)  # sample sizes used in assessment: number of tows
estN(x.sbw)  # effective sample size, given data (tows) and model fit

## Multiple series:

getN(x.ling, "CLc")              # sample size used in assessment
getN(x.ling, "CLc", digits=0)    # rounded
estN(x.ling, "CLc")              # model fit implies larger sample sizes

getN(x.ling, "CLc", series="1", digits=0)  # get one series
estN(x.ling, "CLc", series="1")            # estimate one series

scape documentation built on May 2, 2018, 1:04 a.m.