# Causal inference using regression for multiple covariates

I am reading lot of material regarding Causal Inference using Regression Analysis but I am unable to resolve my doubt.

Suppose I have a data with Outcome Y, Treatment Tr and covariates X1, X2, X3, X4, ....

I need to find Average Treatment Effect using Regression Analysis for my data. with three model.

First with only outcome and treatment

model1-> lm(Y~Tr, data)


Second with outcome, treatment, and covariates

model2-> lm(Y~Tr+X1+X2+X3+X4+...., data)


Third with outcome, treatment, covariates and Interaction between covariates and treatment

model3-> lm(Y~Tr+X1+X2+X3+X4+....+X1*Tr + X2*Tr + X3*Tr + X4*Tr +......, data)


I know for model1 Average treatment effect(ATE) is coefficient of Tr in the model1. For model2 I think ATE is still coefficient of Tr in the model2. But I am not sure. I am really confused what will be the ATE in our third model i.e. model3

• For model3 you would have to integrate over all covariates, aka marginalise. (That's what package effects does internally.) If the covariates are uncorrelated with treatment, model1 should give you the same answer. – Carsten Apr 3 at 12:08
• @Carsten What about model2? – Priyanka Tiwari Apr 3 at 15:11

For the model 3 ATE will be the following

ATE =  beta0 + beta1*X1 + beta2*X2 + beta3*X3 + beta4*X4 + ...........


For model 2, the coefficient on Tr does correspond to the ATE. For model 3, Tr is the ATE only when each covariate is centered at its mean. This straightforward for continuous variables, but for binary variables or interactions it can be tough to do this in an lm() statement.

To get the ATE, you can use the margins() function in the margins package. You can run

summary(margins(model3, variables = "Tr"))


to get the estimate and standard error of the ATE.