Dear community,
I am working on a panel data analysis, where I have to generate a treatment variable. The panel data only covers two waves of household data, one from 2019 and one from 2022.
The treatment variable should indicate that at least one household member was contracted with Covid-19. The problem is that my treatment dummy only indicates the value of one for the year 2022 but not for the same subject in 2019.
The commands I used so far are:
gen time = 1 if year==2022,
replace time = 0 if year==2019,
xtset QID time
gen treated= 1 if cov_infected_cov!=0,
replace treated = 0 if cov_infected_cov==0
I would be very thankful for any advice to fix this problem.
Best regards!
Related Posts with Generate treatment variables for panel data analysis
Graphing two continuous interactions in case of quadratic moderatorDear, First of all, I really thank you everyone here sparing no efforts to help the person like me.…
Stata Code transformed to R code -> is this possible?I am wondering, whether there is an option to transform the Stata code to a code in R programming la…
Syntax error in loop creationHi everyone, I am getting an error in the loop creation and cannot identify why. Any suggestions wo…
Running Stata on a server with multiple cpus to increase computing capacityI have Stata MP 2-core running on a laptop with 2.20GHz dual core cpu. When I run 2 do files my cpu …
why do oprobit command and bioprobit&CMP comand get opposite results?Hello everyone! I am new here and am very happy to come to STATALIST! I am working on my paper with …
Subscribe to:
Post Comments (Atom)
0 Response to Generate treatment variables for panel data analysis
Post a Comment