R version 2.10.1 (2009-12-14) 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(840.875,1051.8,854.835,849.2,625.1,964.775,887.225,1010.45,1131.25,718.2,1088.5,1271.375,1098.375,1098.375,1195.05,1361.375,1361.375,1100.625,1190.375,1250.485,1087.575,992.05,810,1064.95,937.25,1039,1122.956,1079.5,1079.5,889.5,784.5,793.75,924.5,762.43,811.5,942.94,812.615,911.735,1009.25,1116.01,1116.01,988.16,1067.52,1082.53,1043.215,871.83,904.485,689.56,1082.78,1098.85,713.5,704.5,0,652.25,563,586,538.75,353.6,321.275,388.4,329.6,323,520.25,607.725,803.45,677.25,711,962.5,935.6,722.255,594.25,853.75,766.5,758.05,756.85,685.4,696.525,610.025,708.325,619.1,740.525,730.5,489.75,766.525,690.882,804.975,529.25,743.75,771.15,830.5,600,856.1,702.75,533.775,311.25,590,738,797.05,531.3,820,533.25,633.25,634.275,747.3,220.375,195.75,123.25,161.75,126.75,285.1,461.5,463.625,325.875,177,223,168.45,251.75,131.5,110.375,164.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) Warning message: package 'MASS' was built under R version 2.8.1 and help may not work correctly > 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 733.70861 306.65711 ( 27.99384) ( 19.79463) > postscript(file="/var/www/rcomp/tmp/1197w1271586208.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/25so21271586208.tab") > > try(system("convert tmp/1197w1271586208.ps tmp/1197w1271586208.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.400 0.300 0.684