Hi,

We are running two-way fixed effects on R and Stata using the same data, and they are giving different results. The coefficients are not only different but the sign is opposite as well.

In R, the command we're using is:
Code:
feols(log(income) ~ treat + var1 + var2 + var3 | state + year, data=df)
In Stata, the command we're using is:
Code:
twfe log_income treat var1 var2 var3, ids(state year) cluster(state)
The data we're using is the same. Are the two lines of code equivalent in the respective programs or are they different?

Thank you!