Hello, I am using STATA 14 and would like to generate some random numbers that have a specific mean and standard deviation but fall with a range.
I used
gen x = rnormal (m, s) and the mean and SD were spot on but the range contains negative numbers. In this case I need the numbers to range from a minimum of 5.98 to a maximum of 9. Just to test, I used runiform( ) as it allows a range but the SD was off. Any help is welcomed.
Thanks in advance!
Related Posts with Generate random numbers with specific mean and standard deviation within a range
Using fixed effects with zero-truncated count modelsHello! I am attempting to estimate a model using a panel of data that includes between 1 and 13 year…
Generation dummy variableHi, I want to create a dummy variable for whether an individual is a 1st or 2nd generation migrant. …
Transform for several variablesHello, I'd like to scale the different variables with different factors. When I run this command, o…
Esstab to relabel vairablesHi, this is a small insight into my regression output using esstab: Array I would like to change the…
Problem with omitting two categories using eventdd with a state-specific linear trend controlHello, everyone. I am using eventdd in Stata 17.0. I am trying to figure out how to keep event time …
Subscribe to:
Post Comments (Atom)
0 Response to Generate random numbers with specific mean and standard deviation within a range
Post a Comment