Statalist


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

st: RE: Is it necessary to sort data before using -cf-?


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Is it necessary to sort data before using -cf-?
Date   Sun, 29 Nov 2009 11:04:35 +0100

<>

You can obtain the -sort- order of a dataset on disk from


*******
describe using "C:\Users\martin\Documents\Stata\new.dta", short varlist
di in r "`r(sortlist)'"
*******

Put your own path in between the quotation marks...

HTH
Martin


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of gjhxmu@sina.com
Sent: Sonntag, 29. November 2009 10:36
To: statalist
Subject: st: Is it necessary to sort data before using -cf-? 

Dear statalists,

Is it necessary to sort data before using -cf-? 
Without sorting, I found two same datasets are reported difference. However,
I found no reference in -help cf-.
If necessary, how to determine the sorted variable(s) if I compare all the
variables or certain variables?
Does the sorted variable need to have no duplicates?

For example,

. sysuse auto,clear
(1978 Automobile Data)

. sort turn

. save new,replace
file new.dta saved

. sysuse auto,clear
(1978 Automobile Data)

. sort rep78

. cf _all using new
            make:  74 mismatches
           price:  74 mismatches
             mpg:  69 mismatches
           rep78:  63 mismatches
        headroom:  64 mismatches
           trunk:  72 mismatches
          weight:  73 mismatches
          length:  73 mismatches
            turn:  71 mismatches
    displacement:  72 mismatches
      gear_ratio:  72 mismatches
         foreign:  42 mismatches
r(9);

. 
Could anyone help me? Thank you.


Best regards,
Rose


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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