Good afternoon, I'm working on my master thesis in Statistics at University of Bologna and I have a problem with my code. I have a dataset as shown in attachment.
I'd like to remove observation within each level of id, when the variable event[_n-1]==0.
For example, i'd like to get:
id event
1 1
1 1
1 0
2 1
2 1
2 1
2 0
and so on.
I tried so many options, but they never worked, I'd like to know if there is a solution.
Thanks a lot.
Anna
Related Posts with stata levelsof
xtivreg2 instrumental variables with endogenous variable involves in interaction termsHi all, I'm conducting analysis in the form below: Code: y = x1 + x2 + x3 + x1*x2 In which x1 is …
gmatch and psmatch2I am trying to conduct a logistic regression after propensity score matching. I tried both gmatch ps…
Add Optional t-test to Stata ProgramI have a stata program that displays a twoway bar graph and I want to add a t-test to the program, b…
esttabWhy is it when I enter the following command: "forvalues i = 1/5 { regress edge percentFRL ipr_se_v…
asreg : Updated 2021: new flexible window | Fastest rolling regressions in StataThanks to Kit Baum, the updated version of asreg is now available on the SSC. The new version is ver…
Subscribe to:
Post Comments (Atom)
0 Response to stata levelsof
Post a Comment