R version 2.6.1 (2007-11-26) 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.084299365852926 + ,-15.5692124815993 + ,-6.9953619930182 + ,-2.07575919037298 + ,6.06472185178652 + ,3.10063183929146 + ,-7.27872604143293 + ,11.9305592423578 + ,-15.1800926797913 + ,-4.96965957564265 + ,-3.06184332688462 + ,5.17876413221274 + ,-2.29638814463019 + ,-1.85853257792512 + ,-8.74637895628288 + ,-8.02346934029272 + ,4.80319999595127 + ,3.90173526693944 + ,-11.3069080265042 + ,4.26225040152088 + ,-6.88628010104842 + ,4.12797896412461 + ,4.24824928932737 + ,-5.91811547446539 + ,-2.62127541719435 + ,-5.11947651478644 + ,-6.19169292552164 + ,1.57682830128841 + ,6.93381888926023 + ,1.30435330636300 + ,0.701451547474772 + ,18.1487693268603 + ,-13.6251962127511 + ,-8.9684198944174 + ,-3.48024416476534 + ,0.133268755660886 + ,0.156896176204026 + ,-1.28412130463800 + ,-8.4586972345603 + ,-2.91518278408049 + ,0.150465578819962 + ,3.86877987666889 + ,7.70993797103159 + ,-4.11650976301151 + ,-2.74475852656699 + ,3.19286810860467 + ,-6.2212027713738 + ,1.25489355791219 + ,4.23585013027417 + ,0.153440583363572 + ,-2.05719003274709 + ,2.14422869581576 + ,-1.68156215590428 + ,5.0318450949173 + ,2.24823311061623 + ,-6.58372573676435 + ,-2.85420176875137 + ,5.0379752614482 + ,4.43711208741108 + ,-0.675511401722624 + ,-2.50684702275299 + ,2.35909448398834 + ,-6.31849429304567 + ,-3.81949862816358 + ,2.17307118170725 + ,4.13663986179168 + ,-6.96229654560136 + ,5.28008601863276 + ,4.2774558989149) > 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 -0.9423635 6.0452235 ( 0.7277594) ( 0.5146036) > postscript(file="/var/www/html/rcomp/tmp/1t66k1197999275.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/2x41j1197999275.tab") > > system("convert tmp/1t66k1197999275.ps tmp/1t66k1197999275.png") > > > proc.time() user system elapsed 1.159 0.237 1.224