Description Usage Arguments Details Value Author(s) See Also Examples
Function compares model fits for growth and survival objects built with different linear combinations of covariates (plotting currently restricted to transforms of size; but comparison can include any chosen covariates). Growth can have multiple response forms. Returns a list containing a summary table of covariates and scores, and another list containing all of the growth (or survival) objects used in the comparison.
1 2 3 4 5 6 7 8 9 10 | growthModelComp(dataf,
expVars = c(sizeNext~1, sizeNext~size, sizeNext~size + size2),
regressionType = "constantVar", testType = "AIC",
makePlot = FALSE, mainTitle = "", plotLegend = TRUE,
legendPos = "topright",...)
survModelComp(dataf, expVars = c(surv~1, surv~size, surv~size + size2),
testType = "AIC",
makePlot = FALSE, mainTitle = "",ncuts=20, plotLegend = TRUE,
legendPos = "bottomleft", ...)
|
dataf |
dataframe with columns size, surv, and the growth response variable of choice |
expVars |
list of Formulas. Defaults to |
regressionType |
character string identifying whether the type of regression run will have constant or changing variance (for |
testType |
character string identifying the metric used to compare models. Can be any string that uses |
makePlot |
logical whether to make plots with the comparison building. Defaults to |
mainTitle |
string to place as the |
ncuts |
for survModelComp, number of cuts in the data-set to be used in plotting |
plotLegend |
logical whether to plot a legend. Defaults to |
legendPos |
places legend. Defaults to "topright". |
... |
additional arguments for plotting (ylim, col, etc) |
Both growthModelComp
and survModelComp
use a dataframe that has variables size
and sizeNext
to build a series of nested models. The default will build growth or survival objects with an intercept, an intercept and size, an an intercept with size and size^2 terms.
The models build use only lm
or glm
(and not mcmcGLMM
for example) to estimate maximum likelihood estimates of functions. The testType (default "AIC"
uses the loglike
output from the lm or glm objects to score the model.
Plotting calls the functions plotGrowthModelComp
or plotSurvModelComp
to plot the objects. These functions can also be called after building the model comparison lists that are returned. If called outside of the initial building functions, they need to receive the GrowthObjects
or SurvObjects
list in the outputList from the build function. See plotGrowthModelComp
and plotSurvModelComp
for more details.
a list with a summary table of class dataframe
with models and scores and list of containing the objects of class grObj and survObj for each model.
C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.
makeGrowthObj
,makeSurvObj
,plotGrowthModelComp
, plotSurvModelComp
1 2 3 4 5 6 7 | # Data with size and sizeNext
dff <- generateData()
growthModelComp(dff, makePlot = TRUE)
survModelComp(dff, makePlot = TRUE)
growthModelComp(dff, makePlot = TRUE, regressionType = "changingVar")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.