statdivlab / rigr

Regression, Inference, and General Data Analysis Tools for R
Other
10 stars 3 forks source link

`proptesti` returns a two-sided CI along with one-sided hypothesis test when `exact = FALSE` #113

Closed cwolock closed 2 years ago

cwolock commented 2 years ago

From Jim:

"I notice that when proptesti is called with exact = FALSE and a alternative of “greater” the corresponding CI is two sided rather than one-sided. While I’m not a fan of one-sided CI’s this is contrary to other R test functions as well as ttest and proptesti with EXACT = TRUE.

proptesti(67,114,null=.5,alternative="greater")

Call:

proptesti(x1 = 67, n1 = 114, null.hypoth = 0.5, alternative = "greater")

One-sample proportion test (approximate) :

Variable Obs Mean Std. Error 95% CI

var1 114 0.588 0.0461 [0.497, 0.678]

Summary:

Ho: True proportion is <= 0.5;

Ha: True proportion is > 0.5

Z = 1.87

p.value = 0.0305"

cwolock commented 2 years ago

(We discussed at some point last summer whether we ever want to return one-sided CIs. Seems good to make it consistent within the package, at least.)

yiqunchen commented 2 years ago

One-sided CIs are now returned for proptesti with one-sided hypothesis tests