Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Bysort on non-selection variables

From   "Deborah Garvey" <[email protected]>
To   <[email protected]>
Subject   st: Bysort on non-selection variables
Date   Mon, 18 Jul 2005 16:08:11 -0700

Hello, all.

I have data with a household identifier (serial) and a person locator within each household (pernum).

Is there any way to maintain a sort order of PERNUM within SERIAL, i.e., the results of a command like -sort serial pernum-  for a -bysort- that is sorted on a within-household indicator variable, i.e. -bysort serial (indicatorvar): several expressions to condition the value of a PERNUM-level variable-

My question may seem odd, but the person's location in the household is an important criterion for determining the indicator variable's value. Unfortunately, the value of the indicator variable may be the same for more than one person in the household, so I can't use -bysort serial pernum (indicatorvar):  stuff-

As always, any help is greatly appreciated.


Deborah Garvey 

Deborah Garvey, Ph.D.
Department of Economics
Kenna Hall
Santa Clara University
Santa Clara, CA  95053
408/554-2331 (FAX)
[email protected]

This message scanned for viruses and SPAM at SCU (MGW2)

*   For searches and help try:

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