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]

st: Generating multilevel data


From   "Brincks, Ahnalee" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Generating multilevel data
Date   Wed, 23 Mar 2011 14:44:13 -0400

Hello,

I am new to the list, though I've combed through the archives many, many times (thank you for this terrific resource).

My question is this:  I need to generate 3 level hierarchical data for use as sample data in my dissertation.  I would like to use Stata, however, I am running into some trouble with the programming.

Initially, I would like to create a single response variable (Y) and a single predictor (X).  The model will include both a random intercept and random slope at level-1, a random intercept and fixed slope at level-2.  The complete model would look like this:

Level-1
Yijk = p0jk = p1jk(Xijk) + eijk

Level-2
p0jk = b00k + r0jk
p1jk = b10k + r1jk

Level-3
b00k = g000 + u00k
b10k = g100

Full Model
Yijk = g000 + g100(Xijk) + eijk + r0jk + r1jk(Xijk) + u00k

I would like to be able to define:

g000 (the grand mean)
var(X)
var(e)
var(r0jk)
var(r1jk)
var(u00k)

I've found some code in the archives: http://www.stata.com/statalist/archive/2008-12/msg00929.html
This addresses a similar problem in a two-level framework.  However, I'm having some trouble understanding past the matrix formation (in particular, how to create a Yij from y1, y2 and y3).  This approach seems to be working with deviations from the mean, and I need a model that does not.

Thank you for any help you can provide.  My preference is to stay with Stata commands (as opposed to calling mata from within Stata) simply because I am more familiar with them.

~ ahnalee


Ahnalee Brincks
PhD Student
University of Miami
[email protected]<mailto:[email protected]>

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