Hi Stata folks,
I've asked this question before, and am still struggling to find the right stata code (https://www.statalist.org/forums/for...nd-sample-size). I find power and sample size calculations hard to understand in Stata. I'm trying to estimate power to see a difference across groups, given a set sample size, for a proposal we're writing.
I have a hypothetical 200-person cohort, with a binary outcome (which I'll call "disease", it's yes/no) that affects 50% of my cohort (i.e., 100 are "disease=yes", 100 are "disease=no"). I have another binary variable in my cohort, for the sake of argument, we'll call this age. I'll assume the age groups are similar in size (i.e., 100 young and 100 old). What code would you recommend to allow me to see what statistical power we have to see a difference in my yes/no outcome when comparing young to old?
For the sake of argument, what's our power if, in our data, the difference is 10% (i.e., 45% of youngsters have the disease, while 55% of elders have the disease).
How could I graph the power, if we assume the difference is 20%, 15%, 10%, or 5%?
How might this change if I set the binary outcome to a prevalence of 40%? 60%?
Thanks in advance!
I've asked this question before, and am still struggling to find the right stata code (https://www.statalist.org/forums/for...nd-sample-size). I find power and sample size calculations hard to understand in Stata. I'm trying to estimate power to see a difference across groups, given a set sample size, for a proposal we're writing.
I have a hypothetical 200-person cohort, with a binary outcome (which I'll call "disease", it's yes/no) that affects 50% of my cohort (i.e., 100 are "disease=yes", 100 are "disease=no"). I have another binary variable in my cohort, for the sake of argument, we'll call this age. I'll assume the age groups are similar in size (i.e., 100 young and 100 old). What code would you recommend to allow me to see what statistical power we have to see a difference in my yes/no outcome when comparing young to old?
For the sake of argument, what's our power if, in our data, the difference is 10% (i.e., 45% of youngsters have the disease, while 55% of elders have the disease).
How could I graph the power, if we assume the difference is 20%, 15%, 10%, or 5%?
How might this change if I set the binary outcome to a prevalence of 40%? 60%?
Thanks in advance!
Comment