R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(24.70833333 + ,35.58333333 + ,21.33333333 + ,14.58333333 + ,15.08333333 + ,14.95833333 + ,13.08333333 + ,6.083333333 + ,-2.791666667 + ,-1.041666667 + ,-7.916666667 + ,-10.29166667 + ,-16.5625 + ,-0.6875 + ,-14.9375 + ,-16.6875 + ,-18.1875 + ,-22.3125 + ,-18.1875 + ,-20.1875 + ,-22.0625 + ,-20.3125 + ,-19.1875 + ,-23.5625 + ,-25.83333333 + ,-16.95833333 + ,-8.208333333 + ,-3.958333333 + ,-16.45833333 + ,-16.58333333 + ,-14.45833333 + ,-10.45833333 + ,-5.333333333 + ,-7.583333333 + ,-5.458333333 + ,-3.833333333 + ,1.895833333 + ,-7.229166667 + ,-3.479166667 + ,6.770833333 + ,16.27083333 + ,19.14583333 + ,23.27083333 + ,26.27083333 + ,29.39583333 + ,35.14583333 + ,35.27083333 + ,41.89583333 + ,-20.14583333 + ,-26.27083333 + ,-22.52083333 + ,-21.27083333 + ,-19.77083333 + ,-11.89583333 + ,-7.770833333 + ,-3.770833333 + ,0.354166667 + ,-3.895833333 + ,-2.770833333 + ,3.854166667 + ,-0.416666667 + ,-0.541666667 + ,7.208333333 + ,19.45833333 + ,21.95833333 + ,22.83333333 + ,15.95833333 + ,18.95833333 + ,24.08333333 + ,19.83333333 + ,21.95833333 + ,24.58333333 + ,21.3125 + ,12.1875 + ,16.9375 + ,15.1875 + ,17.6875 + ,19.5625 + ,12.6875 + ,14.6875 + ,14.8125 + ,15.5625 + ,22.6875 + ,23.3125 + ,15.04166667 + ,3.916666667 + ,3.666666667 + ,-14.08333333 + ,-16.58333333 + ,-25.70833333 + ,-24.58333333 + ,-31.58333333 + ,-38.45833333 + ,-37.70833333 + ,-44.58333333 + ,-55.95833333) > 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 -9.375004e-11 1.994473e+01 ( 2.035601e+00) ( 1.439387e+00) > postscript(file="/var/www/html/rcomp/tmp/1b7y91229458423.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/20sxy1229458423.tab") > > system("convert tmp/1b7y91229458423.ps tmp/1b7y91229458423.png") > > > proc.time() user system elapsed 1.189 0.252 1.352