Hi Scott,

Do you think you might copy-paste the R code you’re running so we can get a handle on your syntax? The lm_lin syntax is a little different than R’s base OLS. In conventional OLS, any covariate you are regressing on is being treated the same (so a “control” covariate and the covariate of interest are mathematically doing the same thing). The Lin estimator begins by doing some processing on the pre-treatment covariates, and then after that separately estimates the treatment effect. Because this is the case, we have separate arguments for treatment and covariates so that we know which is which and don’t have to guess or potentially give you an estimate which may not be what you expect. You can check Lin 2012 if you want an in-depth statistical discussion of this, but in the mean time…

Checking the documentation in **estimatr**, I can see that the function definition for lm_lin is:

```
lm_lin(formula, covariates, data, weights, subset, clusters, se_type = NULL, ci = TRUE, alpha = 0.05, return_vcov = TRUE, try_cholesky = FALSE)
```

Where the arguments of interest here are:

*formula*: an object of class formula, as in lm, such as Y ~ Z with only one variable on the right-hand side, the treatment

*covariates*: a right-sided formula with pre-treatment covariates on the right hand side, such as ~ x1 + x2 + x3.

*data*: A data.frame

Note that here, as opposed to in R’s base lm, the covariates and the treatment are specified in separate arguments.

I used **estimatr**’s companion package **fabricatr** to generate some mock data for you to show an example. In this example, Ti is assignment to treatment, Xi is some covariate, and Yi is the dependent variable:

```
# Synthetic data
df = fabricate(N = 100, Ti = draw_binary(N, prob = 0.5), Xi = rnorm(N), Yi = 3 * Ti + rnorm(N))
# Base R OLS
lm(Yi ~ Ti + Xi, data = df)
# estimatr's lm_robust (robust standard errors built-in)
lm_robust(Yi ~ Ti + Xi, data = df)
# Lin estimator (be sure to specify pre-treatment covariates separately)
lm_lin(formula = Yi ~ Ti,
covariates = ~ Xi,
data = df)
# Of course we can also do this without argument names
lm_lin(Yi ~ Ti, ~ Xi, df)
```

I suspect what you did was something like this, which would give you an error:

```
lm_lin(Yi ~ Ti + Xi, data=df)
```

I’ll ping our package author on **estimatr** to let him know about your post, and also we can probably kick around a slightly better error message for when other users do this.

Best regards

Aaron Rudkin

Package author, fabricatr

DeclareDesign team