isolate | R Documentation |
Creates variables that represent pure within- and between-person predictors.
isolate(d = NULL, by = NULL, value = NULL, z = FALSE, which = "within")
d |
A |
by |
A vector of values in |
value |
Names of columns in |
z |
Should the created values be standardized (defaults to FALSE). |
which |
Which component to return. "within" (default) returns within-person deviations only; "between" returns between-person means only; "both" returns both. |
A data.frame
with additional columns for the within- and
between-person variables. The new columns are labelled _cw for
centered-within and _cb for centered-between.
Matti Vuorre mv2521@columbia.edu
# Create within-person deviations of work stressors in BLch9.
data(BLch9)
BLch9 <- isolate(BLch9, by = "id", value = "fwkstrs")
head(BLch9) # Now has new column for within-person work stressors.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.