R version 2.10.1 (2009-12-14) 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(610,544,471.4,696.675,707.9,524.075,471.75,526.625,390.2,451.5,681.875,546.5,488.5,488.5,613.125,439,439,460.625,657.125,570.625,804.575,443,745.775,667.125,590.55,683.125,818.26,679.7,679.7,535.75,579,700.75,567.5,531.25,781.25,572.5,591.5,548.75,744,634.25,634.25,313.25,674.25,769.55,758.25,488.775,690.45,559.5,687.1,796.5,756.65,794.5,0,387.5,683,762.25,742,731.5,643,573.44,574.751,440.025,350.75,562.75,642.251,411,646,558.525,647.15,591,797,642.25,726.275,652.75,678.75,602.25,689.775,393,580.525,462.25,725.65,501,675,691,613.496,688.25,518.8,386.275,491.35,269.5,379,375.25,337.5,296,375,399.525,336,483.5,370.25,625.5,736.75,496.05,740.5,690.525,568.75,341.1,519.75,408.75,278.35,217,266,319.025,454.75,378.3,509.575,453.75,252,187.525,401.5,403.75) > 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) Warning message: package 'MASS' was built under R version 2.8.1 and help may not work correctly > 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 549.44665 157.69529 ( 14.39554) ( 10.17919) > postscript(file="/var/www/rcomp/tmp/1x9rt1271330256.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 > > #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/209qh1271330256.tab") > > try(system("convert tmp/1x9rt1271330256.ps tmp/1x9rt1271330256.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.450 0.280 0.688