Statalist The Stata Listserver


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

st: Issue with edit and if condition


From   "Nuno Soares" <[email protected]>
To   <[email protected]>
Subject   st: Issue with edit and if condition
Date   Wed, 9 Aug 2006 11:53:49 +0100

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/



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