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
How to change the order of groups in catplot..., by() over() Dear all, I am trying to create a bargraph with two layers of categories(groups) using catplot. I w…
Application of syntax (svy) to cox regressionDear all: I have one question regarding application of syntax (svy) to cox regression. After using…
How to find out the number of children (<18 years) travelling with a given person for any specific place visited (Data provided)Hi everyone, Provided data is a one-day travel data already sorted according to sampn (household id…
Can't open this locationDear All, when executing a file picker from a custom-written dialog I am getting the following erro…
Forvalues loopHi, I am creating a loop that runs regression for the different industry-year groups. Why does it sh…
Subscribe to:
Post Comments (Atom)
0 Response to Generate treatment variables for panel data analysis
Post a Comment