extract_mixture: Function to extract time-varying mixture (wqs) index from...

Description Usage Arguments Value Examples

View source: R/lwqs.R

Description

Function to extract time-varying mixture (wqs) index from lWQS object

Usage

1

Arguments

lobj

An object returned from lWQS function

Value

Data frame containing the time index, wqs index estimated at each repeated measure, subject ID, and the outcome variable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# identify predictor variables used in mixture
mixvars=names(lwqs_data)[5:9]

# run model. Note for example run-time only 1 bootstrap (b=1) is used. Set b to be >50
model=lwqs(data=lwqs_data,
           timevar="time",
           wqs_parms=list(formula=out ~ wqs,
              data = lwqs_data,
              mix_name=mixvars,
              b1_constr = TRUE,
              b1_pos=FALSE,
              b = 5,
              q = 5,
              validation = 0,
              family = "gaussian",
              seed = 1),
              outcome="out",
              ID="ID")

# use extract_mixture to access time-varying wqs index
mixtime=extract_mixture(model)

lwqs documentation built on March 4, 2021, 5:07 p.m.