ran_can: Random Effects Candidates for Latent Class Mixed Effects...

Description Usage Arguments Value

View source: R/ran_can.R

Description

This function applies lcmem across a vector of random effects candidates and also allows the option to parallelize with the futures package

Usage

1
ran_can(df, fixed, mixture, random_vect, subject, k = 5)

Arguments

df

data frame object with data for models

fixed

a string that represents a two-side linear formual object for the fixed effects in a linear mixed model. By default, an intercept is included. If no intercept, -1 should be the first term included on the right of ~.

mixture

a string that represents one-sided formula object for the class-specific fixed effects in the linear mixed model (to specify only for a number of latent classes greater than 1). Among the list of covariates included in fixed, the covariates with class-specific regression parameters are entered in mixture separated by +. By default, an intercept is included. If no intercept, -1 should be the first term included.

random_vect

a character vector where each element represents an optional one-sided formula for the random-effects in the linear mixed model. Covariates with a random-effect are separated by +. By default, an intercept is included. If no intercept, -1 should be the first term included.

subject

name of the covariate representing the grouping structure specified with ”.

k

number of classes

Value

a list that has lcmem output corresponding with the random_vect provided.


wfmueller29/trajpkg documentation built on Feb. 6, 2022, 3:45 a.m.