Description Usage Arguments Details Value
Format Data for MSOM
1 2 3 4 |
Data |
A data.table containing response variable and covariates. Must have a |
n0 |
An integer indicating the number of never-observed species to add |
formula |
A formula indicating the dimensions of the output array (only Default tested) |
cov.vars |
A named character vector of covariates, where character elements correspond to columns |
u.form |
Formula for covariates to be included in U, the matrix of presence covariates |
v.form |
Formula for covariates to be included in V, the matrix of detection covariates |
valueName |
Character indicating column name containing response in |
cov.by |
Chracter vector of dimension names for covariates; order matters, specify most specific last. Should be elements in |
u_rv, v_rv |
Character string indicating variable names in |
Only the defaults have been tested. Arguments that should be manipulated include u.form
, v.form
, cov.vars
, and n0
. Other values can be changed if they are only being adjusted to conform with column names in Data
. Otherwise, it is unlikely that this function will behave as desired. In particular, the nesting of year, stratum, and K has to be the same (or whatever names are used).
Casting of Data
is done via trawlCast
. 0's are filled where appropriate, and NA's indicate no sampling. In the output, all NA's are replaced with 0's. However, the nK
element of the output list indicates how many of the K are actually samples, and because K is not ordered, any 0's beyond the magnitude indicated in nK for that year-stratum combination are actually the NA's.
With regard to u_rv
and v_rv
, the intercept term cannot be converted to a random variable representation, although categorical predictors can (note, though, that the reference level will be embedded in the intercept, and thus it is implied to be known excactly). Terms represented in the formula with special notation (a:b, a*b, etc) will not be converted, although if a formula is u.form=~a*b
, and u_rv=c("a")
, a column that would be named "a" in the model matrix will be encoded as a random variable, whereas colmns "a:b" and "b" will not be RV's.
A named list appropriate for use with msomStatic.stan
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.