[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
[no subject]
------------------------------------------
// 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/
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |