It is interesting to graph the distribution of the standardized average as n increases. Do this when the Xi are uniform on [0; 1]. Look at the histogram when n is 1, 5, 10 and 25. Do you see the normal curve taking shape? (A rule of thumb is that if the Xi are not too skewed, then n > 25 should make the average approximately normal. You might want> f=function(n,a=0,b=1) {mu=(b+a)/2 sigma=(b-a)/sqrt(12) (mean(runif(n,a,b))-mu)/(sigma/sqrt(n)) } where the formulas for the mean and standard deviation are given. ) Thank you very much! -- View this message in context: http://r.789695.n4.nabble.com/Please-help-with-one-problem-tp3091392p3091392.html Sent from the R help mailing list archive at Nabble.com.
My first instinct is to suggest that you ask your professor or TA for help, since this looks remarkably like a homework problem. We are not here to do your work for you. Failing that, what have you tried? Have you gotten error messages or otherwise gone wrong? We will help with specific R questions presented with complete information as described in the posting guide. This isn't an R question. Sarah On Thu, Dec 16, 2010 at 1:12 PM, diavolo_vam <venci9n at abv.bg> wrote:> > It is interesting to graph the distribution of the standardized average as n > increases. Do this when the Xi are > uniform on [0; 1]. Look at the histogram when n is 1, 5, 10 and 25. Do you > see the normal curve taking shape? > (A rule of thumb is that if the Xi are not too skewed, then n > 25 should > make the average approximately > normal. You might want >> f=function(n,a=0,b=1) { > mu=(b+a)/2 > sigma=(b-a)/sqrt(12) > (mean(runif(n,a,b))-mu)/(sigma/sqrt(n)) > } > where the formulas for the mean and standard deviation are given. ) > >-- Sarah Goslee http://www.functionaldiversity.org
Hello Sarah, Thank you for your post, but this is one task from simpleR book, and I want to understand the lesson. If you don`t want to help me, OK no problem, but if anyone can help let do it. -- View this message in context: http://r.789695.n4.nabble.com/Please-help-with-one-problem-tp3091392p3091477.html Sent from the R help mailing list archive at Nabble.com.
Whether you selected the problem or a teacher did, you need to stay on topic and provide specific examples of code you have tried with sample input data as needed to make the code self-contained. Ask about R, not basic statistics. "diavolo_vam" <venci9n at abv.bg> wrote:> >Hello Sarah, >Thank you for your post, but this is one task from simpleR book, and I >want >to understand the lesson. If you don`t want to help me, OK no problem, >but >if anyone can help let do it. > > >-- >View this message in context: >http://r.789695.n4.nabble.com/Please-help-with-one-problem-tp3091392p3091477.html >Sent from the R help mailing list archive at Nabble.com. > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.--------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity.
Hi, I would suggest two things: 1. Use a subject related to your problem when posting to the list! 2. State a question (as Sarah has already said)! Like this nobody can really understand what you want (or at least I cant!). Jannis diavolo_vam schrieb:> It is interesting to graph the distribution of the standardized average as n > increases. Do this when the Xi are > uniform on [0; 1]. Look at the histogram when n is 1, 5, 10 and 25. Do you > see the normal curve taking shape? > (A rule of thumb is that if the Xi are not too skewed, then n > 25 should > make the average approximately > normal. You might want > >> f=function(n,a=0,b=1) { >> > mu=(b+a)/2 > sigma=(b-a)/sqrt(12) > (mean(runif(n,a,b))-mu)/(sigma/sqrt(n)) > } > where the formulas for the mean and standard deviation are given. ) > > > Thank you very much! >
The clt.examp function in the TeachingDemos package shows the effect of sample size on approximate normality for 4 different distribution of which the uniform distribution is one. This may do what you want, or you could start with that code and modify it to do what you want. If not then try better explaining what you want or what your actual question is. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of diavolo_vam > Sent: Thursday, December 16, 2010 11:13 AM > To: r-help at r-project.org > Subject: [R] Please help with one problem > > > It is interesting to graph the distribution of the standardized average > as n > increases. Do this when the Xi are > uniform on [0; 1]. Look at the histogram when n is 1, 5, 10 and 25. Do > you > see the normal curve taking shape? > (A rule of thumb is that if the Xi are not too skewed, then n > 25 > should > make the average approximately > normal. You might want > > f=function(n,a=0,b=1) { > mu=(b+a)/2 > sigma=(b-a)/sqrt(12) > (mean(runif(n,a,b))-mu)/(sigma/sqrt(n)) > } > where the formulas for the mean and standard deviation are given. ) > > > Thank you very much! > -- > View this message in context: http://r.789695.n4.nabble.com/Please- > help-with-one-problem-tp3091392p3091392.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.