Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: xtile command for calculating tertiles


From   "Weichle, Thomas" <Thomas.Weichle@va.gov>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: xtile command for calculating tertiles
Date   Fri, 22 Oct 2010 16:37:15 -0500

Hi Statalisters,
Can anyone comment on the difference between the way Stata's -xtile-
command creates tertiles compared to the way the SAS -proc rank- creates
tertiles? And the differences in which ties are handled?  The following
are the code I'm using and I am getting slightly different results.  My
data do contain ties and I think this is the issue.

Stata:
xtile tertile = opcd, nquantiles(3)

SAS:
proc rank data = test out = ranks groups = 3;
	var opcd;
	ranks opcd_tert;
	run;

Tom Weichle
Math Statistician
Center for Management of Complex Chronic Care (CMC3)
Hines VA Hospital, Bldg 1, C202
708-202-8387 ext. 24261
Thomas.Weichle@va.gov 

*
*   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   |   Site index