Build a measurement-error covariance targeting a given reliability
Source:R/dgp.R
sigma_u_for_reliability.RdReturns a Sigma_u (via build_sigma_u()) whose surrogate-measurement
error variances are scaled so the mean per-surrogate reliability equals
reliability. Surrogate reliability is the intraclass-style ratio
var_x / (var_x + var_U_j); the relative surrogate qualities in ratios
are preserved (so the surrogates stay unequal for the per-surrogate ladder),
and a single multiplicative scale is solved by stats::uniroot() to hit the
target average. Use it to sweep measurement quality in a simulation, e.g.
reliability in c(0.5, 0.65, 0.8).
Usage
sigma_u_for_reliability(reliability, var_x, ratios = c(2, 2.5, 3), rho = 0.4)Arguments
- reliability
Target mean per-surrogate reliability in
(0, 1).- var_x
Variance of the latent exposure
X(e.g.x_sd^2passed togenerate_aft_data()).- ratios
Relative marginal error variances across the surrogates; their scale is solved for, only their ratios matter. Default
c(2.0, 2.5, 3.0)matchesbuild_sigma_u().- rho
Common pairwise error correlation, passed to
build_sigma_u().
Value
A J x J covariance matrix suitable for the Sigma_u argument of
generate_aft_data().