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, is already up and running.

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

Re: st: Clustering by school year

From   Stas Kolenikov <>
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 <> 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 in
terms of Stata factor variables, or old-fashioned xi:*i.year.

Stas Kolenikov, also found at
Small print: I use this email account for mailing lists only.

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index