Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Select observations within variable

From   "Austin Nichols" <>
Subject   Re: st: Select observations within variable
Date   Mon, 26 Feb 2007 16:35:16 -0500

Like so?
bys i (t): gen red2=sum(x<x[_n-1] & _n>1)>0

On 2/26/07, Nikolaos Kanellopoulos <> wrote:
I have a very common panel data set. i is my individual identifier, t my
time variable and x is a categorical variable. I want to create a variable
that will be 1  for all the observations of the same individual after x is
reduced. ie I want to identify all the observations for the same individual
after a reduction on x has taken place. Note that a reduction does not
happen to all individuals.
*   For searches and help try:

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