I would like to generate 2000 latent variable a which is defined as a = b + 3c + d
where d ~ N[0,3] and c ~ uniform [0, 1].
I should choose a variable "b" so that I can generate nearly 30% of "a" to be negative.
--------
What I write in stata is as follows:
set obs 2000
generate c = runiform(0,1)
generate d = rnormal(0,3)
How can I write this code?
where d ~ N[0,3] and c ~ uniform [0, 1].
I should choose a variable "b" so that I can generate nearly 30% of "a" to be negative.
--------
What I write in stata is as follows:
set obs 2000
generate c = runiform(0,1)
generate d = rnormal(0,3)
How can I write this code?

Comment