Hello Statalist users,
I currently work on my master's thesis where I use Stata to conduct a Difference in Difference analysis. I have a large panel data set with multiple observations per entity ("id") over time ("monthly"). I'll try to estimate the DID estimator (i.post##i.treat) with entity-fixed and time-fixed effects later in an -xtreg- command, I'm not yet at this stage but it will look sth. like this:
xtreg y i.post##i.treat covariates i.monthly, fe vce(cluster id)
In order to generate an appropriate control group that holds the parallel trends assumption, I want to apply a Coarsened Exact Matching (CEM) on the pre-treatment period. However, weights must be constant within the panel variable (in my case "id") in order to use them in an -xtreg- command. I've already tried different things in order to keep weights constant within the panel variable, for example:
cem id(#0) score price reviews, treatment(treat) (#1)
cem id(1(1)36208) score price reviews, treatment(treat) (#2)
cem id(#1) score price reviews, treatment(treat) (#3)
However, nothing works (#2 and #3 come close, but still don't keep weights completely constant within the panel variable). Do you have any recommendations for me that I could try? Or is there another way to apply a difference-in-differences analysis with panel data and entity- and time-fixed effects other than -xtreg- (I don't want to use the -diff- command because it doesn't allow for the same range of postestimation options)?
I currently work on my master's thesis where I use Stata to conduct a Difference in Difference analysis. I have a large panel data set with multiple observations per entity ("id") over time ("monthly"). I'll try to estimate the DID estimator (i.post##i.treat) with entity-fixed and time-fixed effects later in an -xtreg- command, I'm not yet at this stage but it will look sth. like this:
xtreg y i.post##i.treat covariates i.monthly, fe vce(cluster id)
In order to generate an appropriate control group that holds the parallel trends assumption, I want to apply a Coarsened Exact Matching (CEM) on the pre-treatment period. However, weights must be constant within the panel variable (in my case "id") in order to use them in an -xtreg- command. I've already tried different things in order to keep weights constant within the panel variable, for example:
cem id(#0) score price reviews, treatment(treat) (#1)
cem id(1(1)36208) score price reviews, treatment(treat) (#2)
cem id(#1) score price reviews, treatment(treat) (#3)
However, nothing works (#2 and #3 come close, but still don't keep weights completely constant within the panel variable). Do you have any recommendations for me that I could try? Or is there another way to apply a difference-in-differences analysis with panel data and entity- and time-fixed effects other than -xtreg- (I don't want to use the -diff- command because it doesn't allow for the same range of postestimation options)?
Comment