# Linear probability model with fixed effects?

If I want to estimate a linear probability model with (region) fixed effects, is that the same as just running a fixed effects regression? Maybe I'm getting tripped up with the language and whether I should be using the lm or plm R packages.

My goal is to estimate the effect of a baby bonus. My dependent variable is a binary indicator for NEWBORN and my main independent variable of interest is an indicator for receiving the baby bonus. I control for age, age squared, education, marital status, and household income.

1) ## Linear Probability

LPM <- lm(newborn ~ treatment + age + age_sq + highest_education + marital_stat + hh_income_log, data = fertility_15_45) # how do I add FE to a lm model in R?

2) ## FE Model

FE_model <- plm(newborn ~ treatment + age + age_sq + highest_education + marital_stat + hh_income_log, data = fertility_15_45, index = "region", model = "within")

• Welcome! Technically, you can use both. What did you notice when you inspected the coefficients? Commented Apr 24, 2020 at 3:12
• Same question here (with an answer): stackoverflow.com/questions/61399938/… Commented Apr 24, 2020 at 7:29
• Why do you want to use linear probability model rather than something more reasonable like logistic regression? Linear model does not give any guarantees for the predictions to make sense (be between 0 and 1).
– Tim
Commented Feb 9, 2022 at 10:19
• In agreement with @Tim, you will find very significant lack of fit if you use a linear model for binary Y. Commented Feb 9, 2022 at 12:14

As indicated in the comments, the answer on Stack Overflow demonstrates, explicitly, that your coefficients are identical. I will offer some further intuition.

If I want to estimate a linear probability model with (region) fixed effects, is that the same as just running a fixed effects regression?

Yes. The plm() function is a panel data estimator. Technically, it runs lm() on your transformed data. Typically, when students learn about "fixed effects" for the first time, they learn that it is a deviation from a "within-group" time mean. Later, they come across some empirical specification in a paper and observe a parameter in a model—estimated via least squares—that is unit-subscripted, such as $$\gamma_s$$ (i.e., state effect) or $$\gamma_r$$ (i.e., region effect), and they ask if this is equivalent to performing a fixed effects regression. It is.

The plm() function with index = "region" and model = "within" will return the same coefficients as your lm() function with as.factor(region) included as a covariate. In R, as.factor() creates a series of dummy variables for your regions. You can think of this as each region getting its own unique intercept.

In sum, treating your "region effects" as parameters to be estimated is algebraically equivalent to estimation in deviations from means. The boilerplate code below will result in identical coefficients on your treatment dummy (i.e., baby bonus).

# --- The Least Squares Dummy Variable Estimator

lm(outcome ~ treatment + ... + as.factor(region), data = ...)

# --- The Fixed Effects (Within-Group) Estimator

plm(outcome ~ treatment + ... , index = "region", model = "within", data = ...)


I hope this helps your intuition.

• This is very helpful in clearing up my confusion, thanks Thomas! Commented Apr 24, 2020 at 21:31
• No problem at all. If it cleared things up then give it a check. If not, follow-up here. Commented Apr 24, 2020 at 23:24