Bookmark and Share

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: Generating clustered data


From   John Antonakis <[email protected]>
To   [email protected]
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 <[email protected]> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index