Statalist The Stata Listserver

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

Re: st: Increase in observations

From   Maarten buis <>
Subject   Re: st: Increase in observations
Date   Sun, 18 Feb 2007 11:07:09 +0000 (GMT)

--- Renuka Metcalfe <> wrote:
> I want to bring "meanworkplacex1 by firm and
> occupations" and meanworkplacex2 by firm and
> occupations" from a matched employee and employer data
> to the same employer only data (which only comprises
> of about 2200). When I use the collapse command to
> bring 2 variables the observations increase to about
> 4660. I do not think the observations should increase
> to beyound about 2000. I would be grateful, if anyone
> could let me know, how I could bring the observations
> to less than 2200.

This seems to be a problem with your data and you do not give us the
exact commands you used, so it is very hard for us to solve this
problem. There are two things I can do given the information you have
given us: 1) remark that the by option in -collapse- assumes that a
missing value is also a level, this might increase the number of cases
to more then you expect, and 2) give you an example that works with
data that is available to everyone (with Stata):

*------------ begin example --------------
sysuse auto, clear
collapse (mean) price mpg if rep78 < ., by(rep78) 
*------------- end example --------------- 

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.* 
*   For searches and help try:

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