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" <[email protected]>
To   <[email protected]>
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. 

HTH

Bellinda



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

Hi Statalisters,

I'm having a problem with the way Stata presents the observations with
the
-edit- command. I have database with 198290 observations and more than
300
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
fye__merge==1-
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
expected
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
are
deleted.
Has anyone noticed such a weird behaviour?
I'm using Stata 9.2, completely updated, WinXP Pro, 1.5GB RAM, Centrino
1.7Ghz.

Best,

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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