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(13,96,60.1,281.25,548.59,470.325,456.25,456.25,483.5,498.25,457.5,490.7,303.075,510,417.7,631.4,595.625,531.15,581.725,581.725,544.75,582,622.225,638.666,469.9,532.78,538.5,884.65,559.08,1045.51,1319.34,0,1300,1322.6,962.57,1030.715,1038.31,967.87,1228.2,1300.285,1095.995,1181.955,1499.46,1523.38,1237.765,1119.545,1136.165,1081.63,1060.065,1216.67,1186.17,1217.475,1096.95,1685.6,1758.5,1786.6,2049.895,1845.895,2015.02,1609.63,918.725,1240.96,1671.785,1438.466,1886.14,2110.66,1856.87,1775.765,1569.625,1835.69,2041.46,1667.035,948.25,1365.66,1681.025,1661.9,2194.88,2051.025,2365.845,2398.5,2181.85,2626.77,2529.72,1700.3,605.38,1200.495,1597.02,1174.955,1612.88,1683.55,2260.955,2455.335,2365.62,2417.755,2308.785,1629.94,1053.275,1330.235,1543.85) > 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 1239.5492 656.8022 ( 66.0111) ( 46.6769) > postscript(file="/var/www/rcomp/tmp/1oual1271584665.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/29c991271584665.tab") > > try(system("convert tmp/1oual1271584665.ps tmp/1oual1271584665.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.470 0.250 0.689