Fork me on GitHub

linear-mixed-effects: Linear mixed effects modelingΒΆ

Citations

[longitudinal:linear-mixed-effects:SP10]Skipper Seabold and Josef Perktold. Statsmodels: econometric and statistical modeling with python. In Proceedings of the 9th Python in Science Conference, volume 57, 61. SciPy society Austin, 2010.

Docstring:

Usage: qiime longitudinal linear-mixed-effects [OPTIONS]

  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.

Options:
  --m-metadata-file MULTIPLE FILE
                                  Metadata file or artifact viewable as
                                  metadata. This option may be supplied
                                  multiple times to merge metadata. Sample
                                  metadata file containing
                                  individual_id_column.  [required]
  --p-state-column TEXT           Metadata column containing state (time)
                                  variable information.  [required]
  --p-individual-id-column TEXT   Metadata column containing IDs for
                                  individual subjects.  [required]
  --p-metric TEXT                 Dependent variable column name. Must be a
                                  column name located in the metadata or
                                  feature table files.  [optional]
  --p-group-columns TEXT          Comma-separated list (without spaces) of
                                  metadata columns to use as independent
                                  covariates used to determine mean structure
                                  of "metric".  [optional]
  --p-random-effects TEXT         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.  [optional]
  --i-table ARTIFACT PATH FeatureTable[RelativeFrequency]
                                  Feature table containing metric.  [optional]
  --p-palette [Pastel1|Set3|Set1|tab20|Pastel2|magma|rainbow|Paired|inferno|Accent|tab10|plasma|Dark2|Set2|tab20b|tab20c|terrain|viridis]
                                  Color palette to use for generating
                                  boxplots.  [default: Set1]
  --p-lowess / --p-no-lowess      Estimate locally weighted scatterplot
                                  smoothing. Note that this will eliminate
                                  confidence interval plotting.  [default:
                                  False]
  --p-ci FLOAT                    Size of the confidence interval for the
                                  regression estimate.  [default: 95]
  --p-formula TEXT                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.readthe
                                  docs.io/en/latest/formulas.html for full
                                  documentation of valid formula operators. On
                                  command line, remember to enclose in quotes
                                  if the formula contains spaces.  [optional]
  --o-visualization VISUALIZATION PATH
                                  [required if not passing --output-dir]
  --output-dir DIRECTORY          Output unspecified results to a directory
  --cmd-config FILE               Use config file for command options
  --verbose                       Display verbose output to stdout and/or
                                  stderr during execution of this action.
                                  [default: False]
  --quiet                         Silence output if execution is successful
                                  (silence is golden).  [default: False]
  --citations                     Show citations and exit.
  --help                          Show this message and exit.

Import:

from qiime2.plugins.longitudinal.visualizers import linear_mixed_effects

Docstring:

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({'Accent', 'Dark2', 'Paired', 'Pastel1', 'Pastel2', 'Set1', 'Set2', 'Set3', 'inferno', 'magma', 'plasma', 'rainbow', 'tab10', 'tab20', 'tab20b', 'tab20c', 'terrain', 'viridis'}), 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. On command line, remember to
    enclose in quotes if the formula contains spaces.

Returns
-------
visualization : Visualization