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(00.521505,00.424828,00.425031,00.477194,00.828021,00.615619,00.366627,00.430888,00.281029,00.464625,00.269395,00.577905,00.566115,00.507758,00.750718,00.680840,00.766109,00.456147,00.497750,00.419327,00.609551,00.457337,00.570548,00.347900,00.387499,00.582429,00.239103,00.236745,00.262616,00.424093,00.365275,00.375076,00.409006,00.389168,00.240261,00.158950,00.439337,00.509468,00.374347,00.433983,00.413056,00.328893,00.518665,00.548650,00.546911,00.496349,00.530893,00.595776,00.557058,00.573133,00.500542,00.543127,00.559366,00.691169,00.440349,00.567666,00.596911,00.473554,00.592394,00.597556,00.633413,00.605712,00.704611,00.480526,00.702686,00.700902,00.603085,00.698092,00.597656,00.802342,00.601711,00.599313,00.602563,00.701663,00.499571,00.498092,00.497569,00.600183,00.333954,00.274437,00.320943,00.540667,00.405021,00.288596,00.327594,00.313261,00.257556,00.213839,00.186186,00.159271) > 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 0.48403507 0.15102481 (0.01591941) (0.01125672) > postscript(file="/var/www/html/rcomp/tmp/1yits1293626067.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/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/220ry1293626067.tab") > try(system("convert tmp/1yits1293626067.ps tmp/1yits1293626067.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.396 0.168 0.815