store | R Documentation |
This function performs regression of an ordinal response on an ordinal predictor with intensive longitudinal data. The methodology allows for separating state effects from trait effects.
store( formula, data, id, penalize = TRUE, method = "mgcv", model = "TS", covt = NULL, save.data = TRUE, ... )
formula |
An expression of the form |
data |
Data frame containing the variables in the model. |
id |
Variable name for the subjects of the |
penalize |
A logical variable: if TRUE (the default), a non-linearity penalty is applied. |
method |
Package implementing ordinal mixed-effect regression: either " |
model |
The model to fit: "TS" for trait-state model with random effects (the default), "trait" for trait-only model with random effects, "RE" for model with random effects only. |
covt |
The covariates of the model; default is NULL. |
save.data |
A logical variable: if TRUE (the default) store the |
... |
Other arguments, passed to |
A fitted model object with response and predictor ordinal variables extracted from formula
.
This is a gam
object with some additional components, including fixed.edf
, the
effective degrees of freedom of the fixed-effect terms, and R2
, the coefficient of determination. These last two are discussed in
Osei and Reiss (2022)..
When model
is "TS"
or "trait"
, the model matrix is called tsmat
.
Coefficient tsmatmed1
, for example, is the "trait effect" associated with median predictor value 1.
Coefficient tsmat1.2
is the "state effect" of current predictor value 2 for an individual whose median is 1.
Prince P. Osei and Philip T. Reiss
Osei, P. P. and Reiss, P. T. (2022). Ordinal state-trait regression for intensive longitudinal data. Under revision.
lagged.response.model
, which shows how to add the previous response value as a predictor.
## Not run: mod <- store(pleasant.~stressed., data=thoughts, id="Subject") # takes several minutes summary(mod) plot(mod) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.