On 9/8/06, Shawn Bauldry <[email protected]> wrote:
*** Set desired parameters
local b0 = 0.5
local b1 = 1.0
local b2 = 3.0
local b3 = -4.0
*** Generating population data of 10,000 cases
set obs 10000
set seed 1234 // just in case, and for good programming style
forvalues i = 1/3 {
gen x`i' = uniform()
}
gen p1 = `b0' + `b1'*x1 + `b2'*x2 + `b3'*x3
gen p2 = exp(p1) / (1 + exp(p1))
gen byte outcome = ( uniform() < p2 )
--
Stas Kolenikov
http://stas.kolenikov.name
*
* 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/