Statalist


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

st: simulate consequences of selection bias 101


From   Thomas Gschwend <gschwend@uni-mannheim.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: simulate consequences of selection bias 101
Date   Tue, 01 Apr 2008 09:32:07 +0200

Dear all,
prompted by a student‘s question when teaching about the virtues of selection bias I would like to simulate some data which fulfills the following requirements, whereby Y = b0 + b1*X

1) When regressing Y on X (for the full sample)
b1 = -.5 and significantly < 0

2) When regressing Y on X (for a subsample, say for Y > 10)
b1 = +2 and significantly > 0

I am not sure how to do simulate data that fulfills both requirements.

Any help is greatly appreciated.

Thomas
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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   |   What's new   |   Site index