Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation issue: est.att.avg does not exist, is it rather est.avg #92

Open
MatthieuStigler opened this issue Sep 30, 2024 · 4 comments

Comments

@MatthieuStigler
Copy link

The documentation of gsynth mentions est.att.avg=inference for att.avg. but the slot does not exist!?

It seems it is instead called est.avg it is called?

gsynth/R/core.R

Line 2868 in 114fdce

est.avg <- t(as.matrix(c(att.avg, att.avg.j$se, att.avg.j$CI.l, att.avg.j$CI.u, att.avg.j$P)))

library(gsynth)
#> ## Syntax has been updated since v.1.2.0.
#> ## Comments and suggestions -> yiqingxu@stanford.edu.
data(gsynth)
out <- gsynth(Y ~ D + X1 + X2, data = simdata, parallel = FALSE, 
              index = c("id","time"), force = "two-way",
              CV = TRUE, r = c(0, 2), se = TRUE, inference ="parametric") 
#> Cross-validating ... 
#>  r = 0; sigma2 = 1.84865; IC = 1.02023; PC = 1.74458; MSPE = 2.37280
#>  r = 1; sigma2 = 1.51541; IC = 1.20588; PC = 1.99818; MSPE = 1.71743
#>  r = 2; sigma2 = 0.99737; IC = 1.16130; PC = 1.69046; MSPE = 1.14540
#> 
#>  r* = 2
#> 
#> Simulating errors .....Bootstrapping ...
#> ..
out$est.att.avg
#> NULL
out$est.avg
#>         Estimate     S.E. CI.lower CI.upper p.value
#> ATT.avg 5.543534 0.260916 5.032148  6.05492       0

Created on 2024-09-30 with reprex v2.1.1

@MatthieuStigler
Copy link
Author

it seems also Y.tr.cnt and Y.ct.cnt are mentioned in the doc, but not present in the data?

library(gsynth)
#> ## Syntax has been updated since v.1.2.0.
#> ## Comments and suggestions -> yiqingxu@stanford.edu.
data(gsynth)
out <- gsynth(Y ~ D + X1 + X2, data = simdata, parallel = FALSE, 
              index = c("id","time"), force = "two-way",
              CV = TRUE, r = c(0, 5), se = FALSE) 
#> Cross-validating ... 
#>  r = 0; sigma2 = 1.84865; IC = 1.02023; PC = 1.74458; MSPE = 2.37280
#>  r = 1; sigma2 = 1.51541; IC = 1.20588; PC = 1.99818; MSPE = 1.71743
#>  r = 2; sigma2 = 0.99737; IC = 1.16130; PC = 1.69046; MSPE = 1.14540*
#>  r = 3; sigma2 = 0.94664; IC = 1.47216; PC = 1.96215; MSPE = 1.15032
#>  r = 4; sigma2 = 0.89411; IC = 1.76745; PC = 2.19241; MSPE = 1.21397
#>  r = 5; sigma2 = 0.85060; IC = 2.05928; PC = 2.40964; MSPE = 1.23876
#> 
#>  r* = 2
"Y.tr.cnt" %in% names(out)
#> [1] FALSE
"Y.ct.cnt" %in% names(out)
#> [1] FALSE

Created on 2024-10-07 with reprex v2.1.1

@xuyiqing
Copy link
Owner

xuyiqing commented Oct 8, 2024 via email

@MatthieuStigler
Copy link
Author

Hi

This is just a reprex using the default simdata, so should be easy to diagnose?

Ok, are you saying Y.tr.cnt is only present when the data is centered/has X? If so, might be worth mentioning it in the doc?

Thank a lot!

@MatthieuStigler
Copy link
Author

also, interesting to hear about fect. Do you have a page discussing the migration (i.e. advantages/differences of fect vs gsynth, timeline of migration, etc)? If fect is mature, it might be good to ope an issue on gsynth redicreting users to fect? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants