partialDependence_growth: Compute partial dependence for latent growth models

View source: R/partialDependence.R

partialDependence_growthR Documentation

Compute partial dependence for latent growth models

Description

Compute the partial dependence of a predictor, or set of predictors, on the predicted trajectory of a latent growth model.

Usage

partialDependence_growth(
  x,
  data,
  reference.var,
  support = 20,
  points = NULL,
  mc = NULL,
  FUN = "median",
  times = NULL,
  parameters = NULL,
  ...
)

Arguments

x

An object for which a method exists

data

Optional data.frame that was used to train the model.

reference.var

Character vector, referring to the (independent) reference variable or variables for which partial dependence is calculated. Providing two (or more) variables allows for probing interactions, but note that this is computationally expensive.

support

Integer. Number of grid points for interpolating the reference.var. Alternatively, use points for one or more variables named in reference.var.

points

Named list, with elements corresponding to reference.var . Use this argument to provide specific points for which to obtain marginal dependence values; for example, the mean and +/- 1SD of reference.var.

mc

Integer. If mc is not NULL, the function will sample mc number of rows from data with replacement, to estimate marginal dependency using Monte Carlo integration. This is less computationally expensive.

FUN

Character string with function used to integrate predictions across all elements of x.

times

Numeric matrix, representing the factor loadings of a latent growth model, with columns equal to the number of growth parameters, and rows equal to the number of measurement occasions.

parameters

Character vector of the names of the growth parameters; defaults to NULL, which assumes that the growth parameters are the only parameters and are in the correct order.

...

Extra arguments passed to FUN.

Author(s)

Caspar J. Van Lissa


semtree documentation built on Nov. 26, 2023, 5:07 p.m.