# How to obtain a power curve from a likelihood ratio test for linear regression as a function of varying a coefficient of the more complex model?

I am currently doing a test of model complexities for two linear regression models:

First Model:

$$Y = \beta_0 + \beta_1X_1 + \beta_2X_2 + \epsilon$$

vs.

Second Model:

$$Y = \beta_0 + \beta_1X_1 + \epsilon$$

and am using the lrtest function in R to do it. I would like to draw a power curve where the x-axis varies the values of $$\beta_2$$. The y-axis would report the power of the test at each value of $$\beta_2$$. Power is defined as the probability of rejecting the null when the null is false with the null being that the two models are the same.

I am wondering how I might be able to do such a test and if it can be done using the lrtest function.

## 1 Answer

Maybe you can follow my idea presented here Power Analysis for a mixed two-way ANOVA with unqual sample sizes.

You need to generate the data according to the first model.

Need to specify the following: 1) sample size, 2)$$\beta_0$$ and $$\beta_1$$, 3)$$Var(\epsilon)$$, 4)structure of $$X_1$$ and $$X_2$$, especially their correlation, and 5)$$\alpha$$ level.

Of course, you need the several different values of $$β_2$$ for x-axis.