R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(202.5,77.625,217.725,146.625,177.375,136.6,156.5,206.125,173.5,255.15,147.375,222.45,212.5,212.5,220.625,160,160,141.125,196.25,149.375,298.75,154.25,249.5,240.05,271.75,171,278.5,331.5,331.5,333.75,169.15,196.75,268.5,247,250.25,196.5,200.85,192.75,161,270.55,270.55,308,286.2,301.95,364.825,279,261.246,306,268.075,402.05,225.525,359.25,0,250,400.3,432.5,347.2,422.5,330.5,339.175,205.8,377.535,320,356.55,314.9,282.125,440.5,378.1,391.85,292.775,387,295.5,343.35,264.025,322.5,392.5,315.75,274.4,361.875,411.276,518.775,392.55,467,382.852,372.343,564.252,417,450.8,538.675,394,532,461.4,523,405.9,386.25,384.5,382,381.75,151.5,287.775,247.6,290.35,266.55,318.025,213.3,148.75,273,282.25,191.25,142.25,259.25,272.75,173.75,204.75,185.525,267.175,190.25,127.25,183.5,254.125) > par2 = '0' > par1 = '8' > ylab = 'density' > xlab = 'value of data series' > main = 'Histogram and Fitted Normal Density' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(MASS) > par1 <- as.numeric(par1) > if (par2 == '0') par2 = 'Sturges' else par2 <- as.numeric(par2) > x <- as.ts(x) #otherwise the fitdistr function does not work properly > r <- fitdistr(x,'normal') > r mean sd 284.624200 104.981560 ( 9.583461) ( 6.776531) > postscript(file="/var/www/html/rcomp/tmp/1o3r61270818177.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > myhist<-hist(x,col=par1,breaks=par2,main=main,ylab=ylab,xlab=xlab,freq=F) > curve(1/(r$estimate[2]*sqrt(2*pi))*exp(-1/2*((x-r$estimate[1])/r$estimate[2])^2),min(x),max(x),add=T) > dev.off() null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Parameter',1,TRUE) > a<-table.element(a,'Estimated Value',1,TRUE) > a<-table.element(a,'Standard Deviation',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mean',header=TRUE) > a<-table.element(a,r$estimate[1]) > a<-table.element(a,r$sd[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'standard deviation',header=TRUE) > a<-table.element(a,r$estimate[2]) > a<-table.element(a,r$sd[2]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/2rm8c1270818177.tab") > > try(system("convert tmp/1o3r61270818177.ps tmp/1o3r61270818177.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.397 0.156 0.697