Open rondobohrens opened 1 month ago
I think we found the root cause for this. The default value for the tolerancetol
is different.
In R, it is 0.001
and in Stata it is 0.00001
.
We started to see very close agreements with R and Stata when we set 1e-6
.
We lost a bit of sanity along the way - but I think it would be good to set those values equal in both languages.
Thank you for this great package!
I am currently collaborating with a coauthor on a project involving Matrix Completion (MC). I work in R, and he works in Stata. We are trying to reproduce results across both languages, but fail to do so.
Using the simulation data and examples you provide here under Matrix Completion (MC), I am able to reproduce your exact results.
out.mc <- fect(Y ~ D + X1 + X2, data = simdata, index = c("id","time"), force = "two-way", method = "mc", CV = TRUE, se = TRUE, nboots = 200, parallel = TRUE)
However, trying to run this in Stata, we get a different ATT estimate, but the same results for covariates.
produces
If we force them to use the exact same optimal lambda (as identified in R, lambda.cv = 0.002334298), we still get different estimates for the main effect.
I can produce the example in Stata provided here without any issues.
Can you provide us with any pointers to why this is?