|
14 | 14 | [9] "p-value: 0.002339 " |
15 | 15 | [10] "95 % Confidence interval for pi: ( 0.5729798 , 0.8270202 ) " |
16 | 16 |
|
| 17 | +# iscamonepropztest handles less alternatives with proportion input |
| 18 | + |
| 19 | + Code |
| 20 | + res$output |
| 21 | + Output |
| 22 | + [1] "" |
| 23 | + [2] "One Proportion z test" |
| 24 | + [3] "" |
| 25 | + [4] "Data: observed successes = 16, sample size = 50, sample proportion = 0.32" |
| 26 | + [5] "" |
| 27 | + [6] "Null hypothesis : pi = 0.35 " |
| 28 | + [7] "Alternative hypothesis: pi < 0.35 " |
| 29 | + [8] "z-statistic: -0.4447 " |
| 30 | + [9] "p-value: 0.3283 " |
| 31 | + [10] "90 % Confidence interval for pi: ( 0.2114895 , 0.4285105 ) " |
| 32 | + |
| 33 | +# iscamonepropztest covers two-sided comparisons when sample is below null |
| 34 | + |
| 35 | + Code |
| 36 | + res$output |
| 37 | + Output |
| 38 | + [1] "" |
| 39 | + [2] "One Proportion z test" |
| 40 | + [3] "" |
| 41 | + [4] "Data: observed successes = 18, sample size = 60, sample proportion = 0.3" |
| 42 | + [5] "" |
| 43 | + [6] "Null hypothesis : pi = 0.4 " |
| 44 | + [7] "Alternative hypothesis: pi <> 0.4 " |
| 45 | + [8] "z-statistic: -1.581 " |
| 46 | + [9] "p-value: 0.1138 " |
| 47 | + |
| 48 | +# iscamonepropztest reports intervals when hypothesis is omitted |
| 49 | + |
| 50 | + Code |
| 51 | + res$output |
| 52 | + Output |
| 53 | + [1] "" |
| 54 | + [2] "One Proportion z test" |
| 55 | + [3] "" |
| 56 | + [4] "Data: observed successes = 28, sample size = 100, sample proportion = 0.28" |
| 57 | + [5] "" |
| 58 | + [6] "90 % Confidence interval for pi: ( 0.2061463 , 0.3538537 ) " |
| 59 | + |
17 | 60 | # iscamtwopropztest matches two-sample z test calculations |
18 | 61 |
|
19 | 62 | Code |
|
32 | 75 | [11] "95 % Confidence interval for pi1-pi2: ( -0.1124861 , 0.2680417 ) " |
33 | 76 | [12] "p-value: 0.2116 " |
34 | 77 |
|
| 78 | +# iscamtwopropztest handles less alternative with proportion input |
| 79 | + |
| 80 | + Code |
| 81 | + res$output |
| 82 | + Output |
| 83 | + [1] "" |
| 84 | + [2] "Two Proportion z test" |
| 85 | + [3] "" |
| 86 | + [4] "Group1: observed successes = 25, sample size = 60, sample proportion = 0.4167" |
| 87 | + [5] "" |
| 88 | + [6] "Group2: observed successes = 28, sample size = 55, sample proportion = 0.5091" |
| 89 | + [7] "" |
| 90 | + [8] "Null hypothesis : pi1-pi2 = 0 " |
| 91 | + [9] "Alternative hypothesis: pi1-pi2 < 0 " |
| 92 | + [10] "z-statistic: -0.9932 " |
| 93 | + [11] "90 % Confidence interval for pi1-pi2: ( -0.2449163 , 0.06006778 ) " |
| 94 | + [12] "p-value: 0.1603 " |
| 95 | + |
| 96 | +# iscamtwopropztest covers two-sided alternatives below the null |
| 97 | + |
| 98 | + Code |
| 99 | + res$output |
| 100 | + Output |
| 101 | + [1] "" |
| 102 | + [2] "Two Proportion z test" |
| 103 | + [3] "" |
| 104 | + [4] "Group1: observed successes = 20, sample size = 60, sample proportion = 0.3333" |
| 105 | + [5] "" |
| 106 | + [6] "Group2: observed successes = 28, sample size = 60, sample proportion = 0.4667" |
| 107 | + [7] "" |
| 108 | + [8] "Null hypothesis : pi1-pi2 = 0 " |
| 109 | + [9] "Alternative hypothesis: pi1-pi2 <> 0 " |
| 110 | + [10] "z-statistic: -1.491 " |
| 111 | + [11] "p-value: 0.136 " |
| 112 | + |
| 113 | +# iscamtwopropztest accepts tabular input and confidence-only intervals |
| 114 | + |
| 115 | + Code |
| 116 | + res_alt$output |
| 117 | + Output |
| 118 | + [1] "" |
| 119 | + [2] "Two Proportion z test" |
| 120 | + [3] "" |
| 121 | + [4] "Group1: observed successes = 30, sample size = 50, sample proportion = 0.6" |
| 122 | + [5] "" |
| 123 | + [6] "Group2: observed successes = 25, sample size = 50, sample proportion = 0.5" |
| 124 | + [7] "" |
| 125 | + [8] "Null hypothesis : pi1-pi2 = 0 " |
| 126 | + [9] "Alternative hypothesis: pi1-pi2 > 0 " |
| 127 | + [10] "z-statistic: 1.005 " |
| 128 | + [11] "p-value: 0.1574 " |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | + Code |
| 133 | + res_conf$output |
| 134 | + Output |
| 135 | + [1] "" |
| 136 | + [2] "Two Proportion z test" |
| 137 | + [3] "" |
| 138 | + [4] "Group1: observed successes = 62, sample size = 100, sample proportion = 0.62" |
| 139 | + [5] "" |
| 140 | + [6] "Group2: observed successes = 50, sample size = 90, sample proportion = 0.5556" |
| 141 | + [7] "" |
| 142 | + [8] "90 % Confidence interval for pi1-pi2: ( -0.05301566 , 0.1819045 ) " |
| 143 | + |
0 commit comments