Dataplot Vol 2 Vol 1

# RUKHIN 2 TEST

Name:
RUKHIN 2 TEST (LET)
Type:
Let Subcommand
Purpose:
For two binomial proportions, compute the p-value and lower and upper confidence limits for

H0: p1 = 0.5*p2

with p1 and p2 denoting the two binomial proportions.

Description:
For each of the binomial proportions, we actually use the correction terms

pi = (xi + 0.5)/(ni + 1)

with pi xi, and ni denoting the binomial proportion, the number of successes and the number of trials for the i-th binomial proportion.

The computed test statistic is

p1 - 0.5*p2

and the associated standard error is

The p-value for a lower tailed test is

The p-value for an upper tailed test is

The p-value for a two tailed test is

The confidence interval is

Syntax 1:
LET <pval> <lowlim> <upplim> = RUKHIN 2 TEST
<p1> <n1> <p2> <n2> <alpha>
<SUBSET/EXCEPT/FOR qualification>
where <p1> is constant, parameter, or variable that contains the proportion of successes for the first sample;
<n1> is constant, parameter, or variable that contains the number of trials for the first sample;
<p2> is constant, parameter, or variable that contains the proportion of successes for the second sample;
<n2> is constant, parameter, or variable that contains the number of trials for the second sample;
<alpha> is constant or parameter that contains the significance level;
<pval> contains the returned p-value;
<lowlim> contains the computed lower confidence limit;
<upplim> contains the computed upper confidence limit;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax performs a two-tailed hypothesis test.

The <p1> <n1>, <p2>, and <n2> arguments can be either parameters or variables. If they are variables, then the variables must have the same number of elements. The <alpha> argument is always assumed to be either a constant or a parameter.

If the arguments are all parameters, then <pval>, <lowlim>, and <upplim> will be parameters. Otherwise, they will be variables.

Syntax 2:
LET <pval> <lowlim> <upplim> = RUKHIN 2 LOWER TAILED TEST
<p1> <n1> <p2> <n2> <alpha>
<SUBSET/EXCEPT/FOR qualification>
where <p1> is constant, parameter, or variable that contains the proportion of successes for the first sample;
<n1> is constant, parameter, or variable that contains the number of trials for the first sample;
<p2> is constant, parameter, or variable that contains the proportion of successes for the second sample;
<n2> is constant, parameter, or variable that contains the number of trials for the second sample;
<alpha> is constant or parameter that contains the significance level;
<pval> contains the returned p-value;
<lowlim> contains the computed lower confidence limit;
<upplim> contains the computed upper confidence limit;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax performs a lower-tailed hypothesis test. However, the confidence limits correspond to the two-tailed test.

The <p1> <n1>, <p2>, and <n2> arguments can be either parameters or variables. If they are variables, then the variables must have the same number of elements. The <alpha> argument is always assumed to be either a constant or a parameter.

If the arguments are all parameters, then <pval>, <lowlim>, and <upplim> will be parameters. Otherwise, they will be variables.

Syntax 3:
LET <pval> <lowlim> <upplim> = RUKHIN 2 UPPER TAILED TEST
<p1> <n1> <p2> <n2> <alpha>
<SUBSET/EXCEPT/FOR qualification>
where <p1> is constant, parameter, or variable that contains the proportion of successes for the first sample;
<n1> is constant, parameter, or variable that contains the number of trials for the first sample;
<p2> is constant, parameter, or variable that contains the proportion of successes for the second sample;
<n2> is constant, parameter, or variable that contains the number of trials for the second sample;
<alpha> is constant or parameter that contains the significance level;
<pval> contains the returned p-value;
<lowlim> contains the computed lower confidence limit;
<upplim> contains the computed upper confidence limit;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax performs an upper-tailed hypothesis test. However, the confidence limits correspond to the two-tailed test.

The <p1> <n1>, <p2>, and <n2> arguments can be either parameters or variables. If they are variables, then the variables must have the same number of elements. The <alpha> argument is always assumed to be either a constant or a parameter.

If the arguments are all parameters, then <pval>, <lowlim>, and <upplim> will be parameters. Otherwise, they will be variables.

Examples:
LET PVAL AL AU = RUKHIN 2 TEST P1 N1 P2 N2 ALPHA
LET PVAL AL AU = RUKHIN 2 LOWER TAILED TEST ...
P1 N1 P2 N2 ALPHA
LET PVAL AL AU = RUKHIN 2 UPPER TAILED TEST ...
P1 N1 P2 N2 ALPHA
Default:
None
Synonyms:
RUKHIN TWO is a synonym for RUKHIN 2
Related Commands:
 RUKHIN 1 TEST = Test binomial proportions p1 = p2*p3. RUKHIN 3 TEST = Test binomial proportions p1*p2 = p3*p4. BINOMIAL PRODUCT CONF LIMITS = Compute confidence limits for the product of two binomial proportions. BINOMIAL RATIO CONF LIMITS = Compute confidence limits for the ratio of two binomial proportions. AGRESTI-COULL CONFIDENCE LIMITS = Compute Agresti-Coull confidence limits for binomial proportions. EXACT BINOMIAL CONFIDENCE LIMITS = Compute exact binomial confidence limits for binomial proportions. AGRESTI-COULL = Compute Agresti-Coull confidence limits statistic for binomial proportions. EXACT BINOMIAL = Compute the "exact" confidence limits statistic for binomial proportions. BINOMIAL PROPORTION = Compute the binomial proportion statistic. BINOMIAL PROPORTION TEST = Perform a binomial proportions test. CROSS TABULATE = Perform a cross-tabulation for a specified statistic.
Reference:
Private communication with Andrew Rukhin and Bill Strawderman.
Applications:
Statistics
Implementation Date:
2008/09
Program:
```
LET P1 = 0.9
LET N2 = 40
LET P2 = 0.6
LET N2 = 40
LET ALPHA = 0.90
.
LET PVAL AL AU = RUKHIN 2 TEST P1 N1 P2 N2 ALPHA
```
The returned values for PVAL, AL, and AU are 0.0000, 0.4993, and 0.7007, respectively.

Date created: 10/5/2010
Last updated: 10/5/2010