Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Logical condition


From   Dmitriy Krichevskiy <[email protected]>
To   statalist <[email protected]>
Subject   st: Logical condition
Date   Wed, 14 Oct 2009 16:09:47 -0400

Dear Listers,

I have a large panel dataset for which I was hoping to analyze a
particular subset of agents. More specifically:

id time b1 i1
1   1     1   3
1   2     1   4
1   3     0   2
2   1     0   5
2   2     1   6
2   3     0   4
3   1     0   2
3   2     1   3
3   3     1   1
I want to select only those agents from above example who have
switched their b1 status from 0 to 1 in the first two periods (agents
2 and 3 above). I want to see what happened to their b1 status since
then, more specifically I want to see how future change in status of
b1 (back to 0) has reflected on other variables (agent 2 here changes
back to 0, and he now has a value of 4 in i1 variable whereas he
started with i1=5 before his b1 status has changed). Unfortunately
every condition I try to set up drops all observations since b1=0 and
b1=1 are mutually exclusive even though I am looking at different time
periods.

I hope the above makes sense; and, as always, thanks for your help.
Dmitriy
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index