Description Usage Arguments Value Examples
Function to extract time-varying weights from lWQS object
1 | extract_weights(lobj)
|
lobj |
An object returned from lWQS function |
A (long-form) data frame containing the time index and corresponding variable weights estimated in an lWQS
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
model=lwqs(data=lwqs_data,
timevar="time",
wqs_parms=list(formula=out ~ wqs,
data = lwqs_data,
mix_name=mixvars,
b1_constr = TRUE,
b1_pos=TRUE,
b = 5,
q = 5,
validation = 0,
family = "gaussian",
seed = 1),
outcome="out",
ID="ID")
# use extract_weights to access time-varying predictor weights
timeweights=extract_weights(model)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.