Post Reply 
(12C) Binary Outcome
04-07-2018, 06:10 PM (This post was last modified: 04-07-2018 06:15 PM by Dieter.)
Post: #2
RE: (12C) Binary Outcome
(04-07-2018 08:49 AM)Gamo Wrote:  Suppose you want to test whether more people respond to one drug versus another, or whether one advertising campaign is more effective than another. In either case, you have a binary outcome. Someone either responds to the drug or they don't. They either buy the product or they don't.

Gamo, you do not say anything about the statistics behind this program. But as far as I can tell this calculates the (equal) sample size for a significance test that tests if p1 and p2 are equal. Your formula includes the constant 16. This value is equal to 2 z² where z is the quantile for which the Normal distribution CDF equals the desired significance level 1–α. A value of 16 here means a z of 2,828 which is equivalent to an α-error of merely 0,47%. For a one-sided test (p1<p2 or p1>p2) it's even 0,23%. This is extremely restrictive. Common values are α=5% or maybe 1%. That's why I suggest replacing the 16 with another value:

For 1–α = 90%:    5,411
For 1–α = 95%:    7,683
For 1–α = 98%:  10,824
For 1–α = 99%:  13,270

I'd suggest a value like 10. This means 1–α = 97,5% for a two-sided test and 1–α = 98,7% for a single-sided test.

Regarding the program: the formula is so simple that one certainly does not need three data registers and 25 steps. Take a look at the following version and you will find one or two small tricks that make the program more effective.

Code:
01 STO 1
02 X<>Y
03 STO-1
04 +
05 2
06 /
07 1
08 X<>Y
09 -
10 LstX
11 x
12 1
13 0
14 x
15 RCL 1
16 ENTER
17 x
18 /
19 FIX 0

BTW, as far as I remember the underlying Normal distribution can only be used because of the central limit theorem, which requires a sufficiently large sample size. A common rule of thumb here is n · p · (1–p) > 9. Which does not apply for your example. Please correct me if I'm wrong – the last time I manually calculated such things is about 30 years ago. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Binary Outcome - Gamo - 04-07-2018, 08:49 AM
RE: (12C) Binary Outcome - Dieter - 04-07-2018 06:10 PM
RE: (12C) Binary Outcome - Gamo - 04-08-2018, 02:58 AM
RE: (12C) Binary Outcome - Dieter - 04-08-2018, 07:39 AM
RE: (12C) Binary Outcome - Dieter - 04-09-2018, 07:59 AM
RE: (12C) Binary Outcome - Gamo - 04-09-2018, 02:49 PM
RE: (12C) Binary Outcome - SlideRule - 04-09-2018, 03:51 PM



User(s) browsing this thread: 1 Guest(s)