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(108.8,128.4,121.1,119.5,128.7,108.7,105.5,119.8,111.3,110.6,120.1,97.5,107.7,127.3,117.2,119.8,116.2,111,112.4,130.6,109.1,118.8,123.9,101.6,112.8,128,129.6,125.8,119.5,115.7,113.6,129.7,112,116.8,127,112.1,114.2,121.1,131.6,125,120.4,117.7,117.5,120.6,127.5,112.3,124.5,115.2,104.7,130.9,129.2,113.5,125.6,107.6,107,121.6,110.7,106.3,118.6,104.6) > x <- c(2.9248E+14,2.82995E+14,2.72346E+14,2.72346E+14,2.82995E+14,2.98272E+14,2.89432E+14,2.79588E+14,2.9248E+14,2.98272E+14,2.98272E+14,3.0103E+14,2.79588E+14,2.82995E+14,2.9248E+14,2.82995E+14,2.76042E+14,2.4609E+14,6.0206E+14,2.68485E+14,2.55751E+14,2.40824E+14,2.40824E+14,2.15836E+14,2.15836E+14,2.35218E+14,2.40824E+14,2.4609E+14,2.51055E+14,2.51055E+14,2.51055E+14,2.22789E+14,2.22789E+14,2.29226E+14,2.08279E+14,2.35218E+14,2.68485E+14,2.9248E+14,2.98272E+14,3.08814E+14,3.11261E+14,3.28691E+14,3.2465E+13,3.43201E+13,3.52686E+14,3.5417E+14,3.46479E+14,3.48073E+14,3.3442E+14,2.98272E+14,2.82995E+14,2.72346E+14,2.55751E+14,1.5563E+14,1.5563E+14,1.20412E+14,2.08279E+14,2.4609E+14,1.80618E+14,2.15836E+14) > par2 = '36' > par1 = '0' > #'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 -8.6531772 2 10.9525941 3 3.6590738 4 2.0590738 5 11.2525941 6 -8.7567015 7 -11.9513226 8 2.3546672 9 -6.1531772 10 -6.8567015 11 2.6432985 12 -19.9583796 13 -9.7453328 14 9.8525941 15 -0.2531772 16 2.3525941 17 -1.2431752 18 -6.4249502 19 -5.2415479 20 13.1614231 21 -8.3308287 22 1.3782540 23 6.4782540 24 -15.8065415 25 -4.6065415 26 10.5816651 27 12.1782540 28 8.3750498 29 2.0720287 30 -1.7279713 31 -3.8279713 32 12.2892278 33 -5.4107722 34 -0.6146889 35 9.5980567 36 -5.3183349 37 -3.2385769 38 3.6468228 39 14.1432985 40 7.5368840 41 2.9353951 42 0.2247894 43 0.2050346 44 3.3039058 45 10.0101891 46 -5.1907138 47 7.0139659 48 -2.2870040 49 -12.7786965 50 13.4432985 51 11.7525941 52 -3.9409262 53 8.1691713 54 -9.7699078 55 -10.3699078 56 4.2515213 57 -6.7019433 58 -11.1249502 59 1.2148877 60 -12.8065415 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1aen81256913743.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/29gmi1256913743.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/3fmis1256913743.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/4cdgx1256913743.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/5vcd71256913743.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/6tf561256913743.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/7w9vi1256913743.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/8xpxo1256913743.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. 3.246e+13 2.352e+14 2.723e+14 2.626e+14 2.939e+14 6.021e+14 > > #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/92x7e1256913743.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/1054861256913743.tab") > > system("convert tmp/1aen81256913743.ps tmp/1aen81256913743.png") > system("convert tmp/29gmi1256913743.ps tmp/29gmi1256913743.png") > system("convert tmp/3fmis1256913743.ps tmp/3fmis1256913743.png") > system("convert tmp/4cdgx1256913743.ps tmp/4cdgx1256913743.png") > system("convert tmp/5vcd71256913743.ps tmp/5vcd71256913743.png") > system("convert tmp/6tf561256913743.ps tmp/6tf561256913743.png") > system("convert tmp/7w9vi1256913743.ps tmp/7w9vi1256913743.png") > system("convert tmp/8xpxo1256913743.ps tmp/8xpxo1256913743.png") > > > proc.time() user system elapsed 1.684 1.237 3.630