Consider a simple linear regression of the form: $$ Y \sim \beta_0 + \beta_1 X + \beta_2 Z + \epsilon$$
I have questions regarding calculation of power for $\beta_1$. To calculate power, I approached this via simulation and I did:
- Simulate data with true $\beta$'s as: $\beta_0 = 0.5, \beta_1 = 1, \beta_2 = 2$
- I also assumed $x \sim N(0,1)$ and $\epsilon \sim N(0, 0.1)$ and Z is binary variable
- I put this data simulation into a loop and in each iteration, I fit a linear regression.
- My understanding of power is that since we knew $\beta_1 \ne 0$, so power is rejecting the null hypothesis so in order to calculate power, it's enough to see how many times in our simulation we got a p.value less than 0.05 for $\beta_1$. Is that a correct way of calculating power?
Thanks very much for your help,