Hi all,
So I have a list that can take any of three values, 1, 2, 3. I want to create another variable that lists the value that has come up least recently. An example of how this will look is:
VAR1 LeastRecent
3 .
1 .
2 2
1 3
2 3
3 3
3 1
2 1
1 1
So far to do this I have created an intermittent variable that does not have repeats, with the idea that I would be able to check the previous two non missing values and list out the value not specified. I am hoping for some advice on an approach to have Stata check a variable for the previous non-missing values.
Many Thanks,
Cydney
So I have a list that can take any of three values, 1, 2, 3. I want to create another variable that lists the value that has come up least recently. An example of how this will look is:
VAR1 LeastRecent
3 .
1 .
2 2
1 3
2 3
3 3
3 1
2 1
1 1
So far to do this I have created an intermittent variable that does not have repeats, with the idea that I would be able to check the previous two non missing values and list out the value not specified. I am hoping for some advice on an approach to have Stata check a variable for the previous non-missing values.
Many Thanks,
Cydney
Comment