One-sample test for mean structure under antedependence
Source:R/lrt_mean_gau.R
test_one_sample_gau.RdTests the null hypothesis that the mean vector equals a specified value mu = mu_0 against the alternative mu != mu_0, under an AD(p) covariance structure. This implements Theorem 7.1 of Zimmerman & Núñez-Antón (2009).
Arguments
- y
Numeric matrix with n_subjects rows and n_time columns.
- mu0
Hypothesized mean vector under the null (length n_time).
- p
Antedependence order of the covariance structure. This is the same order parameter named
orderinfit_gau.- order
Optional alias for
p. Supply only one ofpororder.- use_modified
Logical. If TRUE (default), use the modified test statistic (formula 7.7) for better small-sample approximation.
Value
A list with class gau_mean_test containing:
- method
Inference method used (
"lrt").- test_type
"one-sample"
- mu0
Hypothesized mean under null
- mu_hat
MLE of mean (sample mean)
- statistic
Test statistic value
- statistic_modified
Modified test statistic (if use_modified = TRUE)
- df
Degrees of freedom (n_time)
- p_value
P-value from chi-square distribution
- p_value_modified
P-value from modified test
- order
Antedependence order used
Details
The test exploits the AD structure to gain power over tests that don't assume any covariance structure. The likelihood ratio test statistic (Theorem 7.1) is: $$N \sum_{i=1}^{n} [\log RSS_i(\mu_0) - \log RSS_i(\hat{\mu})]$$
where RSS_i(mu) is the residual sum of squares from the regression of Y_i - mu_i on its p predecessors Y_(i-1) - mu_(i-1), ..., Y_(i-p) - mu_(i-p).
The test has n degrees of freedom (one for each component of mu).
References
Zimmerman, D.L. and Núñez-Antón, V. (2009). Antedependence Models for Longitudinal Data. Chapman & Hall/CRC. Chapter 7.
Examples
if (FALSE) { # \dontrun{
# Simulate data with known mean
mu_true <- c(10, 11, 12, 13, 14, 15)
y <- simulate_gau(n_subjects = 50, n_time = 6, order = 1, mu = mu_true)
# Test if mean is zero
test <- test_one_sample_gau(y, mu0 = rep(0, 6), p = 1)
print(test)
# Test if mean equals true value (should not reject)
test2 <- test_one_sample_gau(y, mu0 = mu_true, p = 1)
print(test2)
} # }