mm_BuildModel: Build, implement, visualize multivariate linear model.

View source: R/explore.R

mm_BuildModelR Documentation

Build, implement, visualize multivariate linear model.

Description

Easily evaluate simple model sets (one covariate with up to 2 additional classifiers/covariates). Helpful for exploratory analysis. For detailed models or specific combinations of variables, see geomorph::procD.lm for full use of this function.

Usage

mm_BuildModel(shape_data, ..., subgrps = NULL, ff1 = NULL, univ_series = FALSE)

Arguments

shape_data

This will be the (multivariate) response variable

...

Covariate(s)/classifier(s) to build a model set. Individual models are run with interaction effects.

subgrps

Optional. Vector of group membership. Model sets will be run across the whole sample and subgroups. If k is specified, only the full model will be run.

ff1

An explicit model to test in the format: " coords ~ ...". Names must match those specifed in .... Standard lm notation applies.

univ_series

Default (FALSE) will evaluate multiple covariates and their interaction in a single model. However, it can be helpful to understand the univariate effects in isolation of interaction/confounding factors. Set univ_series=TRUE to produce a series of model sets, one for each covariate specified (NOTE: ff1 must also be NULL for this to work).

Value

A list containing output of one or more multivariate linear models that can be inspected on their own or interacted with using mm_VizModel or mm_CompModel.


ehrlichd/moRphomenses documentation built on Dec. 13, 2024, 8:36 a.m.