Why don't you just do this: H<-rnorm(100, mean=50000, sd=3000) par(las=1) hist(H, breaks=seq(40000, 60000, 1000), freq=F) f<- function(x) exp(-(x-5000)^2/18000000)/sqrt(18000000*pi) x<- seq(40000, 60000, 100) lines(x, dnorm(x, 50000, 3000))
On Sat, Sep 12, 2009 at 5:47 PM, KABELI MEFANE<kabelimef...@yahoo.co.uk> wrote: > Dear All > > let me go one step further by asking you if you could help me show that the > distribution of this data in normal. have a little idea (by trial and > error) but i seem to not fully understand how its done. > > H<-rnorm(100, mean=50000, sd=3000) > par(las=1) > hist(H, breaks=seq(40000, 60000, 1000), freq=F) > f<- function(x) exp(-(x-5000)^2/18000000)/sqrt(18000000*pi) > x<- seq(40000, 60000, 1000) > lines(x,f(x)) > > The code works when its like this: > > H<-rnorm(100, mean=5000, sd=1000) > par(las=1) > hist(H, breaks=seq(2000, 8000, 100), freq=F) > f<- function(x) exp(-(x-5000)^2/2000000)/sqrt(2000000*pi) > x<- seq(2000, 8000, 50) > lines(x,f(x)) > > Please tell me or advice of an easier or understandable code > > > > > > > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@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. > > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? ______________________________________________ R-help@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.