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]
Re: st: Clustering by school year
From
Stas Kolenikov <[email protected]>
To
[email protected]
Subject
Re: st: Clustering by school year
Date
Sun, 24 Oct 2010 09:19:04 -0500
On Sat, Oct 23, 2010 at 9:39 PM, David Kantor <[email protected]> wrote:
>> Would clustering by school year be as simple as generating a variable
>> school_year = school identifier * year, and then using this new varialbe as
>> the cluster?
> P.S., there is another numeric-based solution: either,
> k1 * school_identifier + year
> or
> k2 * year + school_identifier
>
> where k1 or k2 are strategically chosen constants:
> k1 > max(year)
> k2 > max(school_identifier)
>
> One possibility is
> 10000 * school_identifier + year
This may run into numeric accuracy problems unless the type is
declared as -long-. A more natural solution is i.school##i.year in
terms of Stata factor variables, or old-fashioned xi: i.school*i.year.
--
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.
*
* 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/