lundi 15 juin 2020

Is there a way to get a random sample from a particular decile of the normal distribution using Stata's rnormal() function?

I'm working with a dataset where the values of my variable of interest are hidden. I have the range (min max), mean, and sd of this variable and for each observation, I have information on which decile the value for observation lies in. Is there any way I can impute some values for this variable using the random number generator or rnormal() suite of commands in Stata? Something along the lines of:

set seed 1

gen imputed_var=rnormal(mean,sd,decile) if decile==1

Appreciate any help on this, thanks!




Aucun commentaire:

Enregistrer un commentaire