prop.comb: prop.comb

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/prop.comb.R

Description

Main function for making inferences (confidence intervals and tests) about a linear combination of proportions using optimal methods from the literature and score method.

Usage

1
2
prop.comb(x, n, p = NULL, a = NULL, alternative = c("two.sided", "less", "greater"),
 conf.level = 0.95, coverage = FALSE, nrep = 1000)

Arguments

x

a vector of counts of successes.

n

a vector of counts of samples sizes.

p

hypothesized true value of the interest parameter.

a

coefficients of the linear combination of proportions.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".

conf.level

confidence level of the returned confidence interval.

coverage

coverage probability of the confidence interval.

nrep

number of replays to calculate the estimated coverage probabilities

Details

Counts of successes must be nonnegative and hence not greater than the corresponding numbers of trials which must be positive. All finite counts should be integers.

It checks how many samples there are (k). When k=1, it will be the case of one proporcion. When k=2 and a=(-1,1), we will have the difference of proportions. In another case, the parameter of interest will be a linear combination of k proportions.

When k=1, automatically a=1 and the main function will assign p=0.5 if p=NULL. If k=2 and a=NULL, automatically a=c(-1,+1) and the main function will assign p=0 if p=NULL, i.e. test of homogeneity of proportions.

If alternative is NULL, the main function will automatically assign alternative="two.sided".

If conf.level is NULL, the main function will automatically assign conf.level=0.95.

If coverage is NULL or FALSE, the main function does not calculate the estimated coverage probabilities. Whereas, if coverage is TRUE, the main function calculates the estimated coverage probabilities. In this case, if nrep is NULL, the main function will automatically assign nrep=1000.

Value

Returns a list with the following components:

estimate

a vector with the sample proportions x/n.

a

coefficients of the linear combination of proportions.

L

estimated value of the interest parameter. L=difference for the d case.

inference

confidence intervals (lower limit, upper limit) and p-values of the test (with z-values of statistics). The coverage probabilities are included when the user requests them.

alternative

a character string describing the alternative hypothesis.

lambda

hypothesized true value of the interest parameter.

k

number of samples.

x

number of successes.

n

number of trials.

p

same value of lambda

conf.level

confidence level of the confidence interval.

recommendation

recommended method by references.

Author(s)

Maria Alvarez Hernandez and Javier Roca Pardinas

References

Wilson, E. (1927). "Probable inference, the law of succession, and statistical inference." Journal of the American Statistical Association, 22, 209 - 212

Agresti, A. & Coull, B. A. (1998). "Approximate is better than "exact" for interval estimation of binomial proportions." The American Statistician, 52, 119 - 126

Herranz, I. & Martin, A. (2008). "A numerical comparison of several unconditional exact tests in problems of equivalence based on the difference of proportions." Journal of Statistical Computation and Simulation, 78, 969 - 981

Martin, A.; Alvarez, M. & Herranz, I. (2011). "Inferences about a linear combination of proportions." Statistical Methods in Medical Research, 2011, 20, 369 - 387

Martin, A.; Herranz, I. & Alvarez, M. (2012). "The optimal method to make inferences about a lineal combination of proportions." Journal of Statistical Computation and Simulation, 82, 123 - 135

Martin, A.; Alvarez, M. & Herranz, I. (2012). "Asymptotic two-tailed confidence intervals for the difference of proportions." Journal of Applied Statistics, 39, 1423 - 1435

Martin, A. & Alvarez, M. (2013). "Optimal method for realizing two-sided inferences about a linear combination of two proportions." Communications in Statistics - Simulation and Computation, 42, 327 - 343

Martin, A. & Alvarez, M. (2014). "Two-tailed asymptotic inferences for a proportion." Journal of Applied Statistics, 41, 1516 - 1529

Yu, W.; Guo, X. & Xu, W. (2014). "An improved score interval with a modified midpoint for a binomial proportion." Journal of Statistical Computation and Simulation, 84, 1022 - 1038

Alvarez, M. & Martin, A. (2015). "New asymptotic inferences about the difference, ratio and linear combination of two independent proportions." Communications in Statistics - Simulation and Computation (in press).

See Also

prop.RR for inferences about the relative risk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# ONE PROPORTION
# Yu et al (2014) use a data set, which describes characteristics of some 
# American bridges. The objetive is to construct CIs for the proportion 
# of wood bridges.

prop.comb(x=16, n=109, alternative="two.sided", conf.level=0.95)

# DIFFERENCE OF TWO PROPORTION
# Rodary et al. (1989) studied the response to chemotherapy and radiation 
# therapy in a randomized clinical trial on nephroblastoma. 
# The main objetive is to contruct CIs about the difference of the response 
# and to contrast the homogeneity of proportions.

prop.comb(x=c(83,69), n=c(88,76), alternative="two.sided", conf.level=0.95)

# COMBINATION OF TWO PROPORTIONS
# Martin and Alvarez (2013) construct CIs about the parameter "loss associated
# with a diagnostic test" in the context of comparing two diagnostic tests 
# (Bloch, 1997) and use a data set by Hanley and McNeil (1983). 

prop.comb(x=c(44, 3), n=c(54, 58), a=c(-0.4, 0.6), 
alternative="two.sided", conf.level=0.95)

# Tebbs and Roths (2008) refer to data about a multicenter clinical trial whose
# aim was to evaluate the efficacy of a lowered salt regim in the treatment of male 
# infants with acute diarrhea. The objetive it to obtain a confidence interval about 
# the proportion of fever cases in South American area. 

prop.comb(x=c(32, 34), n=c(107, 92), a=c(107/199, 92/199), 
alternative="two.sided", conf.level=0.95)


# LINEAR COMBINATION OF K>3 PROPORTIONS
# Price and Bonett (2004) refer to a study by Cohen et al. (1991) in which 120 rats 
# were randomly assigned four diets (high or low fat and with or without fiber).
# The absence or presence of a tumor was recorded for each rat.
# The contrast of interest will evaluate the effects of study's variables.

# Data of diet and tumor study:
x <-c(20, 14, 27, 19); n <-c(30, 30, 30, 30)
a1 <-c(+1, -1, -1, +1); a2 <-c(+1, +1, -1, -1); a3 <-c(+1, -1, +1, -1)

prop.comb(x, n, a=a1); prop.comb(x, n, a=a2); prop.comb(x, n, a=a3)

Example output

Loading required package: rootSolve
 
      1-sample proportion test 
 
number of successes = 16 number of trials = 109 
sample estimates 
p 
0.1468 
 
alternative hypothesis: true probability of success is not equal to 0.5 
                95 percent confidence interval 
                   lower limit upper limit z value p-value
Score (without cc)      0.0924      0.2252  7.3753       0
Score (with cc)         0.0888      0.2304  7.2795       0
Adjusted Arc Sine       0.0898      0.2224  8.1324       0
Adjusted Wald           0.0918      0.2268  9.8970       0
Modified Score          0.0915      0.2243      NA      NA
 
Recommendation: 
Adjusted Wald 
 
       difference of proportions 
 
x: number of successes 
n: number of trials 
prop: proportion sample estimates 
 
 sample  x  n   prop
      1 83 88 0.9432
      2 69 76 0.9079
 
difference of proportions: D=p2-p1 
estimated D: -0.0353 
 
alternative hypothesis: true difference D is not equal to 0 
                95 percent confidence interval 
                    lower limit upper limit z value p-value
Score (without cc)      -0.1286      0.0481 -0.8653  0.3869
Score (with cc)         -0.1287      0.0483 -0.8617  0.3888
Adjusted Wald           -0.1205      0.0488 -0.8306  0.4062
Adjusted Arc Sine       -0.1292      0.0484 -0.8503  0.3952
Adjusted-M Arc Sine     -0.1228      0.0460 -0.8515  0.3945
 
Recommendation: 
Adjusted Arc Sine 
There were 50 or more warnings (use warnings() to see the first 50)
 
       2 linear combination of proportions 
 
x: number of successes 
n: number of trials 
beta: coefficients of the combination 
prop: proportion sample estimates 
 
 sample  x  n beta   prop
      1 44 54 -0.4 0.8148
      2  3 58  0.6 0.0517
 
combination of interest: L= -0.4*p1+0.6*p2 
estimated L: -0.2949 
 
alternative hypothesis: true combination L is not equal to 0.1 
                95 percent confidence interval 
                          lower limit upper limit  z value p-value
Score (without cc)            -0.3373     -0.2274  -8.2478       0
Score (with cc)               -0.3374     -0.2273  -8.2445       0
Adjusted Wald (a)             -0.3377     -0.2252 -13.2851       0
Adjusted Wald (b)             -0.3381     -0.2258 -13.3242       0
Adjusted likelihood ratio     -0.3350     -0.2246  -8.8228       0
 
Recommendation: 
Adjusted Wald(b) 
There were 50 or more warnings (use warnings() to see the first 50)
 
       2 linear combination of proportions 
 
x: number of successes 
n: number of trials 
beta: coefficients of the combination 
prop: proportion sample estimates 
 
 sample  x   n   beta   prop
      1 32 107 0.5377 0.2991
      2 34  92 0.4623 0.3696
 
combination of interest: L= 0.5377*p1+0.4623*p2 
estimated L: 0.3317 
 
alternative hypothesis: true combination L is not equal to 0.5 
                95 percent confidence interval 
                          lower limit upper limit z value p-value
Score (without cc)             0.2701      0.3995 -4.7612       0
Score (with cc)                0.2701      0.3996 -4.7598       0
Adjusted Wald (a)              0.2702      0.3997 -4.9971       0
Adjusted Wald (b)              0.2700      0.3996 -4.9995       0
Adjusted likelihood ratio      0.2706      0.4000 -4.7850       0
 
Recommendation: 
Adjusted Wald(b) 
There were 50 or more warnings (use warnings() to see the first 50)
 
       4 linear combination of proportions 
 
x: number of successes 
n: number of trials 
beta: coefficients of the combination 
prop: proportion sample estimates 
 
 sample  x  n beta   prop
      1 20 30    1 0.6667
      2 14 30   -1 0.4667
      3 27 30   -1 0.9000
      4 19 30    1 0.6333
 
combination of interest: L= 1*p1-1*p2-1*p3+1*p4 
estimated L: -0.0667 
 
alternative hypothesis: true combination L is not equal to 0 
                95 percent confidence interval 
                   lower limit upper limit z value p-value
Score (without cc)     -0.3883      0.2445 -0.4119  0.6804
Score (with cc)        -0.3883      0.2445 -0.4119  0.6804
Adjusted Wald          -0.3808      0.2516 -0.4004  0.6889
Peskun                 -0.4167      0.2875 -0.3651  0.7150
 
Recommendation: 
Score (without cc) 
There were 50 or more warnings (use warnings() to see the first 50)
 
       4 linear combination of proportions 
 
x: number of successes 
n: number of trials 
beta: coefficients of the combination 
prop: proportion sample estimates 
 
 sample  x  n beta   prop
      1 20 30    1 0.6667
      2 14 30    1 0.4667
      3 27 30   -1 0.9000
      4 19 30   -1 0.6333
 
combination of interest: L= 1*p1+1*p2-1*p3-1*p4 
estimated L: -0.4 
 
alternative hypothesis: true combination L is not equal to 0 
                95 percent confidence interval 
                   lower limit upper limit z value p-value
Score (without cc)     -0.7097     -0.0771 -2.4241  0.0153
Score (with cc)        -0.7097     -0.0771 -2.4241  0.0153
Adjusted Wald          -0.7038     -0.0714 -2.4023  0.0163
Peskun                 -0.7329     -0.0422 -2.1909  0.0285
 
Recommendation: 
Score (without cc) 
There were 50 or more warnings (use warnings() to see the first 50)
 
       4 linear combination of proportions 
 
x: number of successes 
n: number of trials 
beta: coefficients of the combination 
prop: proportion sample estimates 
 
 sample  x  n beta   prop
      1 20 30    1 0.6667
      2 14 30   -1 0.4667
      3 27 30    1 0.9000
      4 19 30   -1 0.6333
 
combination of interest: L= 1*p1-1*p2+1*p3-1*p4 
estimated L: 0.4667 
 
alternative hypothesis: true combination L is not equal to 0 
                95 percent confidence interval 
                   lower limit upper limit z value p-value
Score (without cc)      0.1421      0.7742  2.8033  0.0051
Score (with cc)         0.1420      0.7742  2.8033  0.0051
Adjusted Wald           0.1360      0.7684  2.8027  0.0051
Peskun                  0.1094      0.7950  2.5560  0.0106
 
Recommendation: 
Score (without cc) 
There were 50 or more warnings (use warnings() to see the first 50)

prop.comb.RR documentation built on May 2, 2019, 12:41 p.m.