[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: generating random correlated variables

From   Adrian de la Garza <>
To   statalist <>
Subject   st: generating random correlated variables
Date   Sun, 30 Mar 2008 14:29:54 -0400

I would like to simulate some data and I'd like to know if I can do this with Stata. 

For instance, suppose I have the following equations:

y = 5x + u
x = 2z + e

and I randomly generate u and y and solve for x in the first equation. Then I'd like to create e such that the correlation between u and e is 0.5, and generate z such that u and z are uncorrelated. Can I do this in Stata?

Thank you!!


How well do you know your celebrity gossip?
*   For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index