Statalist The Stata Listserver

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

st: RE: Issue with edit and if condition

From   "Kallimanis, Bellinda" <>
To   <>
Subject   st: RE: Issue with edit and if condition
Date   Wed, 9 Aug 2006 14:24:02 -0400

Hi Nuno, 

When you say the editor shows you 198290 observations when you ask it to
show only observations where _merge equals 1 are you looking at the
numbers in the grey column? Because if you are this will not tell you
how many observations you are looking at but just which ones you are
looking... if you were to actually count them I think you'll find that
you have only 7920.
One way to tell without counting them all is to see if your numbers in
that grey bar skip numbers. 



-----Original Message-----
[] On Behalf Of Nuno Soares
Sent: Wednesday, August 09, 2006 6:54 AM
Subject: st: Issue with edit and if condition

Hi Statalisters,

I'm having a problem with the way Stata presents the observations with
-edit- command. I have database with 198290 observations and more than
variables, which is the outcome of merging two databases. By using the
-merge- command to merge two data files, Stata includes a new variables
_merge. In my case, this variable yields the values of 1 and 3 (using
tabstat stat fye__merge, statistics( count ) by(fye__merge)
columns(variables) ):

fye__merge	fye__m~e
1	7290
3	191000
Total	198290

The issue is the following: when I use the -edit permno if
command to visualize the observations that meet the condition _merge==1
(fye__merge is the rename of _merge), Stata shows ALL the 198290
observations, when it should return only the 7290 observations. The same
occurs when -edit permno if fye__merge==3- but in this case it is
to return 191000 but instead it returns 198231 observations (?!).
However, if I delete the observations (drop if fye__merge==1 or drop if
fye__merge==3 ) the number of observations reported with tabstat command
Has anyone noticed such a weird behaviour?
I'm using Stata 9.2, completely updated, WinXP Pro, 1.5GB RAM, Centrino


*   For searches and help try:

*   For searches and help try:

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