0

does anyone know the difference between

felm(Y~X1*X2+factor(f1), dfdata)
felm(Y~X1*X2|f1, dfdata)

I am getting NA for X2 in the case of felm(Y~X1*X2|f1, dfdata) but get a value when done the other way

r2evans
  • 141,215
  • 6
  • 77
  • 149
Siva
  • 1
  • 2
    Please make this question *reproducible*. This includes sample code (including listing non-base R packages), sample data (e.g., `dput(head(x))`), and expected output. Refs: https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. – r2evans Nov 30 '18 at 02:28
  • | pipe is used as an OR condition in R , problem you are facing is that you are telling that fit a linear model using independent variable x1*x2 or f1. that is causing the error. and in the 1st equation factor(f1) itself is an independent variable – Hunaidkhan Nov 30 '18 at 04:24
  • https://www.rdocumentation.org/packages/lfe/versions/2.8-2/topics/felm in this the documentation says we can use it this way – Siva Nov 30 '18 at 21:35

0 Answers0