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(150.790688775846 + ,-6258.83534189665 + ,1179.70002837875 + ,12383.4735350986 + ,6452.27270900916 + ,17925.4944763725 + ,9257.68433920925 + ,-11723.3498644816 + ,9730.29130029668 + ,1936.54617702668 + ,-13491.8770530529 + ,-13575.4890229713 + ,16045.3501201983 + ,31348.045275449 + ,7731.3341195073 + ,22856.4486960203 + ,9073.2631337878 + ,9741.59405237557 + ,1332.23572230402 + ,-4628.33356110052 + ,-4607.73974806942 + ,10468.3136697059 + ,3481.88214736408 + ,25028.6738442344 + ,43679.0460797915 + ,3133.96300715266 + ,49119.3221578365 + ,-29338.6167794636 + ,-34798.4849473318 + ,-18302.9667882799 + ,-11186.9532031470 + ,-30966.7969435158 + ,7455.0861209843 + ,8399.08769635226 + ,-7128.66714707987 + ,-710.3526687469 + ,38360.0693181986 + ,-86558.4287678845 + ,-14187.9571747546 + ,3452.42288668084 + ,-5961.29547826464 + ,10305.4208935305 + ,17920.5309412364 + ,1516.14971428292 + ,160300.016991544 + ,12283.5231099274 + ,-7608.94694452296 + ,-8111.9760189687 + ,-51104.480478478 + ,14051.3976851153 + ,-26934.501973342 + ,8297.05855141608 + ,7997.75560146061 + ,-11323.2347058055 + ,-29104.6052892639 + ,-8804.79506817229 + ,-36655.7461215054 + ,-21480.2013942902 + ,22717.8851070332 + ,-49675.4810209872 + ,-43007.5042557363 + ,17078.2355867197 + ,-31075.4428611256 + ,20753.5566469650 + ,-866.61457864198 + ,12546.4353825002 + ,53033.941150139 + ,11101.0470118611 + ,-27479.2194387895 + ,-22585.9201086563 + ,17607.2507747408 + ,326551.315645887 + ,-14702.2973393577 + ,29501.4682467813 + ,30906.0918468706 + ,-11697.8693797096 + ,19443.5659647436 + ,9599.18339880255 + ,3414.58835532525 + ,24385.1665443376 + ,-55436.4896111982 + ,24357.0626776376 + ,9597.46988149706 + ,-71563.4063280716 + ,6914.44503835373 + ,12057.6240025949 + ,-8581.25723332376 + ,-23608.2928407493 + ,-30894.6657060471 + ,-6201.06970316944 + ,-18465.4746948189 + ,-18944.3321613762 + ,16396.3058775606 + ,-545.771753456022 + ,-34797.1597979204 + ,-61904.9006746859 + ,-20410.1549297337 + ,9854.80042974788 + ,1357.59845540812 + ,-22560.9540910830 + ,-12724.6492980212 + ,1756.58704714364 + ,-7765.37726810927 + ,-10338.4454327962 + ,-19622.9718791054) > par2 = '20' > 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 1364.910 42929.670 ( 4189.507) ( 2962.429) > postscript(file="/var/www/html/rcomp/tmp/114ab1196683152.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/2a0u01196683152.tab") > > system("convert tmp/114ab1196683152.ps tmp/114ab1196683152.png") > > > proc.time() user system elapsed 0.644 0.176 1.090