Dear Statalisters,
for teaching purposes, I would like to generate a continuous variable (with a range of, say, 0-100) that is based on the distribution of a 5-point likert scale ordinal variable. Now, I could just use the runiform(0) function to generate a distribution with the desired properties but it is important that the new variable is created within the existing dataset and correlates (highly) with its ordinal base. Given this, I could use the cumulative distribution function of the ordinal variable to generate the continuous variable, but the uniform distribution resulting from the cumul function is not well suited for what I am trying to accomplish with the data (a similar problem occurs when I am trying to predict it as a latent response variable via ordered logit).
Ideally, the procedure I am looking for would generate random values with a pre-defined standard deviation around the five categories of the existing ordinal variable. Drawing from a uniform distribution separately for all five categories rather than for the whole variable might also do the trick (a corresponding procedure has been proposed in the linked paper, but I can't implement it in Stata).
If anyone has an idea how to solve this problem, the procedure could be demonstrated using the rep78 variable from the auto2 dataset. I am using Stata 13.1.
sysuse auto2.dta
histogram rep78, discrete /// This is roughly the distribution I would like to end up with, but with (randomly distributed) deviations from the realized values.
Any help is greatly appreciated!
Timm
for teaching purposes, I would like to generate a continuous variable (with a range of, say, 0-100) that is based on the distribution of a 5-point likert scale ordinal variable. Now, I could just use the runiform(0) function to generate a distribution with the desired properties but it is important that the new variable is created within the existing dataset and correlates (highly) with its ordinal base. Given this, I could use the cumulative distribution function of the ordinal variable to generate the continuous variable, but the uniform distribution resulting from the cumul function is not well suited for what I am trying to accomplish with the data (a similar problem occurs when I am trying to predict it as a latent response variable via ordered logit).
Ideally, the procedure I am looking for would generate random values with a pre-defined standard deviation around the five categories of the existing ordinal variable. Drawing from a uniform distribution separately for all five categories rather than for the whole variable might also do the trick (a corresponding procedure has been proposed in the linked paper, but I can't implement it in Stata).
If anyone has an idea how to solve this problem, the procedure could be demonstrated using the rep78 variable from the auto2 dataset. I am using Stata 13.1.
sysuse auto2.dta
histogram rep78, discrete /// This is roughly the distribution I would like to end up with, but with (randomly distributed) deviations from the realized values.
Any help is greatly appreciated!
Timm

Comment