Calculating test statistics and p-values for the signed Wald intersection test given by $$SW = \inf_{\theta \in \cap_{i=1}^n H_i} \{(\widehat{\theta}-\theta)^\top W\widehat{\Sigma}W (\widehat{\theta}-\theta)\} $$ with individual hypotheses for each coordinate of \(\theta\) given by \(H_i: \theta_j < \delta_j\) for some non-inferiority margin \(\delta_j\), \(j=1,\ldots,n\).
Usage
test_intersection_sw(
par,
vcov,
noninf = 0,
weights = 1,
nsim.null = 10000,
index = NULL,
par.name = "theta"
)Arguments
- par
(numeric) parameter estimates or
estimateobject- vcov
(matrix) asymptotic variance estimate
- noninf
(numeric) non-inferiority margins
- weights
(numeric) optional weights
- nsim.null
(integer) number of sample used in Monte-Carlo simulation
- index
(integer) subset of parameters to test
- par.name
(character) parameter names in output
Examples
S <- matrix(c(1, 0.5, 0.5, 2), 2, 2)
thetahat <- c(0.5, -0.2)
test_intersection_sw(thetahat, S, nsim.null = 1e5)
#>
#> Signed Wald Intersection Test
#>
#> data:
#> Intersection null hypothesis: theta =< [0, 0]
#> w = [0.5, 0.5]
#> Q = 0.0625, p-value = 0.479
#>
test_intersection_sw(thetahat, S, weights = NULL)
#>
#> Signed Wald Intersection Test
#>
#> data:
#> Intersection null hypothesis: theta =< [0, 0]
#> w = [0.5, 0.5]
#> Q = 0.0625, p-value = 0.465
#>
if (FALSE) { # \dontrun{
# only on 'lava' >= 1.8.2
e <- estimate(coef = thetahat, vcov = S, labels = c("p1", "p2"))
lava::closed_testing(e, test_intersection_sw, noninf = c(-0.1, -0.1)) |>
summary()
} # }
