Dear forum,
I would like to create a sample where N=2000 and, for each simulated subject, to draw a lognormally distributed exposure variable X with a median of 1 and first and third quartiles of 0.5 and 2. Then, I would like to create an outcome variable Y conditional on the lognormal exposure, so that the coefficient for X after a linear regression with X and Y equals 1.2. Does anyone know how to do this in Stata 15?
Best regards,
Kjell Weyde
I would like to create a sample where N=2000 and, for each simulated subject, to draw a lognormally distributed exposure variable X with a median of 1 and first and third quartiles of 0.5 and 2. Then, I would like to create an outcome variable Y conditional on the lognormal exposure, so that the coefficient for X after a linear regression with X and Y equals 1.2. Does anyone know how to do this in Stata 15?
Best regards,
Kjell Weyde
Comment