Linear mixed effects modeling
Linear mixed effects models evaluate the contribution of exogenous
covariates "group_columns" and "random_effects" to a single dependent
variable, "metric". Perform LME and plot line plots of each group column. A
feature table artifact is required input, though whether "metric" is
derived from the feature table or metadata is optional.
Parameters
- metadata : Metadata
- Sample metadata file containing individual_id_column.
- state_column : Str
- Metadata column containing state (time) variable information.
- individual_id_column : Str
- Metadata column containing IDs for individual subjects.
- metric : Str, optional
- Dependent variable column name. Must be a column name located in the
metadata or feature table files.
- group_columns : Str, optional
- Comma-separated list (without spaces) of metadata columns to use as
independent covariates used to determine mean structure of "metric".
- random_effects : Str, optional
- Comma-separated list (without spaces) of metadata columns to use as
independent covariates used to determine the variance and covariance
structure (random effects) of "metric". To add a random slope, the same
value passed to "state_column" should be passed here. A random
intercept for each individual is set by default and does not need to be
passed here.
- table : FeatureTable[RelativeFrequency], optional
- Feature table containing metric.
- palette : Str % Choices('Set1', 'Set2', 'Set3', 'Pastel1', 'Pastel2', 'Paired', 'Accent', 'Dark2', 'tab10', 'tab20', 'tab20b', 'tab20c', 'viridis', 'plasma', 'inferno', 'magma', 'terrain', 'rainbow'), optional
- Color palette to use for generating boxplots.
- lowess : Bool, optional
- Estimate locally weighted scatterplot smoothing. Note that this will
eliminate confidence interval plotting.
- ci : Float % Range(0, 100), optional
- Size of the confidence interval for the regression estimate.
- formula : Str, optional
- R-style formula to use for model specification. A formula must be used
if the "metric" parameter is None. Note that the metric and group
columns specified in the formula will override metric and group columns
that are passed separately as parameters to this method. Formulae will
be in the format "a ~ b + c", where "a" is the metric (dependent
variable) and "b" and "c" are independent covariates. Use "+" to add a
variable; "+ a:b" to add an interaction between variables a and b; "*"
to include a variable and all interactions; and "-" to subtract a
particular term (e.g., an interaction term). See
https://patsy.readthedocs.io/en/latest/formulas.html for full
documentation of valid formula operators. Always enclose formulae in
quotes to avoid unpleasant surprises.
Returns
visualization : Visualization