Description Usage Arguments Value Note See Also
View source: R/fcs2ModelSelection.R
Automatically selects an optimal set of covariate terms for the abundance and prevalence regression equations of the FCS2 model. Terms are attempted sequentially and the approximate abundance and prevalence INLA fits are used to test the significance of each term.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | fcs2ModelSelection(
runTotalVars = NULL,
allRunsTotalVar = NULL,
allRunsRangeVars = NULL,
dataFrame,
surveyAreaVar = "SurveyArea",
nRunsVar = NULL,
muVars,
muVarType,
rhoVars = muVars,
rhoVarType = muVarType,
rhoFormula,
subset = 1:nrow(dataFrame),
tolerance = 0.01,
maxNoOrders = 3,
nSweeps = 1,
prior.parameters = list(),
estAllRunsTotalVar = NULL,
verbose = FALSE
)
|
runTotalVars |
a character vector of columns in |
allRunsTotalVar |
the name of a column in |
allRunsRangeVars |
the names of two columns in |
dataFrame |
a data frame with surveys as rows and variables as columns. It should contain all variables specified by other arguments. |
surveyAreaVar |
the name of a column in |
nRunsVar |
the name of a column in |
muVars |
a character vector naming variables to use for terms in the abundance regression equation. Variables are attempted one-by-one in the order given. |
muVarType |
a character vector of the same length as |
rhoVars |
a character vector naming variables to use for terms in the
prevalence regression equation. Variables are attempted one-by-one in the
order given. Defaults to |
rhoVarType |
a character vector of the same length as |
rhoFormula |
an optional |
subset |
an optional vector specifying a subset of surveys to be used in the fitting process. |
tolerance |
the threshold for each term's significance probability,
below which a term is considered to be significant and is retained. The
default value is |
maxNoOrders |
the maximum number of polynomial orders to try for each linear component. Defaults to 3. |
nSweeps |
the number of sweeps to make through each list of potential
variables. The default is |
prior.parameters |
an optional named list of named vectors giving the
parameter values to use for the prior distribution of a variable. See
|
estAllRunsTotalVar |
the name of a column in |
verbose |
whether to print progress to screen. |
a list of two matricies, each containing a summary of the terms attempted in each iteration. The first matrix gives the term history for the prevalence (rho) and the second gives the history for the abundance (mu).
Each row of a matrix summarises the regression formula used for that
component, with covariates appearing as columns. Linear terms are
represented as a number giving the order of the term, random walk terms are
given by "rw2"
and spatial terms by "spatial"
.
fcs2:::termSummary2Formula
can be used to convert a row to an formula
for simplier input into fcs2FitModel
.
Since the prevalence terms are selected first and then the abundance terms second, it is possible that some prevalence terms are no longer significant in the final fit as these were not attempted with the selected abundance formula.
fcs2FitModel
, fcs2:::termSummary2Formula
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.