cpa_scores {configural} | R Documentation |
Compute CPA level and pattern scores for a set of data
Description
Compute CPA level and pattern scores for a set of data
Usage
cpa_scores(
cpa_mod,
newdata = NULL,
augment = TRUE,
cpa_names = c("cpa_lev", "cpa_pat"),
scale = FALSE,
scale_center = TRUE,
scale_scale = TRUE
)
Arguments
cpa_mod |
A model returned from |
newdata |
A data frame or matrix containing columns with the same names as
the predictors in |
augment |
Should be CPA score columns be added to |
cpa_names |
Character vector of length 2 giving the variable names to assign to the CPA score columns. |
scale |
Logical. Should the variables in |
scale_center |
If |
scale_scale |
If |
Value
A data frame containing the CPA score variables.
Examples
sevar <- cor_covariance_meta(mindfulness$r, mindfulness$n, mindfulness$sevar_r, mindfulness$source)
cpa_mod <- cpa_mat(mindfulness ~ ES + A + C + Ex + O,
cov_mat = mindfulness$r,
n = NULL,
se_var_mat = sevar,
adjust = "pop")
newdata <- data.frame(ES = c(4.2, 3.2, 3.4, 4.2, 3.8, 4.0, 5.6, 2.8, 3.4, 2.8),
A = c(4.0, 4.2, 3.8, 4.6, 4.0, 4.6, 4.6, 2.6, 3.6, 5.4),
C = c(2.8, 4.0, 4.0, 3.0, 4.4, 5.6, 4.4, 3.4, 4.0, 5.6),
Ex = c(3.8, 5.0, 4.2, 3.6, 4.8, 5.6, 4.2, 2.4, 3.4, 4.8),
O = c(3.0, 4.0, 4.8, 3.2, 3.6, 5.0, 5.4, 4.2, 5.0, 5.2)
)
newdata_cpa <- cpa_scores(cpa_mod, newdata, augment = FALSE)
newdata_augment <- cpa_scores(cpa_mod, newdata, augment = TRUE)