R version 2.9.0 (2009-04-17) 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. > y <- c(4.618086411,4.666265285,4.543294782,4.632785353,4.624972813,4.654912278,4.526126979,4.399375273,4.661550519,4.789988623,4.6121458,4.48638665,4.54648119,4.604169686,4.638604962,4.637637376,4.593097605,4.646312129,4.513054897,4.313480092,4.686750173,4.740574823,4.573679519,4.49535532,4.575741375,4.608165695,4.808927024,4.748404354,4.691347882,4.860587298,4.632785353,4.566429358,4.849683763,4.85903691,4.840242308,4.785823686,4.729156166,4.737075257,4.89858579,4.86753445,4.802380355,4.883559212,4.656813419,4.634728988,4.763028271,4.838660029,4.92797806,4.783316371,4.927253685,4.90897164,5.185148668,5.088830142,5.175584601,5.322522055,4.884315927,4.959342,5.101694025,5.164214382,5.16706908,4.96284463) > x <- c(4.492001488,4.50313746,4.511957804,4.500920165,4.462453884,4.443827036,4.423648309,4.406719247,4.387014176,4.405498991,4.541164856,4.551769409,4.525044142,4.471638793,4.421247348,4.406719247,4.385769621,4.404277244,4.443827036,4.433194921,4.435567402,4.436751534,4.535820108,4.534747722,4.608165695,4.713127327,4.744062185,4.695924549,4.699570861,4.661550519,4.707726774,4.689511334,4.754451889,4.698660529,4.734442522,4.734442522,4.765586907,4.783316371,4.808927024,4.793308128,4.779123493,4.837075243,4.897093253,4.92797806,4.944495492,4.998562713,4.998562713,5.049214776,5.142248181,5.146912912,5.240688254,5.370172804,5.43153621,5.393627546,5.417876602,5.396804313,5.392262979,5.447168313,5.409411414,5.388615005) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = 'Retail prices in importing Member countries in US cents per lb (Arabica, 1977/1 - 2006/12)' > par5 = 'www.ico.org' > par4 = 'usa' > par3 = 'Prices paid to growers in exporting Member countries in US cents per lb (Arabica, 1977/1 - 2006/12)' > par2 = '36' > par1 = '0' > ylab = '' > xlab = '' > main = '' > #'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: > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > x <- as.ts(x) > y <- as.ts(y) > mylm <- lm(y~x) > cbind(mylm$resid) [,1] 1 0.005750241 2 0.048168767 3 -0.079364270 4 0.015835784 5 0.027920848 6 0.067495495 7 -0.050851874 8 -0.168846618 9 0.103521547 10 0.222397939 11 -0.025621298 12 -0.156865907 13 -0.082947083 14 0.002366607 15 0.062868063 16 0.069415485 17 0.035712409 18 0.079353422 19 -0.074361886 20 -0.268436975 21 0.103605884 22 0.156818013 23 -0.061322881 24 -0.139092362 25 -0.096683510 26 -0.118553105 27 0.066206429 28 0.030584102 29 -0.028358512 30 0.160547836 31 -0.091139882 32 -0.148073505 33 0.101588845 34 0.139801407 35 0.102497713 36 0.048079091 37 -0.024698607 38 -0.025950505 39 0.122312305 40 0.099340213 41 0.041523459 42 0.092725387 43 -0.165066157 44 -0.203126493 45 -0.083371247 46 -0.035707052 47 0.053610979 48 -0.117251702 49 -0.021438142 50 -0.042133131 51 0.185536359 52 0.022238852 53 0.077251621 54 0.243798238 55 -0.206951294 56 -0.121025075 57 0.023676063 58 0.057795323 59 0.080180680 60 -0.113286330 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1asfj1256656002.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(y,type='l',main='Run Sequence Plot of Y[t]',xlab='time or index',ylab='value') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2s6cp1256656002.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,type='l',main='Run Sequence Plot of X[t]',xlab='time or index',ylab='value') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/35wsf1256656002.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,y,main='Scatter Plot',xlab='X[t]',ylab='Y[t]') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/47fni1256656002.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mylm$resid,type='l',main='Run Sequence Plot of e[t]',xlab='time or index',ylab='value') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/58dir1256656002.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mylm$resid,main='Histogram of e[t]') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/68njp1256656002.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if (par1 > 0) + { + densityplot(~mylm$resid,col='black',main=paste('Density Plot of e[t] bw = ',par1),bw=par1) + } else { + densityplot(~mylm$resid,col='black',main='Density Plot of e[t]') + } > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/708hz1256656002.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mylm$resid,main='QQ plot of e[t]') > qqline(mylm$resid) > grid() > dev.off() null device 1 > if (par2 > 0) + { + postscript(file="/var/www/html/rcomp/tmp/84qaq1256656002.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + acf(mylm$resid,lag.max=par2,main='Residual Autocorrelation Function') + grid() + dev.off() + } null device 1 > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 4.386 4.487 4.704 4.771 4.958 5.447 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Model: Y[t] = c + b X[t] + e[t]',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'c',1,TRUE) > a<-table.element(a,mylm$coeff[[1]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'b',1,TRUE) > a<-table.element(a,mylm$coeff[[2]]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/94x9y1256656002.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Descriptive Statistics about e[t]',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'# observations',header=TRUE) > a<-table.element(a,length(mylm$resid)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'minimum',header=TRUE) > a<-table.element(a,min(mylm$resid)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Q1',header=TRUE) > a<-table.element(a,quantile(mylm$resid,0.25)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'median',header=TRUE) > a<-table.element(a,median(mylm$resid)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mean',header=TRUE) > a<-table.element(a,mean(mylm$resid)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Q3',header=TRUE) > a<-table.element(a,quantile(mylm$resid,0.75)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'maximum',header=TRUE) > a<-table.element(a,max(mylm$resid)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/10wkkd1256656002.tab") > > system("convert tmp/1asfj1256656002.ps tmp/1asfj1256656002.png") > system("convert tmp/2s6cp1256656002.ps tmp/2s6cp1256656002.png") > system("convert tmp/35wsf1256656002.ps tmp/35wsf1256656002.png") > system("convert tmp/47fni1256656002.ps tmp/47fni1256656002.png") > system("convert tmp/58dir1256656002.ps tmp/58dir1256656002.png") > system("convert tmp/68njp1256656002.ps tmp/68njp1256656002.png") > system("convert tmp/708hz1256656002.ps tmp/708hz1256656002.png") > system("convert tmp/84qaq1256656002.ps tmp/84qaq1256656002.png") > > > proc.time() user system elapsed 1.610 1.195 9.319