Package 'sensitivitymw'

Title: Sensitivity Analysis for Observational Studies Using Weighted M-Statistics
Description: Sensitivity analysis for tests, confidence intervals and estimates in matched observational studies with one or more controls using weighted or unweighted Huber-Maritz M-tests (including the permutational t-test). The method is from Rosenbaum (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls JASA, 109(507), 1145-1158 <doi:10.1080/01621459.2013.879261>.
Authors: Paul R. Rosenbaum
Maintainer: Paul R. Rosenbaum <[email protected]>
License: GPL-2
Version: 2.1
Built: 2024-11-01 11:33:30 UTC
Source: CRAN

Help Index


Sensitivity Analysis for Observational Studies Using Weighted M-Statistics

Description

Sensitivity analysis for tests, confidence intervals and estimates in matched observational studies with one or more controls using weighted or unweighted Huber-Maritz M-tests (including the permutational t-test). The method is from Rosenbaum (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls JASA, 109(507), 1145-1158 <doi:10.1080/01621459.2013.879261>.

Details

The DESCRIPTION file:

Package: sensitivitymw
Type: Package
Title: Sensitivity Analysis for Observational Studies Using Weighted M-Statistics
Version: 2.1
Date: 2021-12-23
Author: Paul R. Rosenbaum
Maintainer: Paul R. Rosenbaum <[email protected]>
Description: Sensitivity analysis for tests, confidence intervals and estimates in matched observational studies with one or more controls using weighted or unweighted Huber-Maritz M-tests (including the permutational t-test). The method is from Rosenbaum (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls JASA, 109(507), 1145-1158 <doi:10.1080/01621459.2013.879261>.
License: GPL-2
Imports: stats
Depends: R (>= 3.5.0)
NeedsCompilation: no
Packaged: 2022-01-03 17:41:31 UTC; rosenbap
Repository: CRAN
Date/Publication: 2022-01-04 00:10:02 UTC

Index of help topics:

erpcp                   DNA Damage Among Welders
mercury                 NHANES Mercury/Fish Data
mscorev                 Computes the M-scores used by senmw.
multrnks                Approximate scores for ranks.
newurks                 Approximate scores for ranks of row ranges.
senmw                   Sensitivity analysis in observational studies
                        using weighted Huber-Maritz M-statistics.
senmwCI                 Point estimate and confidence interval for
                        sensitivity analysis in observational studies
                        using weighted Huber-Maritz M-statistics.
sensitivitymw-package   Sensitivity Analysis for Observational Studies
                        Using Weighted M-Statistics
separable1k             Asymptotic separable calculations internal to
                        other functions.

The two most important functions are senmw and senmwCI; they perform, respectively, sensitivity analyses for hypothesis tests and for confidence intervals. Rosenbaum (2015) illustrates the use of this package and compares it with alternative methods. The package requries that each treated individual be matched to the same number of controls, say 1-to-1 or 1-to-2. The packages sensitivitymv, sensitivitymult and sensitivityfull permit variable numbers of controls, but they use unweighted M-statistics. The package sensitivitymult has unweighted M-statistics in what may be a more convenient format for data input – matched sets are defined by a variable rather than a matrix structure. The package senstrat uses strata instead of matched sets; see Rosenbaum (2021, sec. 2.3) for an example of combining robust covariance adjustment and stratification in sensitivity analysis, with data from the evident package.

Author(s)

Paul R. Rosenbaum

Maintainer: Paul R. Rosenbaum <[email protected]>

References

Huber, P. (1981) Robust Statistics. New York: Wiley, 1981.

Maritz, J. S. (1979) Exact robust confidence intervals for location. Biometrika 1979, 66, 163-166. <doi:10.1093/biomet/66.1.163>

Rosenbaum, P. R. (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls. Journal of the American Statistical Association, 109(507), 1145-1158 <doi:10.1080/01621459.2013.879261>

Rosenbaum, P. R. (2015). Two R packages for sensitivity analysis in observational studies. Observational Studies, 1(2), 1-17. The Observational Studies journal is available free on-line. <10.1353/obs.2015.0000>

Rosenbaum, P. R. (2007) Sensitivity analysis for m-estimates, tests and confidence intervals in matched observational studies. Biometrics, 2007, 63, 456-464. <doi:10.1111/j.1541-0420.2006.00717.x>

Rosenbaum, P. R. (2013) Impact of multiple matched controls on design sensitivity in observational studies. Biometrics, 2013, 69, 118-127. <doi:10.1111/j.1541-0420.2012.01821.x>

Rosenbaum, P. R. (2018). Sensitivity analysis for stratified comparisons in an observational study of the effect of smoking on homocysteine levels. The Annals of Applied Statistics, 12(4), 2312-2334. <doi:10.1214/18-AOAS1153>

Rosenbaum, P. R. (2021). Replication and Evidence Factors in Observational Studies. Chapman and Hall/CRC.<doi:10.1201/9781003039648>

Examples

data(mercury)
senmw(mercury,gamma=15)

DNA Damage Among Welders

Description

Matched pairs of a welder and a control, matching for age and smoking. The values are DNA elution rates through polycarbonate filters with proteinase K (or erpcp). Data are originally from Werfel et al. (1998) and were used as an example in Rosenbaum (2007). Data are used to illustrate the senmwCI function in the sensitivitymw package.

Usage

data(erpcp)

Format

A data frame with 39 observations on the following 2 variables.

welder

erpcp value for the welder

control

erpcp value for the matched control

Source

Werfel et al. (1998).

References

Rosenbaum, P. R. Sensitivity analysis for m-estimates, tests and confidence intervals in matched observational studies. Biometrics, 2007, 63, 456-464.

Werful, U., Langen, V., Eickhoff, I. et al. Elevated DNA strand breakage frequencies in lymphocytes of welders exposed to chromium and nickel. Carcinogenesis, 1998, 19, 413-418.

Examples

data(erpcp)

NHANES Mercury/Fish Data

Description

Data from NHANES. Matrix 397 x 3. n=397 treated people who ate at least 15 servings of fish or shellfish during the previous month are matched to two controls who ate at most one serving of fish or shellfish. The values in mercury record the level of methylmercury in blood in mu-g/dl. Column 1 is treated, columns 2 and 3 are controls. Specifically, column 2 describes an individual who ate no fish or shellfish in the previous month, while column 3 describes an individual who ate exactly one serving of fish or shellfish. The data are also used to illustrate the senmv function in the sensitivitymv package.

Usage

data(mercury)

Format

A data frame with 397 observations on the following 3 variables.

Treated

Mercury level for treated individual.

Zero

Mercury level for a control who ate no fish/shellfish

One

Mercury level for a control who ate one serving of fish/shellfish

Source

Data are originally from NHANES 2009-2010.

Data were used as an example in: Rosenbaum, P. R. (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls. Journal of the American Statistical Association, 109(507), 1145-1158 <doi:10.1080/01621459.2013.879261>

Examples

data(mercury)

Computes the M-scores used by senmw.

Description

Of limited interest to most users, mscorev computes the M-scores used by senmw for sensitivity analysis in observational studies using Huber-Maritz M-tests. As discussed in Rosenbaum (2014, section 4.1), the ranges of these M-scores within matched sets are ranked.

Usage

mscorev(ymat, inner = 0, trim = 2.5, qu = 0.5, TonT = FALSE)

Arguments

ymat

ymat is a matrix as described in the documentation for senmw or senmv.

inner

inner is the parameter described in the documentation for senmw or senmv. See Rosenbaum (2013).

trim

trim is the parameter described in the documentation for senmw or senmv.

qu

qu is the lambda parameter described in the documentation for senmw or senmv.

TonT

The TonT parameter is not used in the sensitivitymw package. It is included so that the same function mscorev works for both the sensitivitymw and senstivitymv packages. TonT is relevant only when the number of controls varies from one set to another. See the help file for senmv in the sensitivitymv package for discussion of the TonT parameter.

Value

Generally, a matrix with the same dimensions as ymat containing the M-scores.

Note

The example uses the mercury data set. In particular, the first two rows of the mercury data were discussed in the final paragraph of Rosenbaum (2014, Section 2).

Author(s)

Paul R. Rosenbaum

References

Rosenbaum, P. R. (2007) Sensitivity analysis for m-estimates, tests and confidence intervals in matched observational studies. Biometrics, 2007, 63, 456-464. <doi:10.1111/j.1541-0420.2006.00717.x>

Rosenbaum, P. R. (2013) Impact of multiple matched controls on design sensitivity in observational studies. Biometrics, 2013, 69, 118-127. <doi:10.1111/j.1541-0420.2012.01821.x>

Rosenbaum, P. R. (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls. Journal of the American Statistical Association, 2014. <doi:10.1080/01621459.2013.879261>

Examples

data(mercury)
mercury[1:2,]
mscorev(mercury,trim=3)[1:2,]

Approximate scores for ranks.

Description

Of limited interest to most users, this function is called by senmw. The function calculates the large sample approximation to a rank score transformation in Lemma 1, expression (9) of Rosenbaum (2011).

For numerical stability in large problems, the approximate rank score transformation in expression (9) of Rosenbaum (2011) is used in place of the exact rank score transformation in expression (8) of Rosenbaum (2011) and expression (5) of Rosenbaum (2014). Exact and approximate rank scores yield similar bounds on P-values. The exact rank scores involve very large combinatorial coefficiences when the same size is very large, whereas the nearly equivalent approximate scores do not.

Usage

multrnks(rk, m1 = 2, m2 = 2, m = 2)

Arguments

rk

A vector of ranks that may include average ranks for ties.

m1

One of three rank score parameters in Rosenbaum (2011, 2014), specifically m1 = underline(m).

m2

One of three rank score parameters in Rosenbaum (2011, 2014), specifically m2 = overline(m).

m

One of three rank score parameters in Rosenbaum (2011, 2014), specifically m = m.

Value

Vector of length(rk) containing the scores for the ranks in rk.

Author(s)

Paul R. Rosenbaum

References

Rosenbaum, P. R. (2011) A new U-statistic with superior design sensitivity in matched observational studies. Biometrics 67, 1017-1027. <doi:10.1111/j.1541-0420.2010.01535.x>

Rosenbaum, P. R. (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls. Journal of the American Statistical Association, 109(507), 1145-1158 <doi:10.1080/01621459.2013.879261>

Examples

multrnks(1:10)
	multrnks(1:10,m1=12,m2=20,m=20)

Approximate scores for ranks of row ranges.

Description

Of limited interest to most users, this function is called by senmw. The function calculates the ranges for each row of smat, scores their ranks using the large sample approximation to a rank score transformation in Lemma 1, expression (9) of Rosenbaum (2011), as implemented in the function multrnks, and multiplies the rows by these rank scores. Additional detail is found in the help file for multrnks.

Usage

newurks(smat, m1 = 2, m2 = 2, m = 2)

Arguments

smat

A matrix. When called by senmv, smat is a matrix produced by mscorev.

m1

One of three rank score parameters in Rosenbaum (2011, 2014), specifically m1 = underline(m).

m2

One of three rank score parameters in Rosenbaum (2011, 2014), specifically m2 = overline(m).

m

One of three rank score parameters in Rosenbaum (2011, 2014), specifically m = m.

Value

The function calculates the ranges for each row of smat, scores the ranks of the ranges using the large sample approximation to a rank score transformation in Lemma 1, expression (9) of Rosenbaum (2011), as implemented in the function multrnks, and multiplies the rows of smat by these rank scores, returning the result.

Author(s)

Paul R. Rosenbaum

References

Rosenbaum, P. R. (2011) A new u-statistic with superior design sensitivity in matched observational studies. Biometrics 67, 1017-1027. <doi:10.1111/j.1541-0420.2010.01535.x>

Rosenbaum, P. R. (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls. Journal of the American Statistical Association, 109(507), 1145-1158. <doi:10.1080/01621459.2013.879261>

Examples

data(mercury)
 	head(newurks(mscorev(mercury)))

Sensitivity analysis in observational studies using weighted Huber-Maritz M-statistics.

Description

Computes the large sample approximation to the upper bound on the one sided P-value testing the null hypothesis of no treatment effect in a matched observational study with a fixed number of controls matched to each treated subject. Uses an unweighted or a weighted version of Huber-Maritz M-statistics as test statistics, with weights proposed by Rosenbaum (2014). Under many simple models for treatment effects, weighted M-statistics have superior design sensitivity compared to unweighted M-statistics.

For confidence intervals and point estimates, use the senmwCI function rather than senmw.

The senmw function requires every treated subject to have the same number of matched controls, e.g., 2 controls matched to each treated subject. If your study has variable numbers of controls matched to treated subjects, consider using senmv in the sensitivitymv package.

The senmw function offers a wide choice of test statistics obtained by varying its arguments. The default is an unweighted M-test using Huber's psi-function, and it is equivalent to method = "h". The default is safe to use in all contexts, but it is expected to report greater sensitivity to bias than other methods in many contexts: therefore, for matched pairs, method="p" is suggested; and for matched sets with 2 to 4 controls per set, method="w" is suggested. See below and the references for additional options and discussion. The one-sided alternative hypothesis is that treatment increases the level of response. See the notes for discussion of other situations.

Usage

senmw(y, gamma = 1, method = NULL, inner = 0, trim = 3,

	 lambda = 1/2, tau = 0, m1=1, m2=1, m=1)

Arguments

y

If y is an n by J matrix, then: (i) the rows are n matched sets, (ii) the first column is the treated response in a set, columns 2 to J contain the responses of controls in the same matched set. Every set must have J-1 controls, and NAs are not allowed in y. If y is a vector, then y is the vector of treated-minus-control pair differences in outcomes in n=length(y) matched pairs.

gamma

gamma is the sensitivity parameter, gamma=1 for a randomization test, gamma>1 for sensitivity bounds. Use of gamma<1 will generate an error. This parameter gamma is denoted by the upper case Greek letter gamma in the cited literature, for instance Rosenbaum (2007, 2014).

method

If method is NULL, then the method is determined by the parameters, namely inner, trim, lambda, m1, m2, and m.

If method is not NULL, then these parameters are set according to the selected method and stated values of the parameters are ignored.

The default values of the parameters are equivalent to method="h"; however, method "h" is unweighted. One might reasonably regard method "f" as default weights.

(i) method = "h" (Huber, unweighted) is unweighted and sets inner=0, trim=3, lambda = 1/2, m1=m2=m=1. Method "h" is equivalent to the default settings. Its psi function levels off at 3 times the median (lambda = 1/2) of the absolute pair differences. The unweighted method h is often a good choice in small samples with few pairs or sets (say 20 sets). Unweighted method h is often a reasonable choice when the number of controls in each matched set is 6 or more. (Method "h" is almost the same as the default method for the senmv function in the sensitivitymv package, except: (a) senmv permits variable numbers of controls, (b) senmv uses trim = 2.5, not trim = 3.)

(ii) method = "w" (weighted). Method "w" sets inner=0, trim=3, lambda=1/2, m1=12, m2=20, m=20. These weights are sturdy, all-purpose weights, often better than method="h" with 2-4 controls per matched set. Method="s" will often perform better for short-tailed Normal errors and method="l" will often perform better for long-tailed errors such as the t with 4 degrees of freedom.

(iii) method = "f" (fixed choice weights). Method "f" sets inner=0, trim=3, lambda=1/2, m1=14, m2=20, m=20. Similar to method="w", method="f" uses all-purpose weights that were suggested, based on various calculations, in section 7.2 of Rosenbaum (2014) as the choice of a person who wants a "fixed choice" of weights.

(iv) method = "s" (weighted for short tails) has weights appropriate for short tailed distributions, such as the Normal distribution. Method "s" sets inner=0, trim=3, lambda=1/2, m1=16, m2=20, m=20.

(v) method = "l" (i.e., lower case letter L, weighted for long tails) has weights appropriate for long tailed distributions, such as the t-distribution with 4 degrees of freedom. It sets inner=0, trim=3, lambda=1/2, m1=12, m2=19, m=20. These weights redescend. The senmwCI function does not permit weights that redescend, and in particular does not permit method = "l".

(vi) method = "q" (Quade) ranks sets using ordinary ranks (1, 2, ..., n) applied to ranges of M-scores within sets, in parallel with Quade (1979) and Tardiff (1987). It sets inner=0, trim=3, lambda=1/2, m1=2, m2=2, m=2.

(vii) method = "t" (permutational t-test) is unweighted and permutes the observations themselves without ranking or scoring. It sets inner=0, trim=Inf, lambda=1/2, m1=m2=m=1. The history of the permutational t-test is discussed in the help file for the senmv function in the sensitivitymv package. Method "t" is the permutation test that uses the treated-minus-control difference in means as a test statistic.

(viii) method = "p" (pairs) is primarily intended for matched pairs, with just one matched control. It is unweighted but uses inner trimming, and it sets inner = 1/2, trim =2, lambda = 1/2, m1=m2=m=1. This method performs well for matched pairs, as seen in the evaluations in Tables 3, 4 and 5 of Rosenbaum (2013) where it is psi_in with K=2 for pairs.

inner

Inner trimming to increase design sensitivity. See the discussion of lambda. Use of inner<0 or inner>trim will generate an error. Inner trimming is discussed in Rosenbaum (2013).

trim

Outer trimming for resistance to outliers. Setting trim = Inf does no trimming. See the discussion of lambda.

lambda

Observations are scaled by the lambda quantile of the absolute pair differences, defaulting to the median of all paired absolute differences; see Rosenbaum (2007, section 4.2) for a precise definition in the case of multiple controls. If the lambda quantile of the absolute pair differences is 0, then scaling by 0 is impossible and an error may result; the solution is to increase lambda. If qu is the lambda quantile, absolute pair differences smaller than inner*qu receive weight 0, absolute pair differences larger than qu*trim receive weight 1, and between inner*qu and trim*qu weights increase linearly from 0 to 1. Use of lambda<=0 or lambda>=1 will generate an error. If inner=0 and trim=Inf, then this results in the permutational t-test in which the observations themselves are permuted, and in this case lambda is not used. Taking lambda = .95 and trim = 1 is similar to trimming 5 percent of the pair differences.

tau

If tau=0, senmw tests the null hypothesis of no treatment effect. If tau is not 0, senmw tests the null hypothesis that the treatment effect is an additive shift of tau against the alternative that the effect is larger than tau.

m1

One of three parameters that determine the weights. See the discussion of m below.

m2

One of three parameters that determine the weights. See the discussion of m below.

m

One of three parameters that determine the weights. If in doubt about (m1,m2,m), then sensible sturdy choices are method="p" for matched pairs and method="w" for sets with 2 to 4 controls. Properties of different weights (m,m1,m2) are discussed in Rosenbaum (2014, sections 4 and 5). Details follow.

The triple (m,m1,m2) determines the weights, essentially as in expression (5) in Rosenbaum (2014) or expression (8) in Rosenbaum (2011) where they are called m (for m), underline(m) for m1, and overline(m) for m2. In particular, (m,m1,m2)=(1,1,1) is unweighted. (m,m1,m2)=(2,2,2) are (essentially) conventional ranks, as in method="q". Method="w" has (m,m1,m2)=(20,12,20) for increasing rank scores that ignore sets with little dispersion. If m>m2, as in (m,m1,m2)=(20,12,19) for method="l", the scores are redescending. The function semwCI for confidence intervals and estimates does not permit redescending weights, m2<m.

Value

pval

Approximate upper bound on the one-sided P-value.

deviate

Deviate that is compared to the upper tail of the standard Normal distribution to obtain the P-value.

statistic

Value of the test statistic.

expectation

Maximum null expectation of the test statistic for the given value of gamma.

variance

Among null distributions that yield the maximum expectation, variance is the maximum possible variance for the given value of gamma. See Gastwirth, Krieger and Rosenbaum (2000), Rosenbaum (2007, Section 4; 2014), and Rosenbaum (2018).

Note

The one-sided alternative hypothesis is that treatment increases the level of response. Apply senmw to -y to test against the alternative that the treatment decreases the level of response. One way to perform a two sided test is to perform both tests and double the smaller P-value bound.

When a study has a fixed number of controls, the senmw function may be used in place of the senmv function in the sensitivitymv package, and senmw will be faster (because separable1k in sensitivitymw for fixed controls is faster than separable1v in sensitivitymv for variable controls). The senmw function may be used in conjunction with the following functions from the sensivitymv package: amplify, truncatedP and truncatedPbg.

The example mercury is from Rosenbaum (2014) and compares the mercury levels in the blood of individuals who ate 15 or more servings of fish or shellfish in the previous month to people who ate at most one serving. Data are from NHANES.

Consistent with theory, in the example, the weighted M-statistics report greater insensitivity to unmeasured biases than do unweighted M-statistics. For example, unweighted method="h" and unweighted m1=1,m2=1,m=1 yield p-values above 0.05 for gamma=15, but weighted method="w" yields a p-value below 0.05 for gamma=19. Row gamma=15 in Table 2 of Rosenbaum (2014) is reproduced by the example below with various values of m1<=m2<=m.

For numerical stability in large problems, senmw function uses approximate weights (expression (9) in Rosenbaum (2011)) rather than exact weights (expression (8) in Rosenbaum (2011) and expression (5) in Rosenbaum (2014)), so senmw produces ever so slightly different p-value bounds than reported in Table 2 of Rosenbaum (2014). If you are interested in this distinction between approximate and exact rank scores (it isn't really very interesting), the calculation occurs in the multrnks function, so type help(multrnks).

Author(s)

Paul R. Rosenbaum

References

Huber, P. (1981) Robust Statistics. New York: Wiley, 1981.<doi:10.1002/9780470434697>

Maritz, J. S. (1979) Exact robust confidence intervals for location. Biometrika 1979, 66, 163-166. <doi:10.1093/biomet/66.1.163>

Gastwirth, J. L., Krieger, A. M., and Rosenbaum, P. R. (2000) Asymptotic separability in sensitivity analysis. Journal of the Royal Statistical Society B 2000, 62, 545-556.<doi:10.1111/1467-9868.00249>

Quade, D. (1979). Using weighted rankings in the analysis of complete blocks with additive block effects. Journal of the American Statistical Association, 74(367), 680-683.

Rosenbaum, P. R. (2007) Sensitivity analysis for m-estimates, tests and confidence intervals in matched observational studies. Biometrics, 2007, 63, 456-464. <doi:10.1111/j.1541-0420.2006.00717.x>

Rosenbaum, P. R. (2013) Impact of multiple matched controls on design sensitivity in observational studies. Biometrics, 2013, 69, 118-127. <doi:10.1111/j.1541-0420.2012.01821.x>

Rosenbaum, P. R. (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls. Journal of the American Statistical Association, 109(507), 1145-1158 <doi:10.1080/01621459.2013.879261>

Rosenbaum, P. R. (2015). Two R packages for sensitivity analysis in observational studies. Observational Studies, 1(2), 1-17. The Observational Studies journal is available free on-line. <10.1353/obs.2015.0000> This article discusses and illustrates the use of the current package.

Rosenbaum, P. R. (2018). Sensitivity analysis for stratified comparisons in an observational study of the effect of smoking on homocysteine levels. The Annals of Applied Statistics, 12(4), 2312-2334. <doi:10.1214/18-AOAS1153>

Tardif, S. (1987). Efficiency and optimality results for tests based on weighted rankings. Journal of the American Statistical Association, 82(398), 637-644.

Examples

#Illustrates greater insensitivity reported when weights are use.
data(mercury)
senmw(mercury,gamma=15)
senmw(mercury,method="h",gamma=15)
senmw(mercury,method="w",gamma=15)
senmw(mercury,method="w",gamma=19)
senmw(mercury,method="l",gamma=20)

#Reproduces Table 2, row gamma=15 of Rosenbaum (2014).
senmw(mercury,gamma=15,m1=1,m2=1,m=1)
senmw(mercury,gamma=15,m1=2,m2=2,m=2)
senmw(mercury,gamma=15,m1=12,m2=20,m=20)
senmw(mercury,gamma=15,m1=14,m2=20,m=20)
senmw(mercury,gamma=15,m1=16,m2=20,m=20)
senmw(mercury,gamma=15,m1=12,m2=19,m=20)
senmw(mercury,gamma=15,m1=14,m2=19,m=20)
senmw(mercury,gamma=15,m1=16,m2=19,m=20)

#Reproduces part of Table 1 in Rosenbaum (2007).  For other parts of this table, see help(senmwCI).
data(erpcp)
senmw(erpcp,gamma=2,trim=1,inner=0,m1=1,m2=1,m=1)
senmw(erpcp,gamma=3,trim=1,inner=0,m1=1,m2=1,m=1)
senmw(erpcp,gamma=4,trim=1,inner=0,m1=1,m2=1,m=1)

Point estimate and confidence interval for sensitivity analysis in observational studies using weighted Huber-Maritz M-statistics.

Description

Obtains point estimates and confidence intervals by inverting the hypothesis test in senmw. For instance, the confidence interval is the set of hypotheses not rejected by the test. Estimates an additive treatment effect tau. In a sensitivity analysis with gamma>1, one obtains an interval of point estimates consistent with a bias of at most gamma, and an interval containing all of the confidence intervals that are consistent with a bias of at most gamma. Because senmwCI calls senmw many times, senmwCI is slower than senmw.

Usage

senmwCI(y, gamma = 1, method = NULL, inner = 0, trim = 3,
	 lambda = 1/2, m1=1, m2=1, m=1, alpha=0.05,
	 one.sided=TRUE, tol=NULL, interval=NULL, detail=FALSE)

Arguments

y

If y is an n by J matrix, then: (i) the rows are n matched sets, (ii) the first column is the treated response in a set, columns 2 to J contain the responses of controls in the same matched set. Every set must have J-1 controls, and NAs are not allowed in y. If y is a vector, then y is the vector of treated-minus-control pair differences in outcomes in n=length(y) matched pairs.

gamma

gamma is the sensitivity parameter, gamma=1 for a randomization test, gamma>1 for sensitivity bounds. Use of gamma<1 will generate an error. This parameter gamma is denoted by the upper case Greek letter gamma in the cited literature, for instance Rosenbaum (2007, 2014).

method

The method argument is the same as for the senmw function. See the help file for senmw for more information. Method="l" is not available for confidence intervals.

inner

Inner trimming to increase design sensitivity. See the help file for senmw for more information.

trim

Outer trimming for resistance to outliers. See the help file for senmw for more information.

lambda

Observations are scaled by the lambda quantile of the absolute pair differences. See the help file for senmw for more information.

m1

One of three parameters that determine the weights. See the discussion of m below.

m2

One of three parameters that determine the weights. See the discussion of m below.

m

One of three parameters that determine the weights. See the help file for senmw for more information. m2<m is not available for confidence intervals.

alpha

1-alpha is the coverage of the confidence interval.

one.sided

If TRUE, the confidence interval is one sided. If FALSE, the confidence interval is two-sided. The default is one-sided.

tol

The senmwCI function calls the R function uniroot, and tol is the tol (or tolerance) parameter in that call. If tol=NULL, senmwCI picks a reasonable tolerance.

interval

The senmwCI function calls the R function uniroot, and interval is the interval parameter in that call. If interval=NULL, senmwCI picks a reasonable interval.

detail

If detail=FALSE, the interval of point estimates and the confidence interval are reported after rounding based on tol. If detail=TRUE, then the results are not rounded, the tol and interval are reported.

Value

PointEstimate

An interval of point estimates allowing for a bias of gamma in treatment assignment. Rounded if detail=FALSE.

CI

An confidence interval allowing for a bias of gamma in treatment assignment. Rounded if detail=FALSE.

search.interval

If detail=TRUE, the interval of parameter values searched to find the estimates and confidence intervals.

tolerance

If detail=TRUE, the tolerance used in solving for estimates and confidence intervals.

Note

senmwCI inverts a test to obtain confidence intervals and point estimats; so, it calls senmw many times, solving several equations, and senmwCI is much slower than a single call to senmw. senmwCI finds point estimates and confidence intervals by searching for a value of the parameter tau in "interval" determining the solution tau.hat to an estimating equation with an error of "tol" in solving the equation. If interval=NULL and tol=NULL, senmwCI tries to pick a reasonable finite interval and tol>0. If concerned about these "reasonable values", set detail=TRUE, make the interval longer, the tol smaller, and wait longer for program to run. As illustrated in the examples, if there is reason for concern, the solutions produced by senmwCI can be checked by running senmw with tau set to the endpoints of the various intervals.

Unlike senmw, senmwCI does not permit redescending rank scores, m2<m or method="l".

Author(s)

Paul R. Rosenbaum

References

Huber, P. (1981) Robust Statistics. New York: Wiley, 1981.

Maritz, J. S. (1979) Exact robust confidence intervals for location. Biometrika 1979, 66, 163-166. <doi:10.1093/biomet/66.1.163>

Rosenbaum, P. R. (2007) Sensitivity analysis for m-estimates, tests and confidence intervals in matched observational studies. Biometrics, 2007, 63, 456-464. <doi:10.1111/j.1541-0420.2006.00717.x>

Rosenbaum, P. R. (2013) Impact of multiple matched controls on design sensitivity in observational studies. Biometrics, 2013, 69, 118-127. <doi:10.1111/j.1541-0420.2012.01821.x>

Rosenbaum, P. R. (2014) Weighted M-statistics with superior design sensitivity in matched observational studies with multiple controls. Journal of the American Statistical Association, 109(507), 1145-1158 <doi:10.1080/01621459.2013.879261> This paper is the main reference for weighted M-statistics and for the sensitivitymw package.

Rosenbaum, P. R. (2015). Two R packages for sensitivity analysis in observational studies. Observational Studies, 1(2), 1-17. The Observational Studies journal is available free on-line. <10.1353/obs.2015.0000> This article discusses and illustrates the use of the current package.

Examples

data(mercury)
senmwCI(mercury,gamma=2,method="w",one.sided=FALSE,detail=TRUE)

#The following example reproduces part of Table 1 in Rosenbaum (2007).
#In particular, the one-sided .95 confidence interval is tau >= 0.1812,
#and the P-value testing tau=0.1812 is 0.05.
#Similarly, the test statistic equals its null expectation at tau=0.3403,
#and when evaluated at -yrpcp the same thing happens at tau=-0.6666.
data(erpcp)
senmwCI(erpcp,gamma=2,trim=1,m1=1,m2=1,m=1)
senmw(erpcp,gamma=2,trim=1,m1=1,m2=1,m=1,tau=0.1812)
senmw(erpcp,gamma=2,trim=1,m1=1,m2=1,m=1,tau=0.3403)
senmw(-erpcp,gamma=2,trim=1,m1=1,m2=1,m=1,tau=-0.6666)


#This example illustrates the relationship between senmwCI and senmw.
#Note that the endpoints from senmwCI are tested by senmw.
#Also for illustration, the search interval in this case is specified as from 0 to 5.
senmwCI(mercury,gamma=2,method="w",detail=TRUE,interval=c(0,5),one.sided=FALSE)
senmw(mercury,gamma=2,method="w",tau=2.03135)
senmw(-mercury,gamma=2,method="w",tau=-3.166710)
senmw(mercury,gamma=2,method="w",tau=1.775008)
senmw(-mercury,gamma=2,method="w",tau=-3.605779)

Asymptotic separable calculations internal to other functions.

Description

This general purpose function is internal to other functions, such as senmw in the sensitivitymw package. The function performs the asymptotic separable calculations described in Gastwirth, Krieger and Rosenbaum (2000), as used in section 4 of Rosenbaum (2007); see Rosenbaum (2018) for additional theory associated with this approximation. The example is equivalent to senmw(mercury,gamma=2,method="t"). The function separable1k in the sensitivitymw package and the function separable1v in sensitivitymv package should give the same answer when applied to matched sets with a fixed number of controls; however, separable1k is faster as a consequence of not allowing variable numbers of controls. Speed is important when senmwCI calls senmw repeatedly to obtain a confidence set by inverting a test.

Usage

separable1k(ymat, gamma = 1)

Arguments

ymat

ymat is a matrix whose rows are matched sets and whose columns are matched individuals. The first column describes treated individuals. Other columns describe controls. Every set must have 1 treated subject and dim(ymat)[2]-1 controls. NAs are not allowed. For variable numbers of controls, see the separable1v function in the sensitivitymv package.

gamma

gamma is the value of the sensitivity parameter; see the documentation for the senmw function in the sensitivitymw package. One should use a value of gamma >= 1.

Value

pval

Approximate upper bound on the one-sided P-value.

deviate

Deviate that is compared to the upper tail of the standard Normal distribution to obtain the P-value.

statistic

Value of the test statistic.

expectation

Maximum null expectation of the test statistic for the given value of gamma.

variance

Among null distributions that yield the maximum expectation, variance is the maximum possible variance for the given value of gamma. See Rosenbaum (2007, Section 4) and Gastwirth, Krieger and Rosenbaum (2000).

Author(s)

Paul R. Rosenbaum

References

Gastwirth, J. L., Krieger, A. M., and Rosenbaum, P. R. (2000) Asymptotic separability in sensitivity analysis. Journal of the Royal Statistical Society B 2000, 62, 545-556.<doi:10.1111/1467-9868.00249>

Rosenbaum, P. R. (2007) Sensitivity analysis for m-estimates, tests and confidence intervals in matched observational studies. Biometrics, 2007, 63, 456-464. <doi:10.1111/j.1541-0420.2006.00717.x>

Rosenbaum, P. R. (2018). Sensitivity analysis for stratified comparisons in an observational study of the effect of smoking on homocysteine levels. The Annals of Applied Statistics, 12(4), 2312-2334. <doi:10.1214/18-AOAS1153>

Examples

data(mercury)
separable1k(mercury,gamma=2)
senmw(mercury,method="t",gamma=2)