Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Problems with statsby and collapse

From   Mario Veneziani <>
Subject   st: Problems with statsby and collapse
Date   Fri, 13 Apr 2012 19:37:24 +0200

Dear Users,

hope this mine finds you well indeed.

I am using the -statsby- and/or -collapse- command to create a
dataset, by "year" and "area", of the means of my variables in a more
detailed dataset.

It seems to me that the behaviour of the two commands is fairly
similar such that (roughly) the same result should be obtained.
Moreover, they are both very useful since they permit to avoid using
many loops to do the same job at hand.

Nonetheless, an odd thing happens which I would appreciate your feedback on.
In my resulting dataset a couple of "new" values for the "area"
variable appear while they are not present in the original dataset.
Moreover, one of the "new" values appears with frequency different
from 1.
This is something I cannot really explain and, moreover, I do not
understand while two very specific values of the variable "area"
should be created.

Has this happened to anybody else? Do you know the reason for this
strange occurrence?
The only reason I could think of is that, somehow, since I have
imported the data using STATA (and not STATTransfer) a number of
"stealth" observations have been pulled in and are considered when
running -statsby- and/or -collapse-. I might be totally off-tack
there, though so your contribution will be highly appreciated!

Thanks in advance, hoping to be able to give back to you,

Mario Veneziani
Research Assistant
Istituto di Economia Agroalimentare
Università Cattolica del Sacro Cuore
Piacenza, Italy

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index