Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: serpentine sorting
From
Viktor Emonds <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: serpentine sorting
Date
Tue, 11 Oct 2011 13:36:25 +0200
Dear all,
I am working on the construction of proper sampling frames for a research on the learning trajectories of minority and majority children in schools in Flanders. The target group are 3rd year students and we will select school establishments to conduct our study.
Core variables of interest are the proportion of minority students in the 3rd year within an establishment (pforeign3), an implicit stratifier for educational tracks (typestrat), number of students (in quartiles) in the 3rd year in an establishment (studstrat), an implicit school net stratifier, an implicit dummy stratifier for high.low proportion of Turks in the region and a 4-category explicit stratifier on proportion of minority students in year 3 in the establishments (based on pforeignj3).
The idea is to create 4 sampling frames, one for each value of the explicit stratifier, and within each frame, sort on the implicit stratifiers (so we get nested sorting). At the lowest nesting level (in this case student size), we want to use the serpentine method and sort pforeignj3 ascending and descending in an alternating way over the values of studstrat. Unfortunately, gsort does not allow if commands, so something like gsort with - and + on even or odd values of studstrat doesn't work.
I tried sorting everything separately for each ethstrat-studstrat combination and then appending per ethnic stratum, but obviously, it doesn't work, because the nested sorting of the implciit stratifiers is disrupted and studstrat efefctively becomes a top-level stratifier. Any ideas on how to solve this? Thanks in advance!
Best,
Viktor
*
* 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/