turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Calculating Control and Test Samples Using One Pro...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-19-2014 01:55 PM

HI all. I am trying to figure out how to write code which will calculate control and sample sizes based off one group of direct market response rates. So, I have a list which looks like this:

Response Rate

0.647% |

2.735% |

1.778% |

0.252% |

1.577% |

0.061% |

0.354% |

0.374% |

0.250% |

0.192% |

0.364% |

0.801% |

0.674% |

1.461% |

0.315% |

0.468% |

1.737% |

0.207% |

0.162% |

0.378% |

2.439% |

0.400% |

2.305% |

0.929% |

0.497% |

1.806% |

I know how to do this using two group proportions:

proc power;

TwoSampleFreq

Test=Fisher

Dist= Exact_Cond

Method=Walters

Alpha = 0.05

Sides = 2

GroupProportions = p1 p2

Power = 0.8

NTotal = .

;run;

But How would I modify this program so as one to use just one group in order to generate control and test samples.

Any assistance is greatly appreciated!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Mgarret

02-20-2014 01:04 PM

If you need to generate two groups' sample size (control and test), then you need to use the two group proportions method, with some minor changes. First, assume that your control group has a specified proportion, and that your test group may have certain other values. Second, replace NTotal = . with Npergroup = .;

This should give what you need unless I am severely misunderstanding something.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

02-20-2014 02:23 PM

**Hi Steve--**

**Thank you so much for getting back to me. **

**What I am trying to do is calculate sample sizes for A/B testing. So if I have a creative test response rate from a previous experiment of .00023 what is the test and control sample size of a new A/B test ? Or if I have two groups one with an average response rate of .00291 and one 00208 what is the test and control sample size of a new A/B test?**

**Any additional feedback is greatly appreciated! **

**Is this the correct syntax for two groups? **

**proc power;**

** TwoSampleFreq **

** Test=Fisher **

** Dist= Exact_Cond **

** Method=Walters**

** Alpha = 0.05**

** Sides = 2**

** GroupProportions = ( .00291 .00208 )**

** Power = 0.8**

** Npergroup = .**

** ;run; **

Thanks you!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Mgarret

02-21-2014 07:46 AM

The syntax is fine. When I run, I get 58718 per group, which looks about right given that you want to detect a difference of 0.00083.

As far as detecting a difference from 0.00023 (first scenario), the question is "how big of a difference do you want to detect?" When you know that, then it is just a matter of plugging in that value.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

03-04-2014 05:54 PM

Hi Steve--

Lets say I want a lift of 15% from the previous response rate of 0.00023 ? I can't figure out how to write the syntax for that.

Any feedback is appreciated.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Mgarret

03-05-2014 08:51 AM

Different terminology for different fields, but if you mean to compare 0.00023 to 1.15 * 0.00023 (which is how I would interpret a 15% lift), then it is just a matter of putting in those two values:

**proc power;**

** TwoSampleFreq **

** Test=Fisher **

** Dist= Exact_Cond **

** Method=Walters**

** Alpha = 0.05**

** Sides = 2**

** GroupProportions = ( .00023 **** .002645 )**

** Power = 0.8**

** Npergroup = .**

** ;run; **

This gives an N per group of 3990.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

03-05-2014 09:44 AM

Great that make sense. Last just question: why are you using a 2 sided model as opposed to 1 sided?? Thanks!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Mgarret

03-05-2014 09:54 AM

My mistake. Change to Sides = 1 in the above code, and get 3330 per group.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

03-05-2014 09:58 AM

Great - But real quick why do you feel the one sided approach is the way to go?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Mgarret

03-05-2014 10:10 AM

I assume that you are only interested in a positive response--a decrement of 15% either isn't possible or isn't important to what you are doing. If it were, I figure you would have said something along the lines of a "change of 15%" rather than a lift of 15%.

Steve Denham