Learn R Programming

targeted (version 0.6)

test_intersection_sw: Signed Wald intersection test

Description

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 = NULL,
  weights = NULL,
  nsim.null = 10000,
  index = NULL
)

Value

list with Wald

Arguments

par

(numeric) parameter estimates or estimate object

vcov

(matrix) asymptotic variance estimate

noninf

(numeric) non-inferiority margins

weights

(numeric) optional weights

nsim.null

number of sample used in Monte-Carlo simulation

index

subset of parameters to test

Author

Klaus Kähler Holst, Christian Bressen Pipper

Examples

Run this code
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)
test_intersection_sw(thetahat, S, weights = NULL)

if (FALSE)  # 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()

Run the code above in your browser using DataLab