Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: using loop to generate distributions with different means and standard deviations


From   Lance Wiggains <[email protected]>
To   [email protected]
Subject   st: using loop to generate distributions with different means and standard deviations
Date   Wed, 18 May 2011 13:09:03 -0400

Statalist members,

I'm trying to get Stata to generate a distribution of data from variables in
my data set.

My appended data looks like this
mean_var1=90
standard_deviation_var1=5
mean_var2=100
sd_var2=10
mean var3=110
sd_var3=15
and so on

I'm need a loop that will take my variables and create the
distributions for me.
I've been using the drawnorm command
     drawnorm name1, m(mean_var1) sd(sd_var1)
but I can't get it to recognize more than 1 variable at a time

I want it to perform the distribution command for each pair of my variables.
I.e. (m_var1, sd_var1), (m_var2, sd_var2) , (m_var3, sd_var3)

Thanks for your consideration,

Lance
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index