DeclareDesign / estimatr

estimatr: Fast Estimators for Design-Based Inference
https://declaredesign.org/r/estimatr
Other
131 stars 20 forks source link

starprep doesn't work with logged dependent variable #399

Open ghost opened 2 years ago

ghost commented 2 years ago

If you take the example from the documentation and add log() around variables, it works fine with logs around the regressors but will not work with a log around the dependent variable. E.g. lm1 <- lm(mpg ~ log(hp), data = mtcars) works but lm1 <- lm( log(mpg) ~ log(hp), data = mtcars) will give the error

Error in names(object) <- nm : 
  'names' attribute [2] must be the same length as the vector [1]