aba_combine_strata | R Documentation |
Combines a list of models (obtained with aba_build_model
) into a
single object. Typically used to merge stratum-specific models into one object.
Validation statistics are computed for the combined strata, making it easier
to compare prediction performance with an unstratified model.
aba_combine_strata(model.list, plotsId = NULL)
model.list |
list. stratum-specific models returned by
|
plotsId |
vector. "plotsId" for ordering row names in the "values" element of the output list |
a list with three elements
model
: a list of regression models corresponding to each stratum
(output from lm
),
stats
: model statistics of each stratum-specific model (as in
aba_build_model
) plus one line corresponding to statistics for all
strata (COMBINED)
values
: data.frame with observed and values predicted in
cross-validation, and information on which stratum it belongs to.
aba_build_model
for calibrated ABA model,
aba_plot
for plotting model cross-validation results.
# load Quatre Montagnes dataset
data(quatre_montagnes)
# initialize list of models
model_aba_stratified <- list()
# calibrate basal area prediction model for each stratum
for (i in levels(quatre_montagnes$stratum))
{
subsample <- which(quatre_montagnes$stratum == i)
model_aba_stratified[[i]] <-
aba_build_model(quatre_montagnes[subsample, "G_m2_ha"],
quatre_montagnes[subsample, 9:76],
transform = "boxcox", nmax = 4,
xy = quatre_montagnes[subsample, c("X", "Y")]
)
}
# combine models in single object
model_aba_stratified <- aba_combine_strata(
model_aba_stratified,
quatre_montagnes$plotId
)
# display content of output list
model_aba_stratified$model
model_aba_stratified$stats
summary(model_aba_stratified$values)
# plot field values VS predictions in cross-validation
aba_plot(model_aba_stratified)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.