double_rank_CI: Construct a two-sided confidence interval for the...

Description Usage Arguments Details Value Examples

View source: R/double_rank_CI.R

Description

double_rank_CI returns the two-sided level-alpha confidence interval of the proportional treatment effect in a cluster-level proportional treatment effect model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
double_rank_CI(
  R_t,
  R_c,
  d_t,
  d_c,
  Z_t,
  Z_c,
  lower,
  upper,
  meshsize = 0.001,
  psi = NULL,
  alpha = 0.05
)

Arguments

R_t

A length-K vector where K is equal to the number of clusters and the kth entry equal to the sum of unit-level outcomes in the encouraged cluster of the kth matched pair of two clusters.

R_c

A length-K vector where K is equal to the number of clusters and the kth entry equal to the sum of unit-level outcomes in the control cluster of the kth matched pair of two clusters.

d_t

A length-K vector where K is equal to the number of clusters and the kth entry equal to the sum of unit-level treatment received in the encouraged cluster of the kth matched pair of two clusters.

d_c

A length-K vector where K is equal to the number of clusters and the kth entry equal to the sum of unit-level treatment received in the control cluster of the kth matched pair of two clusters.

Z_t

A length-K vector where K is equal to the number of clusters and the kth entry equal to the encoruagement dose, i.e., the magnitude of the instrumental variable, of the encouraged cluster in the kth matched pair of two clusters.

Z_c

A length-K vector where K is equal to the number of clusters and the kth entry equal to the encoruagement dose, i.e., the magnitude of the instrumental variable, of the control cluster in the kth matched pair of two clusters.

lower, upper

The lower and upper endpoints of the interval to be searched.

meshsize

The meshsize of the grid search.

psi

A function specifying the score used in the test statistic. See Details of double_rank.

alpha

The level of the confidence interval.

Details

double_rank_CI constructs a two-sided level-alpha confidence interval by interting the hypothesis test using a double_rank test. Function double_rank_CI conducts a grid search with user-specified endpoints and meshsize in order to construct the confidence interval. For more details on the double_rank test, see double_rank.

Value

A length-2 vector of two endpoints of the confidence interval.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
R_t = encouraged_clusters$aggregated_outcome
R_c = control_clusters$aggregated_outcome
d_t = encouraged_clusters$aggregated_treatment
d_c = control_clusters$aggregated_treatment
Z_t = encouraged_clusters$IV
Z_c = control_clusters$IV


# Construct a level 0.05 CI for the constant proportional
# treatment effect with the help of the double rank test using
# default psi(d_k, q_k) = d_k * q_k. Search from -0.1 to 0.1:
CI = double_rank_CI(R_t, R_c, d_t, d_c, Z_t, Z_c,
                    lower = -0.1, upper = 0.1)

ivdesign documentation built on July 14, 2020, 5:07 p.m.