Hello Stata community,
I'm trying to replicated the recent development in DiD literature developed by Callaway and Sant'Anna with IPUMS CPS dataset by cleaning the data on stata and running the command DiD on R ( since R is easy to run the DiD command and I need the graph and event study ). Problem is when I am running the R command it says the : Error in pre_process_did(yname = yname, tname = tname, idname = idname, : The value of idname must be the unique (by tname)
If anyone is familiar with CPS data then this is common knowledge that CPSID variable is the panel ID variable that identified a unique person and if anyone uses the ASEC variable then "most probably" the person's interview doesn't get repeated in the same year [ I could be wrong here, correct mew if I'm ].
So, the error message I'm getting on R "The value of idname must be the unique (by tname [ tname is year in my case ] ) , shouldn't be a problem in my case since as far as I know in ASEC CPS the same person's interview doesn't get related in same year , and therefore the error message "The value of idname must be the unique (by tname) " - shouldn't apply to my case.
So my questions to the community are :
1. Since according to my knowledge, there is no repepated observation of the same person in the same year of CPS ASEC ? Then why I'm getting the error message ?
2. And, If my idea is wrong about the reputation of the same person in ASE CPS , then on STATA how can I remove the related person based on the unique id ( CPSID ) variable ?
Will highly appreciate any kind response ! I'm attaching the R command so in case if anyone wants to see. The command is like the following and this is not my code , just a sample from internet :
I'm trying to replicated the recent development in DiD literature developed by Callaway and Sant'Anna with IPUMS CPS dataset by cleaning the data on stata and running the command DiD on R ( since R is easy to run the DiD command and I need the graph and event study ). Problem is when I am running the R command it says the : Error in pre_process_did(yname = yname, tname = tname, idname = idname, : The value of idname must be the unique (by tname)
If anyone is familiar with CPS data then this is common knowledge that CPSID variable is the panel ID variable that identified a unique person and if anyone uses the ASEC variable then "most probably" the person's interview doesn't get repeated in the same year [ I could be wrong here, correct mew if I'm ].
So, the error message I'm getting on R "The value of idname must be the unique (by tname [ tname is year in my case ] ) , shouldn't be a problem in my case since as far as I know in ASEC CPS the same person's interview doesn't get related in same year , and therefore the error message "The value of idname must be the unique (by tname) " - shouldn't apply to my case.
So my questions to the community are :
1. Since according to my knowledge, there is no repepated observation of the same person in the same year of CPS ASEC ? Then why I'm getting the error message ?
2. And, If my idea is wrong about the reputation of the same person in ASE CPS , then on STATA how can I remove the related person based on the unique id ( CPSID ) variable ?
Will highly appreciate any kind response ! I'm attaching the R command so in case if anyone wants to see. The command is like the following and this is not my code , just a sample from internet :
# Estimating the effect on log(homicide) | |
atts <- att_gt(yname = "l_homicide", # LHS variable | |
tname = "year", # time variable | |
idname = "sid", # id variable | |
gname = "effyear", # first treatment period variable | |
data = castle, # data | |
xformla = NULL, # no covariates | |
#xformla = ~ l_police, # with covariates | |
est_method = "dr", # "dr" is doubly robust. "ipw" is inverse probability weighting. "reg" is regression | |
control_group = "nevertreated", # set the comparison group which is either "nevertreated" or "notyettreated" | |
bstrap = TRUE, # if TRUE compute bootstrapped SE | |
biters = 1000, # number of bootstrap iterations | |
print_details = FALSE, # if TRUE, print detailed results | |
clustervars = "sid", # cluster level | |
panel = TRUE) # whether the data is panel or repeated cross-sectional |
Comment