Tests the null hypothesis that the LPTE is constant over time. The test is based on the difference between the conditional and marginal treatment-effect trajectories implied by a fitted "fitted_onlinesurr" object, standardized by an estimated covariance, and uses a max-type statistic to control the family wise error across time points.
Arguments
- model
A fitted object of class
"fitted_onlinesurr", typically returned byfit.surr. Must contain$T,$n.fixed, and the elements$Marginaland$Conditionalwithpointandsmpcomponents.- signif.level
Numeric in (0,1) giving the test significance level used to form the critical value from the bootstrap distribution. Default is
0.05.- N.boots
Integer number of Monte Carlo draws used to approximate the null distribution of the max standardized deviation statistic and to compute the p-value. Default is
50000.
Value
A named list with:
T: the observed test statistic (maximum absolute standardized deviation).T.crit: the 1-signif.level critical value.p.value: the Monte Carlo p-valuemean(T_null > T_obs).
Details
See (dos Santos Jr. and Parast 2026) for the theoretical details about this test.
Notes:
The function assumes the first
Ttime-specific treatment-effect parameters are stored contiguously at the beginning ofmodel$Marginal$pointandmodel$Conditional$point(and similarly forsmp). It uses the index1:(n.fixed)as implemented in the code:1:(T + n.fixed - T).N.bootshere is a Monte Carlo size for the null simulation (distinct from the bootstrap size used when fittingmodel).
Examples
if (FALSE) { # \dontrun{
fit <- fit.surr(y ~ 1,
id = id, surrogate = ~ s1 + s2, treat = trt,
data = dat, time = time, N.boots = 2000
)
time_homo_test(fit, signif.level = 0.05, N.boots = 50000)
} # }