R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(09.166456,07.970589,07.104091,06.621064,07.529215,08.170938,08.157450,07.378962,07.921496,08.156740,08.856365,08.817177,08.734347,09.345927,08.992970,10.785120,08.886867,08.818847,08.823744,09.165298,08.652657,08.173054,07.563416,07.595809,08.381467,07.216432,06.540178,06.238914,05.487288,05.759462,05.993215,07.474726,07.348907,07.303379,07.119314,06.993780,06.958153,07.595706,08.088153,07.555753,07.315433,07.893427,08.858794,08.839367,08.014733,07.873465,08.930377,10.500550,12.611440,11.417870,11.872490,11.060820,12.043310,09.776299,09.557194,09.202590,10.224020,09.350807,08.300913,08.365779,08.133595,07.660470,08.074839,07.848597,07.998220,07.396895,07.900419,08.100500,07.899453,07.599783,08.100929,09.002175,10.298900,10.101520,10.699150,09.698140,09.800951,10.900470,10.697850,09.297252,10.397440,10.900720,12.901270,13.099060,11.698280,11.099870,11.301570,10.702110,10.099310,09.591119) > 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 8.8272662 1.6238199 (0.1711656) (0.1210324) > postscript(file="/var/www/rcomp/tmp/1kijx1293626181.ps",horizontal=F,onefile=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/2n0zl1293626181.tab") > try(system("convert tmp/1kijx1293626181.ps tmp/1kijx1293626181.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.410 0.280 0.669