R version 2.6.0 (2007-10-03) Copyright (C) 2007 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(-0.361846007532772 + ,3.68863098861213 + ,0.682519663180303 + ,7.63067731671178 + ,-1.52075037210644 + ,5.70955581144987 + ,13.1939928862509 + ,-5.49940323517293 + ,1.76500444649349 + ,1.96677142422135 + ,-5.60662922820024 + ,-7.31646013152379 + ,-1.08563548801227 + ,-0.099103421317697 + ,-9.39514313732207 + ,-6.39447775845358 + ,-2.02805473224696 + ,0.903602088633067 + ,7.57491469457003 + ,-2.19407311445752 + ,3.58898833702079 + ,-1.68951274457543 + ,-1.53671157669086 + ,13.3598886375142 + ,-3.65726657887787 + ,0.613493186862468 + ,9.24506908223031 + ,11.0285738876639 + ,-3.49893748343257 + ,-6.55850163797107 + ,5.54750744110568 + ,16.5005808635365 + ,-0.0867999869147866 + ,-10.1895526735612 + ,-1.56002146200367 + ,3.61791774409454 + ,-3.46228026897451 + ,-0.839719033549138 + ,-1.74844063591575 + ,-5.59275453302008 + ,-4.31083509741400 + ,8.28778989827125 + ,-14.0676602788114 + ,-4.07578881412959 + ,3.95794121224257 + ,-2.54404876219145 + ,24.3555160491049 + ,11.7342693021934 + ,3.81944484749606 + ,-2.98176766619709 + ,7.45551605729516 + ,-6.39245158356992 + ,11.7003155629076 + ,2.36027611470617 + ,-7.48442696186156 + ,-2.54111530629837 + ,-2.30507409276129 + ,10.8550201878513 + ,-2.11331989623902 + ,3.4086895867965 + ,11.2003605872847 + ,-1.20537867882487 + ,5.81786820725412 + ,-2.61150202837964 + ,-1.54008349441135 + ,-5.42145151519334 + ,11.6034074049369 + ,-9.06789177079852) > 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: Wessa P., (2007), Maximum-likelihood Normal Distribution Fitting (v1.0.2) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_fitdistrnorm.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (available to developers only). > 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 1.0674887 7.0719205 (0.8575963) (0.6064122) > postscript(file="/var/www/html/rcomp/tmp/16j0z1197998559.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 > 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/2ynr21197998559.tab") > > system("convert tmp/16j0z1197998559.ps tmp/16j0z1197998559.png") > > > proc.time() user system elapsed 0.639 0.162 0.696