Hi every one, I am trying to generate a normally distributed random variable with the following descriptive statistics, min=1, max=99, variance=125, mean=38.32, 1st quartile=38, median=40, 3rd quartile=40, skewness=-0.274. I know the "rnorm" will allow me to simulate random numbers with mean 38.32 and Sd=11.18(sqrt(125)). But I need to have the above mentioned descriptive statistics for the data that I generate. I would be thankful to anyone who can help me with this problem. Regards Murthy
Hi every one, I am trying to generate a random variable with the following descriptive statistics, min=1, max=99, variance=125, mean=38.32, 1st quartile=38, median=40, 3rd quartile=40, skewness=-0.274. I tried with rgamma and as I cannot use rnorm, can any one please suggest me what distribution would give me the negative skewness. I need to have the above mentioned descriptive statistics for the data generated. I would be thankful to anyone who can help me with this problem. Regards Murthy
Is this a homework problem? cheers, Rolf Turner rolf at math.unb.ca
You need to know the exact distribution of the random numbers you want to generate. For rnorm, in fact, you do not just specify the mean and the variance, but implicitely also that the data is normally distributed. Likewise, it is not sufficient to give min, max, skewness etc, you also need to know the distribution and then maybe you can use runif() as base for your code. Pascal nmi13 wrote:>Hi every one, > >I am trying to generate a normally distributed random variable with the >following descriptive statistics, > >min=1, max=99, variance=125, mean=38.32, 1st quartile=38, median=40, 3rd >quartile=40, skewness=-0.274. > >I know the "rnorm" will allow me to simulate random numbers with mean 38.32 >and Sd=11.18(sqrt(125)). But I need to have the above mentioned descriptive >statistics for the data that I generate. > >I would be thankful to anyone who can help me with this problem. > >Regards >Murthy > > >
These conditions are mutually exclusive for a lot of reasons, therefore, there's no way to generate such data. Briefly, the normal distribution is fully specified by the mean and variance, the other conditions are superfluous, and, in some cases, impossible Please tell us what you are actually trying to do and why you need to do it, and perhaps we can help. Peter Peter L. Flom, PhD Assistant Director, Statistics and Data Analysis Core Center for Drug Use and HIV Research National Development and Research Institutes 71 W. 23rd St www.peterflom.com New York, NY 10010 (212) 845-4485 (voice) (917) 438-0894 (fax)>>> nmi13 <NMI13 at student.canterbury.ac.nz> 10/28/2003 3:38:22 AM >>>Hi every one, I am trying to generate a normally distributed random variable with the following descriptive statistics, min=1, max=99, variance=125, mean=38.32, 1st quartile=38, median=40, 3rd quartile=40, skewness=-0.274. I know the "rnorm" will allow me to simulate random numbers with mean 38.32 and Sd=11.18(sqrt(125)). But I need to have the above mentioned descriptive statistics for the data that I generate. I would be thankful to anyone who can help me with this problem. Regards Murthy ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help