Statalist


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

RE: st: mutiple if statements - thanks


From   "Rajesh Tharyan" <[email protected]>
To   <[email protected]>
Subject   RE: st: mutiple if statements - thanks
Date   Sun, 1 Jul 2007 16:41:43 +0100

Hi,

Thanks very much. These are not the original files but extracts from them ..
but now I have got the logic and the commands .. I can make the appropriate
changes..

Thanks very much indeed..

rajesh


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ulrich Kohler
Sent: 29 June 2007 22:33
To: [email protected]
Subject: Re: st: mutiple if statements
riate

------------------------------------------
// Append both files from the start
use file1,clear
gen file = 1
append using file2
replace file = 0 if file == .

// File 1
xtile xq1 = x if file, nq(5)
egen yq1 = xtile(y) if file, by(xq1) nq(5)

// File 2
pctile xcut = x if file, nq(5)
xtile xq2 = x if !file, cutpoints(xcut)
sort xq2
local xq2 = xq2[1]
pctile ycut = y if file & xq1 == `xq2', nq(5)
xtile yq2 = y if !file, cutpoints(ycut)

-------------------------------------------------


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