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

st: listing multiple info with the by command

From   "Robert Bozick" <>
To   <>
Subject   st: listing multiple info with the by command
Date   Wed, 30 Jul 2003 10:52:01 -0400

Good morning/afternoon listers -

I working on a project with clustered data (students within schools).  I need to write a program that produces output that I can distribute back to the individual schools to inform them about discrepancies in the data they provided.

The variables I am working with are:
schoolid = school level id
stuid = student id (social security #)
discrep1....discrep5 = dummy variables coded 1 if there is discrepant information on certain items  

Here is what I want to do:
I want to create a program that lists out student ids for each discrepant indicator that is coded 1.  

I know that I can write a simple command like:
by schoolid: list stuid if discrep1 == 1

Two questions:
(1) How do I write the program so that I can incorporate all discrep variables before moving to the next schoolid (i.e. so that it will list all student ids when discrep == 1, then when discrep2 == 1, etc. before moving onto the next school)

(2) Is there a command that I include to tell STATA to make a page break between each school's id so that I can have a separate report for each school that lists out all the student ids for each 'discrepant' variable?   

*   For searches and help try:

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