calcmodel {MorphoRegions} | R Documentation |
Calculate results of a single segmented regression model
Description
calcmodel()
fits a multivariate segmented regression model using the supplied PCOs and breakpoints.
Usage
calcmodel(x, scores, bps, cont = TRUE)
Arguments
x |
a |
scores |
|
bps |
|
cont |
|
Value
A regions_results_single
object, which contains the results of the model (breakpoints and RSS of each PCO and overall) and model support statistics.
See Also
calcregions()
and addregions()
for computing all possible models instead of just a single one; plotsegreg()
, for which the plot
method is an alias, for plotting the fitted regression lines; modelsupport()
for interpreting the model support statistics.
Examples
data("alligator")
alligator_data <- process_measurements(alligator,
pos = "Vertebra")
# Compute PCOs
alligator_PCO <- svdPCO(alligator_data)
# Calculate a single segmented regression model
# using first 2 PCOs and a discontinuous model
regionsmodel <- calcmodel(alligator_PCO,
scores = 1:3,
bps = c(8, 16, 21),
cont = FALSE)
regionsmodel
#Evaluate performance (R2) on that model
modelperf(regionsmodel)
#Plot model results:
plotsegreg(regionsmodel, scores = 1:3)