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
need to drop duplicates depending on how many duplicates there are per observationI am trying to reshape my data from wide to long, however I need to drop duplicates first. Here is a…
Can we determine the significance of changes over time using cross-sectional data?Dear Statalisters, I am using data from the 2011 and 2014 Demographic Health Surveys (these are rep…
Random seed neededI am looking for a number or string that will be different in different runs of the same program. So…
Getting Stata to recall the last opened directoryHi, I have been using Stata 13 on a Windows system and each time I start Stata, CTRL+O took me to t…
Plotting a fitted Line for log scale axisHello, I have to plot a simple fitted line for exports relative to GDP (the variable is called "nor…
Subscribe to:
Post Comments (Atom)
0 Response to Generate random numbers with specific mean and standard deviation within a range
Post a Comment