Hello,
I am trying to do a power calculation for an experiment involving taking repeated measurements from individuals at baseline and after two separate treatments. I have some data from 13 test individuals at baseline, and estimate that treatment 1 will reduce these numbers by 50% and treatment 2 will reduce them by only 25%. I would like to be able find the sample size that would allow me to detect these differences with 80% power.
My approach has been to construct test data for each treatment and use the power pairedmeans command:
g treatment1_sim = .5*baseline
g treatment2_sim = .75*baseline
summ treatment1_sim
local treatment1_mean = r(mean)
summ treatment2_sim
local treatment2_mean = r(mean)
summ baseline
local baseline_mean = r(mean)
** Sample size needed to detect difference between treatment1 and baseline
gen diff = baseline-treatment1
summ diff
local standard_dev = r(sd)
power pairedmeans `treatment1_mean' `baseline_mean', sddiff(`standard_dev') power(.8)
My problem is that no matter how much I toggle the effect of the treatments (.5 and .75 above), I always end up with the same estimated sample size:7. I am wondering if I am implementing the power pairedmeans command wrong or if this is an artifact of how I simulate the data. Currently, based on how I simulate the treatment test data, treatment and baseline test data have a correlation of 1, and I feel like this might be a problem.
The baseline test data I am using is:
baseline
48599
54468
152541
90670
53779
42763
24001
35478
23248
13477
37620
51388
23209
Any advice would be very much appreciated.
Thank you!
I am trying to do a power calculation for an experiment involving taking repeated measurements from individuals at baseline and after two separate treatments. I have some data from 13 test individuals at baseline, and estimate that treatment 1 will reduce these numbers by 50% and treatment 2 will reduce them by only 25%. I would like to be able find the sample size that would allow me to detect these differences with 80% power.
My approach has been to construct test data for each treatment and use the power pairedmeans command:
g treatment1_sim = .5*baseline
g treatment2_sim = .75*baseline
summ treatment1_sim
local treatment1_mean = r(mean)
summ treatment2_sim
local treatment2_mean = r(mean)
summ baseline
local baseline_mean = r(mean)
** Sample size needed to detect difference between treatment1 and baseline
gen diff = baseline-treatment1
summ diff
local standard_dev = r(sd)
power pairedmeans `treatment1_mean' `baseline_mean', sddiff(`standard_dev') power(.8)
My problem is that no matter how much I toggle the effect of the treatments (.5 and .75 above), I always end up with the same estimated sample size:7. I am wondering if I am implementing the power pairedmeans command wrong or if this is an artifact of how I simulate the data. Currently, based on how I simulate the treatment test data, treatment and baseline test data have a correlation of 1, and I feel like this might be a problem.
The baseline test data I am using is:
baseline
48599
54468
152541
90670
53779
42763
24001
35478
23248
13477
37620
51388
23209
Any advice would be very much appreciated.
Thank you!
Comment