modelselect {MorphoRegions} | R Documentation |
Select the best models
Description
modelselect()
narrows down the search for the best model by identifying the best model for each number of regions as determined by its residual sums of squares (RSS).
Usage
modelselect(results, scores = NULL)
Arguments
results |
a |
scores |
|
Value
A regions_modelselect
object, which contains information about the best models for each number of regions extracted from results
.
See Also
modelsupport()
for computing statistics that describe the support of each model using information criteria; modelperf()
for computing fit statistics for selected models.
Examples
data("alligator")
alligator_data <- process_measurements(alligator,
pos = "Vertebra")
# Compute PCOs
alligator_PCO <- svdPCO(alligator_data)
# Fit segmented regression models for 1 to 7 regions
# using PCOs 1 to 4 and a continuous model with a
# non-exhaustive search
regionresults <- calcregions(alligator_PCO,
scores = 1:4,
noregions = 7,
minvert = 3,
cont = TRUE,
exhaus = FALSE,
verbose = FALSE)
regionresults
# For each number of regions, identify best
# model based on minimizing RSS
bestresults <- modelselect(regionresults)
bestresults
# Evaluate support for each model and rank models
supp <- modelsupport(bestresults)
supp
# 5 regions best based on AICc; 6 regions based on BIC