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
How to make duplications/ repetitions of observationsHello, I am working with some data on children (siblings) from various households from an Indian pa…
Modifying significant digits of the graph's y-axis increments on Stata graph editorHi, I'm trying to edit a graph's y-axis increments on Stata graph editor. For example, the y-axis i…
Predicting firm growth (panel data)Hi, Statalist. 1. Our task/problem I’m trying to predict if a startup will grow continuously for t…
Disaggregation with inequal7 functionHello, I am working with income dataset for household level and calculating GINI index with inequal…
An immediate histogram command?(Cross-posted from the v17 wishlist, https://www.statalist.org/forums/for...72#post1601072, at the s…
Subscribe to:
Post Comments (Atom)
0 Response to stata levelsof
Post a Comment