BookmarkSubscribeRSS Feed
Mgarret
Obsidian | Level 7

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!

9 REPLIES 9
SteveDenham
Jade | Level 19

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

Mgarret
Obsidian | Level 7

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!

SteveDenham
Jade | Level 19

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

Mgarret
Obsidian | Level 7

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. 

SteveDenham
Jade | Level 19

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

Mgarret
Obsidian | Level 7

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

SteveDenham
Jade | Level 19

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

Steve Denham

Mgarret
Obsidian | Level 7

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

SteveDenham
Jade | Level 19

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 2675 views
  • 6 likes
  • 2 in conversation