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(-1.85995713 + ,-1.950522648 + ,-2.041741893 + ,-2.145809864 + ,-2.239242869 + ,-2.243922967 + ,-1.756284368 + ,-1.273331809 + ,-1.174660066 + ,-1.171688575 + ,-1.162132261 + ,-0.966016 + ,-0.757731484 + ,-0.740125402 + ,-0.731873573 + ,-0.83053343 + ,-0.844116114 + ,-0.735329416 + ,-0.212469739 + ,0.498031509 + ,0.688243419 + ,0.802860181 + ,0.810817833 + ,0.927036228 + ,1.043881608 + ,1.051863032 + ,0.945129634 + ,0.842155172 + ,0.752813909 + ,0.627452237 + ,0.922650308 + ,1.535647608 + ,1.523458554 + ,1.404922395 + ,1.212568041 + ,1.114561911 + ,1.106402198 + ,1.000637506 + ,0.78603263 + ,0.605504807 + ,0.430949681 + ,0.325811974 + ,0.83499388 + ,1.338238748 + ,1.566643226 + ,1.424436174 + ,1.331371633 + ,1.256816507 + ,1.384599944 + ,1.294676269 + ,1.10213471 + ,0.908416441 + ,0.615060694 + ,0.419217809 + ,0.705953075 + ,1.218519509 + ,1.220085485 + ,1.033350219 + ,0.850133198 + ,0.75755301 + ,0.690896105 + ,0.723121921 + ,0.540092104 + ,0.339292773 + ,0.268440124 + ,0.297153638 + ,0.750242288 + ,1.315713568 + ,1.411256332 + ,1.213327461 + ,0.999358484 + ,1.027911537 + ,1.144034845 + ,1.090604045 + ,1.055682661 + ,1.01036403 + ,0.833155363 + ,0.788597435 + ,1.159096049 + ,1.711011388 + ,1.735764332 + ,1.393254188 + ,1.05976209 + ,0.998531128 + ,1.035261723 + ,0.913388581 + ,0.776854104 + ,0.57453337 + ,0.342910767 + ,0.140328542 + ,0.318770377 + ,0.506985446 + ,0.245290931 + ,-0.108799112 + ,-0.334618821 + ,-0.446222492 + ,-0.699777667 + ,-1.067177017 + ,-1.477826839 + ,-1.543663611 + ,-1.849380759 + ,-1.939366836 + ,-1.405031262 + ,-0.866300854 + ,-1.098993193 + ,-1.195174828 + ,-1.375937398 + ,-1.604844058 + ,-1.912611535 + ,-2.110100625 + ,-2.158348718 + ,-1.953659706 + ,-1.969744384 + ,-2.254759157 + ,-2.034030039 + ,-1.840683206 + ,-1.526324537 + ,-0.815261677 + ,-0.80986545 + ,-0.716188782 + ,-0.691905761 + ,-0.884289831 + ,-0.987314808 + ,-1.16473148 + ,-1.368377499 + ,-1.540926442 + ,-0.915302851 + ,-0.842055181 + ,-0.686371992 + ,-0.523610712 + ,-0.393447111 + ,-0.307303171 + ,-0.22173273 + ,-0.375489966 + ,-0.61431249 + ,-0.655426461 + ,-0.932543012 + ,-0.917911393 + ,-0.214960702 + ,-0.087679447 + ,-0.078149877 + ,-0.070007993 + ,-0.054057031 + ,0.152527792 + ,0.498205545 + ,0.424892502 + ,-0.08450038 + ,-0.865432324 + ,-1.184809415 + ,-0.970837466 + ,0.427210265 + ,0.942005317 + ,0.985923947 + ,0.418943151 + ,-0.05356759 + ,0.067877658 + ,0.285828433 + ,0.415165959 + ,0.322784861 + ,0.026674542 + ,-0.090574961 + ,-0.279862737 + ,0.439267719 + ,0.56763654 + ,0.573534949 + ,0.378975748 + ,0.299380974 + ,0.438063839 + ,0.689429025 + ,0.732821702 + ,0.663992638 + ,0.557321642 + ,0.329255913 + ,-0.03936769 + ,0.199704439 + ,0.147444407 + ,0.17948599 + ,0.129531835 + ,0.047726272 + ,0.074808437) > x <- c(0.120752452 + ,0.105369762 + ,0.559667132 + ,0.617676236 + ,0.620890174 + ,0.488599698 + ,0.402549931 + ,-0.095793222 + ,0.153556719 + ,-0.00498901 + ,0.069687925 + ,0.237787193 + ,0.681841701 + ,0.620458256 + ,0.784496766 + ,0.765152642 + ,0.53850517 + ,0.232805449 + ,0.443993156 + ,1.059132549 + ,0.684342181 + ,0.591495739 + ,0.405390277 + ,0.583327688 + ,0.31157195 + ,0.395478121 + ,0.202182743 + ,0.300727018 + ,0.455943488 + ,0.643531286 + ,0.591181184 + ,0.327542165 + ,0.341576746 + ,-0.007494997 + ,-0.133753157 + ,-0.262777342 + ,-0.24677077 + ,-0.309592055 + ,-0.396739797 + ,-0.41720996 + ,-0.734757037 + ,-0.847271472 + ,-0.922777775 + ,-0.831189711 + ,-0.907288335 + ,-0.897944799 + ,-0.644550531 + ,-0.642097609 + ,-0.128500176 + ,-0.203568743 + ,-0.049918523 + ,-0.036844194 + ,-0.173592444 + ,-0.271557919 + ,-0.158049785 + ,-0.151899673 + ,-0.101133272 + ,0.395358593 + ,0.303572316 + ,0.47720363 + ,0.273522005 + ,-0.040706427 + ,-0.552401086 + ,-0.752792285 + ,-0.418527341 + ,-0.244474721 + ,-0.068492716 + ,-0.125391345 + ,-0.357572751 + ,-0.676559124 + ,-0.563395652 + ,-0.819421562 + ,-1.541530688 + ,-1.198739354 + ,-0.886889366 + ,-0.370127872 + ,-0.008973614 + ,-0.251839827 + ,-0.777337249 + ,-1.390870261 + ,-1.047696764 + ,-1.028501564 + ,-1.275952072 + ,-1.246978199 + ,-0.869001956 + ,-0.849706844 + ,-0.617587106 + ,-0.678722891 + ,-1.024199243 + ,-1.125463004 + ,-1.22601374 + ,-0.971781378 + ,-0.673034372 + ,-0.589506466 + ,-0.323202046 + ,0.081119026 + ,-0.095091299 + ,0.031922928 + ,0.336710821 + ,0.133430574 + ,0.250632556 + ,0.845533449 + ,0.90233755 + ,1.011292518 + ,1.475292629 + ,1.087161367 + ,1.226576317 + ,0.602429169 + ,0.308627705 + ,0.359856564 + ,0.176243567 + ,0.878538406 + ,1.220666437 + ,1.018000326 + ,0.74814532 + ,0.764889207 + ,0.312975664 + ,0.408389915 + ,0.191030871 + ,0.237936183 + ,0.969820485 + ,0.703547781 + ,0.742067333 + ,-0.106880207 + ,-0.588664598 + ,-1.074170623 + ,-0.710571025 + ,-0.743663826 + ,-0.765352823 + ,-0.753577746 + ,-0.928815442 + ,-0.665596707 + ,-0.832658647 + ,-0.328967863 + ,-0.327967912 + ,-0.579148625 + ,-1.007949285 + ,-0.420788455 + ,-0.549344363 + ,-0.235992702 + ,-0.221328855 + ,-0.437344153 + ,-0.149537626 + ,-0.266314962 + ,-0.393959909 + ,-0.710899102 + ,-0.845496052 + ,-0.046163995 + ,0.634352704 + ,0.291190686 + ,0.44023523 + ,0.297476045 + ,0.088970169 + ,0.935130028 + ,0.638583488 + ,0.369078962 + ,0.367864213 + ,0.69222223 + ,1.19595098 + ,0.887854621 + ,0.629412578 + ,0.994655225 + ,1.274017821 + ,1.257901746 + ,1.310788474 + ,0.623451244 + ,0.733437722 + ,1.072369422 + ,0.837507949 + ,0.608744668 + ,-0.06600003 + ,0.200735132 + ,0.416999542 + ,0.063414609 + ,-0.187463182 + ,-0.134098865 + ,-0.528417462 + ,-0.51392463 + ,-0.225020129 + ,-0.061765904) > 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 -1.788227000 2 -1.887930240 3 -1.709284908 4 -1.778893947 5 -1.870417788 6 -1.953681906 7 -1.517159130 8 -1.330235500 9 -1.083443339 10 -1.174652178 11 -1.120735802 12 -0.824764158 13 -0.352699594 14 -0.371556892 15 -0.265861877 16 -0.376012652 17 -0.524229891 18 -0.597036861 19 0.051273864 20 1.127184078 21 1.094760659 22 1.154224195 23 1.051630311 24 1.273548205 25 1.228963535 26 1.286787429 27 1.065231497 28 1.020794924 29 1.023656323 30 1.009726733 31 1.273827468 32 1.730216262 33 1.726364118 34 1.400470170 35 1.133115151 36 0.958465264 37 0.959813875 38 0.816731689 39 0.550358764 40 0.357671126 41 -0.005515309 42 -0.177489547 43 0.286839630 44 0.844490215 45 1.027690111 46 0.891033365 47 0.948491678 48 0.875393652 49 1.308267462 50 1.173751086 51 1.072481795 52 0.886530021 53 0.511942220 54 0.257905268 55 0.612067349 56 1.128287111 57 1.160009664 58 1.268203614 59 1.030463132 60 1.041024507 61 0.853375364 62 0.698941234 63 0.211951341 64 -0.107885628 65 0.019823884 66 0.151929229 67 0.709555815 68 1.241227814 69 1.198848721 70 0.811433561 71 0.664686660 72 0.541153594 73 0.228325104 74 0.378521365 75 0.528847070 76 0.790498347 77 0.827824800 78 0.638997959 79 0.697337294 80 0.884797900 81 1.113404920 82 0.782297229 83 0.301813026 84 0.257793306 85 0.519051723 86 0.408640385 87 0.409991132 88 0.171354135 89 -0.265490500 90 -0.528226060 91 -0.409514005 92 -0.070278232 93 -0.154509174 94 -0.458981445 95 -0.526609330 96 -0.398035659 97 -0.756264398 98 -1.048213959 99 -1.277811762 100 -1.464402343 101 -1.700498434 102 -1.437097746 103 -0.869019043 104 -0.265566521 105 -0.222630600 106 -0.549372405 107 -0.647318830 108 -1.246985299 109 -1.729278567 110 -1.896336369 111 -2.053655407 112 -1.431784804 113 -1.244636440 114 -1.650040210 115 -1.589612057 116 -1.386318915 117 -1.340408767 118 -0.572667335 119 -0.696388092 120 -0.574848436 121 -0.115806905 122 -0.466363959 123 -0.546507310 124 -1.228221132 125 -1.718059741 126 -2.179012022 127 -1.337400714 128 -1.283811038 129 -1.141011683 130 -0.971255698 131 -0.945187893 132 -0.702685107 133 -0.716353849 134 -0.570905522 135 -0.809134049 136 -0.999455965 137 -1.531291377 138 -1.167870794 139 -0.541285691 140 -0.227865314 141 -0.209625034 142 -0.329801914 143 -0.142886311 144 -0.005670294 145 0.264183006 146 0.002599752 147 -0.586747255 148 -0.892854950 149 -0.807987238 150 -0.797862546 151 0.688721561 152 1.118713906 153 1.038774566 154 0.974434963 155 0.325767784 156 0.287120261 157 0.504349443 158 0.826364156 159 1.033211174 160 0.554083520 161 0.283312652 162 0.310988607 163 1.196067787 164 1.314863236 165 1.352177751 166 0.749322172 167 0.735062256 168 1.075079458 169 1.186930757 170 1.094432033 171 0.624786886 172 0.676563586 173 0.576964600 174 -0.001697746 175 0.088346382 176 0.067786157 177 -0.134407870 178 -0.175752902 179 -0.085941598 180 0.038117867 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/11g511257788012.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/2atbo1257788012.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/3n0q51257788012.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/4su3j1257788012.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/5z9xm1257788012.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/6a1iu1257788012.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/7z0tz1257788012.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/8cldt1257788012.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. -1.542e+00 -5.501e-01 -2.291e-02 -5.556e-12 5.011e-01 1.475e+00 > > #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/9cv2x1257788012.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/109rnd1257788012.tab") > > system("convert tmp/11g511257788012.ps tmp/11g511257788012.png") > system("convert tmp/2atbo1257788012.ps tmp/2atbo1257788012.png") > system("convert tmp/3n0q51257788012.ps tmp/3n0q51257788012.png") > system("convert tmp/4su3j1257788012.ps tmp/4su3j1257788012.png") > system("convert tmp/5z9xm1257788012.ps tmp/5z9xm1257788012.png") > system("convert tmp/6a1iu1257788012.ps tmp/6a1iu1257788012.png") > system("convert tmp/7z0tz1257788012.ps tmp/7z0tz1257788012.png") > system("convert tmp/8cldt1257788012.ps tmp/8cldt1257788012.png") > > > proc.time() user system elapsed 1.668 1.223 2.282