Skip to contents

Tests whether the structural interpretation of a univariate latent factor model can be rejected, without requiring estimation of reliability coefficients.

Usage

test_t1(X, z, na.rm = TRUE, max_iter = 1000L, tol = 1e-25, verbose = FALSE)

Arguments

X

numeric matrix (n x d) of indicator variables, d >= 2.

z

numeric vector or factor of length n encoding a discrete auxiliary variable. Must have at least 3 distinct levels. If z is continuous, discretise it (e.g., into quantile groups) before use.

na.rm

logical; if TRUE, rows with any NA are removed.

max_iter

integer; maximum iterations for nlm.

tol

numeric; convergence tolerance for the alternating LS initializer.

verbose

logical; if TRUE, print progress information.

Value

An object of class c("structest_t1", "structest", "htest") containing:

statistic

the T1 test statistic.

parameter

degrees of freedom, \((d-1)(p-2)\).

p.value

p-value from chi-squared distribution.

method

description of the test.

data.name

name of the data objects.

estimates

list with gamma (\(\gamma_i\)), alpha (\(\alpha_i\), with \(\alpha_1 = 1\)), and beta (\(\beta_j\), with \(\beta_1 = 0\)).

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 \(X_i = \mu_i + \lambda_i \eta + \varepsilon_i\), the conditional expectations satisfy $$E(X_i \mid Z = z_j) = \gamma_i + \alpha_i \beta_j$$ where \(\gamma_i\) are intercepts absorbing the reference-level means, \(\alpha_i\) are parameters (with \(\alpha_1 = 1\) for identification), and \(\beta_j\) are parameters (with \(\beta_1 = 0\) for the reference level).

This gives \(d \times p\) moment conditions: $$E[I(Z = z_j)(X_i - \gamma_i - \alpha_i \beta_j)] = 0$$ with \(2d + p - 2\) free parameters (\(d\) intercepts, \(d - 1\) alphas, \(p - 1\) betas), yielding \(dp - (2d + p - 2) = (d-1)(p-2)\) degrees of freedom.

The test checks whether the mean-difference matrix \(\Delta_{ij} = E(X_i \mid Z = z_j) - E(X_i \mid Z = z_1)\) has rank \(\le 1\), which is the testable implication of the structural model (Theorem 2 in the paper).

Consistent generalised methods of moments estimators (Newey & McFadden, 1994) are obtained by minimising a distance metric statistic. The procedure uses two-step estimation to obtain stable initial estimates, then minimises the criterion with the weight matrix recomputed at each parameter value. The test statistic is asymptotically \(\chi^2_{(d-1)(p-2)}\) under the null.

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_t0 for the reliability-dependent test; fit_structural for parameter estimates with standard errors.

Examples

set.seed(12345)
n <- 1000
z <- sample(0:2, n, replace = TRUE)
eta <- 1 + 0.3 * (z == 1) + 0.7 * (z == 2) + 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_t1(X, z)
result
#> 
#> 	 T1: Reliability-independent test of structural interpretation (VanderWeele & Vansteelandt, 2022) 
#> 
#> data:   X and z 
#> statistic = 0.4784, df = 2, p-value = 0.7872
#> n = 1000, d = 3 indicators, p = 3 Z-levels
#>