y <- c(1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2) x <- c(24,21,18,16,16,18,18,13,22,16,18,16,14,8,10,12,10,17,10,8,16,16,18,21,13,8,14,18) par3 = '0' par2 = 'TRUE' par1 = '3' #'GNU S' R Code compiled by R2WASP v. 1.0.44 () #Author: Dr. Ian E. Holliday #To cite this work: Ian E. Holliday, 2009, Histogram and QQplot (v1.0.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_varia1.wasp/ #Source of accompanying publication: #Technical description: postscript(file="/var/www/rcomp/tmp/13qp31269276578.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) par1 <- as.numeric(par1) par2<- as.logical(par2) par3<-as.numeric(par3) if(par3>45){par3<-45;warning('trim limited to 45%')} if(par3<0){par3<-0;warning('negative trim makes no sense. Trim is zero.')} x1<-x[y==1] y1<-y[y==1] lotrm<-as.integer(length(x1)*par3/100) hitrm<-as.integer(length(x1)*(100-par3)/100) srt<-order(x1,y1) trmx1<-x1[srt[lotrm:hitrm]] trmy1<-y1[srt[lotrm:hitrm]] x2<-x[y==2] y2<-y[y==2] lotrm<-as.integer(length(x2)*par3/100) hitrm<-as.integer(length(x2)*(100-par3)/100) srt<-order(x2,y2) trmx2<-x2[srt[lotrm:hitrm]] trmy2<-y2[srt[lotrm:hitrm]] xtrm<-c(trmx1,trmx2) ytrm<-c(trmy1,trmy2) r<-boxplot(xtrm~as.factor(ytrm), col=par1, notch=par2, names =c('negative', 'neutral'), main='Estimated Alcohol Consumption', xlab='Mood Condition', ylab='Units of Alcohol') dev.off() #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,hyperlink('http://www.xycoon.com/overview.htm','Boxplot statistics','Boxplot overview'),6,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Placement',1,TRUE) a<-table.element(a,hyperlink('http://www.xycoon.com/lower_whisker.htm','lower whisker','definition of lower whisker'),1,TRUE) a<-table.element(a,hyperlink('http://www.xycoon.com/lower_hinge.htm','lower hinge','definition of lower hinge'),1,TRUE) a<-table.element(a,hyperlink('http://www.xycoon.com/central_tendency.htm','median','definitions about measures of central tendency'),1,TRUE) a<-table.element(a,hyperlink('http://www.xycoon.com/upper_hinge.htm','upper hinge','definition of upper hinge'),1,TRUE) a<-table.element(a,hyperlink('http://www.xycoon.com/upper_whisker.htm','upper whisker','definition of upper whisker'),1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'yes',1,TRUE) for (j in 1:5) { a<-table.element(a,r$stats[j,1]) } a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'no',1,TRUE) for (j in 1:5) { a<-table.element(a,r$stats[j,2]) } a<-table.row.end(a) a