
T0 Test: Reliability-Dependent Test of Structural Interpretation (Section 3.2)
Source:R/test_t0.R
test_t0.RdTests whether the structural interpretation of a univariate latent factor model can be rejected, using estimated reliability coefficients. The variance of the estimating equations is adjusted for uncertainty in the reliability estimates (see paper, p. 2041).
Arguments
- X
numeric matrix (n x d) of indicator variables, d >= 3.
- z
numeric vector or factor of length n encoding a discrete auxiliary variable. Must have at least 2 distinct levels. If
zis continuous, discretise it (e.g., into quantile groups) before use.- na.rm
logical; if
TRUE, rows with anyNAare removed.- max_iter
integer; maximum iterations for
nlm.- verbose
logical; if
TRUE, print progress information.
Value
An object of class c("structest_t0", "structest", "htest")
containing:
- statistic
the T0 test statistic.
- parameter
degrees of freedom, \((d-1)(p-1)\).
- p.value
p-value from chi-squared distribution.
- method
description of the test.
- data.name
name of the data objects.
- estimates
list with
gamma(intercepts),beta(Z effects), andlambda(reliabilities).- n_obs
number of observations used.
- d
number of indicators.
- p
number of Z-levels.
- convergence
convergence code from
nlm.- optim_details
full output from
nlm.
Details
Under the structural model, \(E[X_i | Z = z_j] = \gamma_i + (\lambda_i / \lambda_1) \beta_j\). This gives \(d \times p\) moment conditions with \(d + p - 1\) free parameters (\(\gamma_1, \ldots, \gamma_d\) and \(\beta_2, \ldots, \beta_p\) with \(\beta_1 = 0\)), yielding \((d-1)(p-1)\) degrees of freedom.
The variance of the estimating equations is adjusted for the uncertainty in the reliability estimates \(\lambda_i\) (see paper, p. 2041). Consistent generalised methods of moments estimators (Newey & McFadden, 1994) are obtained by minimising the resulting distance metric statistic.
References
VanderWeele, T. J., & Vansteelandt, S. (2022). A statistical test to reject the structural interpretation of a latent factor model. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 84(5), 2032–2054. doi:10.1111/rssb.12555
See also
test_t1 for the reliability-independent test;
fit_structural for parameter estimates with standard errors;
estimate_reliability for the reliability estimation step.
Examples
set.seed(12345)
n <- 1000
z <- rbinom(n, 1, 0.5)
eta <- 1 + 0.5 * z + rnorm(n)
lambda <- c(1.0, 0.8, 0.6)
X <- cbind(
2 + lambda[1] * eta + rnorm(n, sd = 0.5),
3 + lambda[2] * eta + rnorm(n, sd = 0.5),
1 + lambda[3] * eta + rnorm(n, sd = 0.5)
)
result <- test_t0(X, z)
result
#>
#> T0: Reliability-dependent test of structural interpretation (VanderWeele & Vansteelandt, 2022)
#>
#> data: X and z
#> statistic = 6.452, df = 2, p-value = 0.03971
#> n = 1000, d = 3 indicators, p = 2 Z-levels
#>