# An observed correlation of .30 between measures with reliabilities .80
# and .70 corresponds to a construct-level correlation of about .40.
correction_for_attenuation(r = 0.30, reliability_x = 0.80, reliability_y = 0.70)
# With the sample size, the corrected interval comes along.
correction_for_attenuation(r = 0.30, reliability_x = 0.80, reliability_y = 0.70,
N = 120)
# Correct one side only (error-free criterion).
correction_for_attenuation(r = 0.30, reliability_x = 0.80, reliability_y = 1)
# The two routes to the construct-level correlation, on the same data
# (requires lavaan). Two congeneric scales of three items each whose
# latent variables correlate .50:
set.seed(113)
n <- 400
fx <- rnorm(n); fy <- 0.5 * fx + sqrt(1 - 0.25) * rnorm(n)
lam <- c(.8, .7, .6)
items <- data.frame(
x1 = lam[1] * fx + rnorm(n, 0, sqrt(1 - lam[1]^2)),
x2 = lam[2] * fx + rnorm(n, 0, sqrt(1 - lam[2]^2)),
x3 = lam[3] * fx + rnorm(n, 0, sqrt(1 - lam[3]^2)),
y1 = lam[1] * fy + rnorm(n, 0, sqrt(1 - lam[1]^2)),
y2 = lam[2] * fy + rnorm(n, 0, sqrt(1 - lam[2]^2)),
y3 = lam[3] * fy + rnorm(n, 0, sqrt(1 - lam[3]^2)))
# Route 1, summary statistics: omega reliabilities into the formula.
x_score <- rowMeans(items[, 1:3]); y_score <- rowMeans(items[, 4:6])
om_x <- reliability_omega(data = items[, 1:3])$value[1]
om_y <- reliability_omega(data = items[, 4:6])$value[1]
correction_for_attenuation(r = cor(x_score, y_score),
reliability_x = om_x, reliability_y = om_y,
N = n)
# Route 2, the factor model: the latent correlation estimated directly.
fit <- lavaan::cfa("X =~ x1 + x2 + x3\nY =~ y1 + y2 + y3",
data = items, std.lv = TRUE)
lavaan::parameterEstimates(fit)[
lavaan::parameterEstimates(fit)$op == "~~" &
lavaan::parameterEstimates(fit)$lhs == "X" &
lavaan::parameterEstimates(fit)$rhs == "Y", ]
Run the code above in your browser using DataLab