fmacs | R Documentation |
fmacs
returns the fMACS effect size statistics given a set of loadings
and intercepts.
fmacs(
intercepts,
loadings = NULL,
pooled_item_sd,
num_obs = NULL,
weights = 0 * intercepts + 1,
group_factor = NULL,
contrast = contr.sum(nrow(intercepts)),
latent_mean = 0,
latent_sd = 1,
item_weights = NULL
)
fmacs_ordered(
thresholds,
loadings,
thetas = 1,
num_obs = NULL,
weights = 0 * loadings + 1,
group_factor = NULL,
contrast = contr.sum(nrow(thresholds)),
link = c("probit", "logit"),
pooled_item_sd = NULL,
latent_mean = 0,
latent_sd = 1,
item_weights = NULL
)
intercepts |
A |
loadings |
A |
pooled_item_sd |
A numeric vector of length p of the pooled standard deviation (SD) of the items across groups. |
num_obs |
A vector of length |
weights |
A |
group_factor |
A vector of length |
contrast |
A |
latent_mean |
latent factor mean for the reference group. Default to 0. |
latent_sd |
latent factor SD for the reference group. Default to 1. |
item_weights |
Default is |
thresholds |
A matrix with G rows for measurement thresholds. The matrix must have column names indicating to which item index each column corresponds. |
thetas |
Not currently used. |
link |
Link function for the model (probit or logit). |
The f_\text{MACS}
effect size is defined as
f_{\text{MACS}, i} = \frac{1}{\mathit{SD}_{iP}}
\sqrt{\int [(\nu_{ij} - \bar{\nu}_j) +
(\lambda_{ij} - \bar{\lambda}_j) \eta]^2 f(\eta) d \eta}
where \lambda
is the loading and \nu
is the intercept,
and j indexes group. The effect size reflects the square root of
the ratio between the variance in observed item score due to
measurement noninvariance and the variance of the observed item scores.
f_\text{MACS}
is analogous to the Cohen's f effect size. When there
are two groups with equal sample sizes, f_\text{MACS}
=
f_\text{MACS}
/ 2
A 1 x p matrix of fMACS effect size.
lambda <- rbind(c(.7, .8, .7, .9),
c(.7, .8, .7, .8),
c(.8, .7, .7, .5))
nu <- rbind(c(0, .5, 0, 1),
c(0, .2, 0, 1.1),
c(0, .3, 0, 1.2))
fmacs(lambda,
loadings = nu,
pooled_item_sd = c(1, 1, 1, 1),
latent_mean = 0,
latent_sd = 1)
# With contrast (Group 1 & 2 vs. Group 3)
fmacs(lambda,
loadings = nu,
pooled_item_sd = c(1, 1, 1, 1),
group_factor = c(1, 1, 2),
latent_mean = 0,
latent_sd = 1)
# Thresholds
lambda <- rbind(c(.8, .5, .7, .5),
c(.8, .5, .4, .6),
c(.8, .7, .7, .5))
tau <- rbind(c(-0.5, 0, 1, -0.3, 0.1, 0.5, -0.5, 1.5),
c(-0.5, 0, 1, -0.5, 0.3, 0.5, -1, 1.5),
c(-0.5, 0, 1, -0.5, 0.3, 0.5, -1, 0.5))
# three thresholds for items 1 and 2; one threshold for items 3 and 4
colnames(tau) <- c(1, 1, 1, 2, 2, 2, 3, 4)
fmacs_ordered(tau,
loadings = lambda,
pooled_item_sd = c(1, 1, 1, 1),
latent_mean = 0,
latent_sd = 1)
# With contrast (Group 1 & 2 vs. Group 3)
fmacs_ordered(tau,
loadings = lambda,
pooled_item_sd = c(1, 1, 1, 1),
group_factor = c(1, 2, 1),
latent_mean = 0,
latent_sd = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.