x <- c(4 'SMK' 'hot' ,5 'SMK' 'hot' ,3 'SMK' 'hot' ,4 'SMK' 'hot' ,5 'SMK' 'hot' ,3 'SMK' 'hot' ,7 'SMK' 'hot' ,5 'SMK' 'hot' ,6 'SMK' 'hot' ,3 'SMK' 'hot' ,2 'SMK' 'hot' ,4 'SMK' 'hot' ,5 'SMK' 'hot' ,2 'SMK' 'hot' ,3 'SMK' 'hot' ,6 'SMK' 'hot' ,4 'SMK' 'hot' ,4 'SMK' 'hot' ,6 'SMK' 'hot' ,2 'SMK' 'hot' ,3 'SMK' 'mild' ,5 'SMK' 'mild' ,4 'SMK' 'mild' ,2 'SMK' 'mild' ,7 'SMK' 'mild' ,1 'SMK' 'mild' ,4 'SMK' 'mild' ,4 'SMK' 'mild' ,7 'SMK' 'mild' ,4 'SMK' 'mild' ,3 'SMK' 'mild' ,3 'SMK' 'mild' ,3 'SMK' 'mild' ,3 'SMK' 'mild' ,2 'SMK' 'mild' ,5 'SMK' 'mild' ,5 'SMK' 'mild' ,3 'SMK' 'mild' ,6 'SMK' 'mild' ,2 'SMK' 'mild' ,8 'NS' 'hot' ,9 'NS' 'hot' ,10 'NS' 'hot' ,7 'NS' 'hot' ,8 'NS' 'hot' ,9 'NS' 'hot' ,10 'NS' 'hot' ,6 'NS' 'hot' ,6 'NS' 'hot' ,7 'NS' 'hot' ,8 'NS' 'hot' ,9 'NS' 'hot' ,8 'NS' 'hot' ,7 'NS' 'hot' ,5 'NS' 'hot' ,11 'NS' 'hot' ,7 'NS' 'hot' ,8 'NS' 'hot' ,10 'NS' 'hot' ,9 'NS' 'hot' ,3 'NS' 'mild' ,5 'NS' 'mild' ,4 'NS' 'mild' ,2 'NS' 'mild' ,6 'NS' 'mild' ,1 'NS' 'mild' ,4 'NS' 'mild' ,4 'NS' 'mild' ,5 'NS' 'mild' ,4 'NS' 'mild' ,3 'NS' 'mild' ,3 'NS' 'mild' ,4 'NS' 'mild' ,3 'NS' 'mild' ,2 'NS' 'mild' ,5 'NS' 'mild' ,4 'NS' 'mild' ,3 'NS' 'mild' ,6 'NS' 'mild' ,2 'NS' 'mild') par1 = '10' xlab = 'Survey Score' main = 'smoke' par1 <- '10' #'GNU S' R Code compiled by R2WASP v. 1.2.291 () #Author: root #To cite this work: Ian E. Holliday, 2012, Histogram, QQplot and Density Plot (v1.0.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_Distributional Plots.wasp/ #Source of accompanying publication: # x <- x[!is.na(x)] postscript(file="/var/wessaorg/rcomp/tmp/1ih041352563182.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) par1 <- as.numeric(par1) myhist<-hist(x, breaks=par1, col=2, xlab=xlab, main=main) dev.off() postscript(file="/var/wessaorg/rcomp/tmp/26mp11352563182.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) qqnorm(x) qqline(x, col=2) dev.off() postscript(file="/var/wessaorg/rcomp/tmp/34esu1352563182.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) plot(density(x), xlab=xlab, main=main) dev.off() #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab load(file="/var/wessaorg/rcomp/createtable") a<-table.start() a<-table.row.start(a) a<-table.element(a,'Descriptive Statistics',3,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'mean',header=TRUE) a<-table.element(a,signif(mean(x), 6)) a<-table.element(a,hyperlink('http://www.xycoon.com/arithmetic_mean.htm','formula','click to see the formula')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'standard deviation',header=TRUE) a<-table.element(a,signif(sd(x), 6)) a<-table.element(a,hyperlink('http://www.xycoon.com/unbiased1.htm','formula','click to see the formula')) a<-table.row.end(a) a<-table.end(a) table.save(a,file="/var/wessaorg/rcomp/tmp/4u17l1352563182.tab") try(system("convert tmp/1ih041352563182.ps tmp/1ih041352563182.png",intern=TRUE)) try(system("convert tmp/26mp11352563182.ps tmp/26mp11352563182.png",intern=TRUE)) try(system("convert tmp/34esu1352563182.ps tmp/34esu1352563182.png",intern=TRUE))