backEnhFit | R Documentation |
For a given set of covariates, fit a genearlized additive model via a backwards-selection paradigm, allowing for both selection of confounding covariates, as well as variable temporal B-splines.
backEnhFit( tmp.df, df, initialVars, possibleVars, m.i, eff.ind.inside, max.df.spline, eff.inside.dates, trap, model.info, fits, plot.file, option, bsplBegDt, bsplEndDt )
tmp.df |
The reduced data frame originating from |
df |
The data frame for a specific |
initialVars |
The set of possible variables available for model
inclusion, following application of the 90
form a subset of the |
possibleVars |
The set of all available variables for possible inclusion to the fitting of an enhanced efficiency model. Usually include efficiency-trial variables, environmental covariate variables, and CAMP-collected variables. |
m.i |
An integer containing the number of rows in data frame
|
eff.ind.inside |
A logical vector of length equal to the number of rows
of data frame |
max.df.spline |
An integer expressing the highest allowable spline degree. |
eff.inside.dates |
A |
trap |
An alphanumeric |
model.info |
A list containing information derived from an immediate
preceding call to function |
fits |
A list object of length equal to the number of
|
plot.file |
The name of the file prefix under which output is to be
saved. Set to |
option |
A graphical option for displaying spline fits. Typically (and hard-coded) set to |
bsplBegDt |
The first date, via the spline-1959-1960 paradigm, to which all efficiency years and dates collapse. |
bsplEndDt |
The last date, via the spline-1959-1960 paradigm, to which all efficiency years and dates collapse. |
Function bachEnhFit
is the workhorse function that fits the
backwards-fitting algorithm for enhanced-efficiency splines. It utilizes
tests of deviances to identify variables for possible exclusion from an
initial model containing all avalabile covariates, and smaller subets
following the removal of the most non-significant covariate identified on
the most recent preceding model fitting.
An alpha value of 0.10 is used to test for possible stopping of the
model; i.e., if all included covariates in a model have p-values less than
0.10, all covariates are retained, and the model-fitting procedure stops.
Note that the value of 0.10 is set within the function via initial
parameter pCutOff
.
Several objects, all housed within a list.
The final fit for the current TrapPositionID
of interest.
List of model information resulting from the application of backEnhFit
to each unique TrapPositionID
in df
.
List of fits resulting from the application of backEnhFit
to each unique TrapPositionID
in df
.
A record of considered variables necessary model plotting outside of the function.
Set of variables remaining for model inclusion when both CAMP waterTemp_C
and Environmental-covariate temp_C are present.
Set of variables remaining for model inclusion when both CAMP discharge_cfs
and Environmental-covariate flow_cfs
are present.
WEST Inc.
eff_model_enh
, plotbsSpline
## Not run: out <- backEnhFit(tmp.df, df, initialVars, possibleVars, m.i, eff.ind.inside, max.df.spline, eff.inside.dates, trap, model.info, fits, plot.file, option, bsplBegDt, bsplEndDt) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.