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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Generating clustered data


From   John Antonakis <John.Antonakis@unil.ch>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Generating clustered data
Date   Tue, 17 May 2011 10:34:48 +0200

Thanks Stas! I must have missed that one.

Best,
J.

__________________________________________

Prof. John Antonakis
Faculty of Business and Economics
Department of Organizational Behavior
University of Lausanne
Internef #618
CH-1015 Lausanne-Dorigny
Switzerland
Tel ++41 (0)21 692-3438
Fax ++41 (0)21 692-3305
http://www.hec.unil.ch/people/jantonakis

Associate Editor
The Leadership Quarterly
__________________________________________


On 17.05.2011 03:50, Stas Kolenikov wrote:
> On Mon, May 16, 2011 at 11:17 AM, John Antonakis <John.Antonakis@unil.ch> wrote:
>> Would anyone have a code to generate data (panel) that is clustered and
>> where the conditional variance depends on a cluster-level shock?
>
> Oh, not again. Wasn't there a query about correlated data last week?
>
> set obs 100
> gen int clusterID = _n
> gen u = rnormal()
> expand 20
> bysort clusterID : gen int t = _n
> gen e = rnormal()*exp( 0.2*u - 1 )
> gen y = u + e
>
> Of course you can add xb to this y. Austin Nichols suggested to
> generate xs to be clustered correlated, as well.
>
>


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


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