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).
References
Silvaneo V. dos Santos Jr., Layla Parast (2026). “A Causal Framework for Evaluating Jointly Longitudinal Outcomes and Surrogate Markers: A State-Space Approach.” 2604.12882, https://arxiv.org/abs/2604.12882.
Examples
fit <- fit.surr(y ~ 1,
id = id,
surrogate = ~s,
treat = trt,
data = sim_onlinesurr, # This dataset is included in the OnlineSurr package
time = time,
verbose = 0,
N.boots = 500 # Generally, this value would be too small.
# Remember to increase it for your dataset.
)
time_homo_test(fit, signif.level = 0.05, N.boots = 500)
#> $T
#> [1] 1.058295
#>
#> $T.crit
#> 95%
#> 2.341364
#>
#> $p.value
#> [1] 0.654
#>