R version 2.8.1 (2008-12-22) Copyright (C) 2008 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(-7.941,-6.714,-11.573,-15.211,-16.665,-15.757,7.47,12.053,1.654,3.157,6.243,14.421,19.924,22.151,17.2,22.562,19.47,22.335,46.243,55.961,44.519,41.611,37.47,45.697,54.378,54.789,50.887,48.292,49.562,47.887,66.427,78.967,73.114,82.887,77.022,84.611,86.2,86.838,80.163,77.114,77.476,75.298,96.519,99.243,88.936,86.341,77.163,85.66,89.795,88.114,76.623,82.476,79.482,77.574,97.568,100.746,88.255,69.347,59.12,64.249,-7.941,-6.714,-11.573,-15.211,-16.665,-15.757,7.47,12.053,1.654,3.157,6.243,14.421,19.924,22.151,17.2,22.562,19.47,22.335,46.243,55.961,44.519,41.611,37.47,45.697,54.378,54.789,50.887,48.292,49.562,47.887,66.427,78.967,73.114,82.887,77.022,84.611,86.2,86.838,80.163,77.114,77.476,75.298,96.519,99.243,88.936,86.341,77.163,85.66,89.795,88.114,76.623,82.476,79.482,77.574,97.568,100.746,88.255,69.347,59.12,64.249) > x <- c(-355.051 + ,-353.784 + ,-354.293 + ,-350.691 + ,-350.155 + ,-350.167 + ,-349.02 + ,-341.187 + ,-348.266 + ,-351.553 + ,-349.377 + ,-344.289 + ,-343.656 + ,-339.999 + ,-344.7 + ,-347.988 + ,-347.58 + ,-346.825 + ,-345.237 + ,-337.099 + ,-350.251 + ,-349.859 + ,-345.32 + ,-343.773 + ,-341.272 + ,-342.001 + ,-346.253 + ,-342.508 + ,-337.708 + ,-344.583 + ,-338.033 + ,-329.933 + ,-338.326 + ,-332.973 + ,-335.128 + ,-338.169 + ,-334.62 + ,-333.972 + ,-334.277 + ,-331.626 + ,-333.494 + ,-330.872 + ,-322.131 + ,-313.857 + ,-322.424 + ,-321.669 + ,-328.637 + ,-326.1 + ,-320.355 + ,-323.196 + ,-330.737 + ,-315.004 + ,-318.118 + ,-318.776 + ,-310.722 + ,-308.044 + ,-323.375 + ,-330.393 + ,-331.46 + ,-322.721 + ,-355.051 + ,-353.784 + ,-354.293 + ,-350.691 + ,-350.155 + ,-350.167 + ,-349.02 + ,-341.187 + ,-348.266 + ,-351.553 + ,-349.377 + ,-344.289 + ,-343.656 + ,-339.999 + ,-344.7 + ,-347.988 + ,-347.58 + ,-346.825 + ,-345.237 + ,-337.099 + ,-350.251 + ,-349.859 + ,-345.32 + ,-343.773 + ,-341.272 + ,-342.001 + ,-346.253 + ,-342.508 + ,-337.708 + ,-344.583 + ,-338.033 + ,-329.933 + ,-338.326 + ,-332.973 + ,-335.128 + ,-338.169 + ,-334.62 + ,-333.972 + ,-334.277 + ,-331.626 + ,-333.494 + ,-330.872 + ,-322.131 + ,-313.857 + ,-322.424 + ,-321.669 + ,-328.637 + ,-326.1 + ,-320.355 + ,-323.196 + ,-330.737 + ,-315.004 + ,-318.118 + ,-318.776 + ,-310.722 + ,-308.044 + ,-323.375 + ,-330.393 + ,-331.46 + ,-322.721) > 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 -13.8139707 2 -15.7537196 3 -19.3405213 4 -31.9813859 5 -34.7750681 6 -33.8370753 7 -13.4768953 8 -28.4717515 9 -21.1774483 10 -11.4588969 11 -13.8116069 12 -18.3505905 13 -14.4297153 14 -21.3430472 15 -14.5443342 16 -0.9642835 17 -5.0760416 18 -4.0980940 19 15.8408475 20 5.2186720 21 26.6488749 22 22.7611073 23 7.2752982 24 11.6357154 25 14.0656981 26 16.2987659 27 23.0242451 28 11.0689653 29 0.3418110 30 15.8502352 31 18.0191183 32 10.3139203 33 25.4384446 34 21.8321181 35 21.3533405 36 36.5430377 37 29.2616417 38 28.2800258 39 22.3673450 40 12.6924166 41 17.7233092 42 8.9918636 43 8.3655456 44 -9.5905492 45 1.5148719 46 -2.9671805 47 5.2706886 48 7.4266927 49 -2.7974015 50 2.6224143 51 9.9794437 52 -23.4907292 53 -18.7015753 54 -18.9649654 55 -19.1011906 56 -22.6166030 57 3.2108081 58 1.8436476 59 -5.7164850 60 -22.4298041 61 -13.8139707 62 -15.7537196 63 -19.3405213 64 -31.9813859 65 -34.7750681 66 -33.8370753 67 -13.4768953 68 -28.4717515 69 -21.1774483 70 -11.4588969 71 -13.8116069 72 -18.3505905 73 -14.4297153 74 -21.3430472 75 -14.5443342 76 -0.9642835 77 -5.0760416 78 -4.0980940 79 15.8408475 80 5.2186720 81 26.6488749 82 22.7611073 83 7.2752982 84 11.6357154 85 14.0656981 86 16.2987659 87 23.0242451 88 11.0689653 89 0.3418110 90 15.8502352 91 18.0191183 92 10.3139203 93 25.4384446 94 21.8321181 95 21.3533405 96 36.5430377 97 29.2616417 98 28.2800258 99 22.3673450 100 12.6924166 101 17.7233092 102 8.9918636 103 8.3655456 104 -9.5905492 105 1.5148719 106 -2.9671805 107 5.2706886 108 7.4266927 109 -2.7974015 110 2.6224143 111 9.9794437 112 -23.4907292 113 -18.7015753 114 -18.9649654 115 -19.1011906 116 -22.6166030 117 3.2108081 118 1.8436476 119 -5.7164850 120 -22.4298041 > library(lattice) > postscript(file="/var/www/rcomp/tmp/18tmg1257943814.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/rcomp/tmp/2onf41257943814.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/rcomp/tmp/3t7sl1257943814.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/rcomp/tmp/4ujsx1257943814.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/rcomp/tmp/50zf71257943814.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/rcomp/tmp/6896b1257943814.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/rcomp/tmp/7rvyi1257943814.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/rcomp/tmp/89f9h1257943814.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. -355.1 -346.4 -338.1 -336.6 -329.6 -308.0 > > #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,'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/rcomp/tmp/9bi4v1257943814.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/rcomp/tmp/10cbxw1257943814.tab") > > system("convert tmp/18tmg1257943814.ps tmp/18tmg1257943814.png") > system("convert tmp/2onf41257943814.ps tmp/2onf41257943814.png") > system("convert tmp/3t7sl1257943814.ps tmp/3t7sl1257943814.png") > system("convert tmp/4ujsx1257943814.ps tmp/4ujsx1257943814.png") > system("convert tmp/50zf71257943814.ps tmp/50zf71257943814.png") > system("convert tmp/6896b1257943814.ps tmp/6896b1257943814.png") > system("convert tmp/7rvyi1257943814.ps tmp/7rvyi1257943814.png") > system("convert tmp/89f9h1257943814.ps tmp/89f9h1257943814.png") > > > proc.time() user system elapsed 2.150 1.960 3.626