Hello everyone,

I hope I could use your help with the command twoway lfit.

I am estimating the following model:

where y and m are two continuous variables, d is a binary indicator =1 if m>0 (0 otherwise), d*m is an interaction term and X includes several covariates.

I run the following command to get the graph of the regression line:

but I believe lfit is graphing the regression line from the model without controls. Is there a way to tell lfit to take into account the covariates? I tried the alternative command binscatter but it didn't really capture the exact relation between y and m I have estimated.

Regards,

Egidio

I hope I could use your help with the command twoway lfit.

I am estimating the following model:

**reg y m d d*m X**where y and m are two continuous variables, d is a binary indicator =1 if m>0 (0 otherwise), d*m is an interaction term and X includes several covariates.

I run the following command to get the graph of the regression line:

**two (scatter y m if !d) (scatter y m if d) (lfit y m if !d) (lfit y m if d)**but I believe lfit is graphing the regression line from the model without controls. Is there a way to tell lfit to take into account the covariates? I tried the alternative command binscatter but it didn't really capture the exact relation between y and m I have estimated.

Regards,

Egidio

## Comment