Description Usage Arguments Value Examples
Compute CPA level and pattern scores for a set of data
1 2 3 4 5 6 7 8 9 |
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 |
A data frame containing the CPA score variables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.