BookmarkSubscribeRSS Feed
t75wez1
Pyrite | Level 9

Hello,

I have a weekly product sale in EQ in time series data(total 88 weeks) with mean=15,000 and standard deviation=2,500.

 

I’m working on producing a matrix of confidence intervals and “power” analysis to determine what % lift (e.g. 5% or 6%) of sale do I need to observe to be confident the lift is statistically significant between the two test/control market pairs I identified. 

 

The goal is to have a X%(e.g. 95%) power chance of obtaining a Y%(e.g. 90%) confidence interval whose half-width is at most from Z%(5% or 6%) lift of eq sales for next 26 weeks.

 

I need to complete this matrix below that will look something like this:

I've tried to use the code below but don't know how to set up the parameters in "proc power".

 

Can someone shed some lights here?

  

Thanks so much for your help in advance.

 

t75wez1_0-1728097723473.png

 

 

 

ODS Output PlotContent = want;
proc power;
onesamplemeans ci=t
SIDES=2
alpha = 0.05 ,0.1
halfwidth = 750 to 1500 by 150
stddev = 2500
probwidth =.
ntotal = 8;
plot x=effect min=500 max=3000
XOPTS=( REF=1500 2000 2200 2500 CROSSREF=YES);
run;

 

4 REPLIES 4
Ksharp
Super User

It looks like you are doing Superiority Test. Check example:

Ksharp_0-1728111681115.png

 

Ksharp_1-1728111969582.png

 

t75wez1
Pyrite | Level 9

Thanks so much for your prompt response.

 

Still can't figure out how to set up "groupns" in the example you mentioned to complete the power analysis in my case.

I have the weekly product sale in EQ in time series data(total 88 weeks) for the test group with mean=15,000, standard deviation=2,500 cv=16.42 and the control group with mean=38,856 and standard deviation=4,700, cv=16.54.

 

Should I use "groupns=(88 88)" in below?

 

Thanks again for your insight.

 

 

 

***********************************************************

proc power;

   twosamplemeans test=ratio

      meanratio = 0.7 to 1.2 by 0.1

      nullratio = 1.10

      sides     = L

      alpha     = 0.01

      cv        = 0.5 0.6

      groupns   = (300 180)

      power     = .;

   plot x=effect step=0.05;

run;

 

Ksharp
Super User

I think you need side=U to do Superiority Test if SALE is bigger is better. 

Ksharp_1-1728183446264.png

 

proc power;
ods output output=powdata;
   twosamplemeans  test=diff
      sides     = U      /*Superiority Test(upper one-size) --> Assuming SALE is bigger is better. */
      alpha     = 0.05 to 0.25 by 0.05  /*obtaining a Y%(95% 90% 85% 80% 75%) confidence interval*/
      groupns   = (88 88)  
	  stddev=3500   /* std of 176(=88+88) obs*/
      power     = 0.75 to 0.95 by 0.05
	  meandiff  = .;
run;

 %powtable (
Data = powdata,
Entries = meandiff,
Cols = alpha,
Rows = power
)

Ksharp_0-1728183327203.png

 

t75wez1
Pyrite | Level 9

Ksharp,

Thank Ksharp very much for the code with explanation and so much gleeful to have such a supportive environment. 

However, I have 3 questions below:

1)What mathematical formula do you use to calculate the stddev=3500?

 stddev=3500   /* std of 176(=88+88) obs*/

2)How to download the %powtable to see the detailed SAS macro code?

3)Is it possible to export power table result from %powtable into Excel file?

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 138 views
  • 0 likes
  • 2 in conversation