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(3.88 + ,3.98 + ,3.29 + ,2.88 + ,3.22 + ,3.62 + ,3.82 + ,3.54 + ,2.53 + ,2.22 + ,2.85 + ,2.78 + ,2.28 + ,2.26 + ,2.71 + ,2.77 + ,2.77 + ,2.64 + ,2.56 + ,2.07 + ,2.32 + ,2.16 + ,2.23 + ,2.4 + ,2.84 + ,2.77 + ,2.93 + ,2.91 + ,2.69 + ,2.38 + ,2.58 + ,3.19 + ,2.82 + ,2.72 + ,2.53 + ,2.7 + ,2.42 + ,2.5 + ,2.31 + ,2.41 + ,2.56 + ,2.76 + ,2.71 + ,2.44 + ,2.46 + ,2.12 + ,1.99 + ,1.86 + ,1.88 + ,1.82 + ,1.74 + ,1.71 + ,1.38 + ,1.27 + ,1.19 + ,1.28 + ,1.19 + ,1.22 + ,1.47 + ,1.46 + ,1.96 + ,1.88 + ,2.03 + ,2.04 + ,1.9 + ,1.8 + ,1.92 + ,1.92 + ,1.97 + ,2.46 + ,2.36 + ,2.53 + ,2.31 + ,1.98 + ,1.46 + ,1.26 + ,1.58 + ,1.74 + ,1.89 + ,1.85 + ,1.62 + ,1.3 + ,1.42 + ,1.15 + ,0.42 + ,0.74 + ,1.02 + ,1.51 + ,1.86 + ,1.59 + ,1.03 + ,0.44 + ,0.82 + ,0.86 + ,0.58 + ,0.59 + ,0.95 + ,0.98 + ,1.23 + ,1.17 + ,0.84 + ,0.74 + ,0.65 + ,0.91 + ,1.19 + ,1.3 + ,1.53 + ,1.94 + ,1.79 + ,1.95 + ,2.26 + ,2.04 + ,2.16 + ,2.75 + ,2.79 + ,2.88 + ,3.36 + ,2.97 + ,3.1 + ,2.49 + ,2.2 + ,2.25 + ,2.09 + ,2.79 + ,3.14 + ,2.93 + ,2.65 + ,2.67 + ,2.26 + ,2.35 + ,2.13 + ,2.18 + ,2.9 + ,2.63 + ,2.67 + ,1.81 + ,1.33 + ,0.88 + ,1.28 + ,1.26 + ,1.26 + ,1.29 + ,1.1 + ,1.37 + ,1.21 + ,1.74 + ,1.76 + ,1.48 + ,1.04 + ,1.62 + ,1.49 + ,1.79 + ,1.8 + ,1.58 + ,1.86 + ,1.74 + ,1.59 + ,1.26 + ,1.13 + ,1.92 + ,2.61 + ,2.26 + ,2.41 + ,2.26 + ,2.03 + ,2.86 + ,2.55 + ,2.27 + ,2.26 + ,2.57 + ,3.07 + ,2.76 + ,2.51 + ,2.87 + ,3.14 + ,3.11 + ,3.16 + ,2.47 + ,2.57 + ,2.89 + ,2.63 + ,2.38 + ,1.69 + ,1.96 + ,2.19 + ,1.87 + ,1.6 + ,1.63 + ,1.22 + ,1.21 + ,1.49 + ,1.64 + ,1.66 + ,1.77 + ,1.82 + ,1.78 + ,1.28 + ,1.29 + ,1.37 + ,1.12 + ,1.51 + ,2.24 + ,2.94 + ,3.09 + ,3.46 + ,3.64 + ,4.39 + ,4.15 + ,5.21 + ,5.8 + ,5.91 + ,5.39 + ,5.46 + ,4.72 + ,3.14 + ,2.63 + ,2.32 + ,1.93 + ,0.62 + ,0.6 + ,-0.37 + ,-1.1 + ,-1.68 + ,-0.78) > x <- c(153.3 + ,154.5 + ,155.2 + ,156.9 + ,157 + ,157.4 + ,157.2 + ,157.5 + ,158 + ,158.5 + ,159 + ,159.3 + ,160 + ,160.8 + ,161.9 + ,162.5 + ,162.7 + ,162.8 + ,162.9 + ,163 + ,164 + ,164.7 + ,164.8 + ,164.9 + ,165 + ,165.8 + ,166.1 + ,167.2 + ,167.7 + ,168.3 + ,168.6 + ,168.9 + ,169.1 + ,169.5 + ,169.6 + ,169.7 + ,169.8 + ,170.4 + ,170.9 + ,171.9 + ,171.9 + ,172 + ,172 + ,172.4 + ,173 + ,173.7 + ,173.8 + ,173.8 + ,173.9 + ,174.6 + ,175 + ,175.9 + ,176 + ,175.1 + ,175.6 + ,175.9 + ,176.7 + ,176.1 + ,176.1 + ,176.2 + ,176.3 + ,177.8 + ,178.5 + ,179.4 + ,179.5 + ,179.6 + ,179.7 + ,179.7 + ,179.8 + ,179.9 + ,180.2 + ,180.4 + ,180.4 + ,181.3 + ,181.9 + ,182.5 + ,182.7 + ,183.1 + ,183.6 + ,183.7 + ,183.8 + ,183.9 + ,184.1 + ,184.4 + ,184.5 + ,185.9 + ,186.6 + ,187.6 + ,187.8 + ,187.9 + ,188 + ,188.3 + ,188.4 + ,188.5 + ,188.5 + ,188.6 + ,188.6 + ,189.4 + ,190 + ,191.9 + ,192.5 + ,193 + ,193.5 + ,193.9 + ,194.2 + ,194.9 + ,194.9 + ,194.9 + ,194.9 + ,195.5 + ,196 + ,196.2 + ,196.2 + ,196.2 + ,196.2 + ,197 + ,197.7 + ,198 + ,198.2 + ,198.5 + ,198.6 + ,199.5 + ,200 + ,201.3 + ,202.2 + ,202.9 + ,203.5 + ,203.5 + ,204 + ,204.1 + ,204.3 + ,204.5 + ,204.8 + ,205.1 + ,205.7 + ,206.5 + ,206.9 + ,207.1 + ,207.8 + ,208 + ,208.5 + ,208.6 + ,209 + ,209.1 + ,209.7 + ,209.8 + ,209.9 + ,210 + ,210.8 + ,211.4 + ,211.7 + ,212 + ,212.2 + ,212.4 + ,212.9 + ,213.4 + ,213.7 + ,214 + ,214.3 + ,214.8 + ,215 + ,215.9 + ,216.4 + ,216.9 + ,217.2 + ,217.5 + ,217.9 + ,218.1 + ,218.6 + ,218.9 + ,219.3 + ,220.4 + ,220.9 + ,221 + ,221.8 + ,222 + ,222.2 + ,222.5 + ,222.9 + ,223.1 + ,223.4 + ,224 + ,225.1 + ,225.5 + ,225.9 + ,226.3 + ,226.5 + ,227 + ,227.3 + ,227.8 + ,228.1 + ,228.4 + ,228.5 + ,228.8 + ,229 + ,229.1 + ,229.3 + ,229.6 + ,229.9 + ,230 + ,230.2 + ,230.8 + ,231 + ,231.7 + ,231.9 + ,233 + ,235.1 + ,236 + ,236.9 + ,237.1 + ,237.5 + ,238.2 + ,238.9 + ,239.1 + ,240 + ,240.2 + ,240.5 + ,240.7 + ,241.1 + ,241.4 + ,242.2 + ,242.9 + ,243.2 + ,243.9) > 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.690383699 2 1.792545108 3 1.103805929 4 0.696867925 5 1.037048043 6 1.437768512 7 1.637408278 8 1.357948630 9 0.348849217 10 0.039749804 11 0.670650391 12 0.601190743 13 0.102451565 14 0.083892504 15 0.535873796 16 0.596954500 17 0.597314735 18 0.467494852 19 0.387674970 20 -0.102144913 21 0.149656261 22 -0.009082917 23 0.061097201 24 0.231277318 25 0.671457435 26 0.602898375 27 0.763438727 28 0.745420018 29 0.526320605 30 0.217401310 31 0.417941662 32 1.028482014 33 0.658842249 34 0.559562719 35 0.369742836 36 0.539922954 37 0.260103071 38 0.341183775 39 0.152084363 40 0.253885537 41 0.403885537 42 0.604065654 43 0.554065654 44 0.284786124 45 0.305866828 46 -0.032872350 47 -0.162692233 48 -0.292692233 49 -0.272512115 50 -0.331251293 51 -0.410530824 52 -0.438909767 53 -0.768729650 54 -0.880350706 55 -0.959450119 56 -0.868909767 57 -0.957468828 58 -0.928549532 59 -0.678549532 60 -0.688369415 61 -0.188189297 62 -0.265487536 63 -0.114226714 64 -0.102605658 65 -0.242425540 66 -0.342245423 67 -0.222065306 68 -0.222065306 69 -0.171885188 70 0.318294929 71 0.218835281 72 0.389195516 73 0.169195516 74 -0.159183427 75 -0.678102723 76 -0.877022018 77 -0.556661783 78 -0.395941314 79 -0.245040727 80 -0.284860609 81 -0.514680492 82 -0.834500374 83 -0.714140140 84 -0.983599787 85 -1.713419670 86 -1.390898026 87 -1.109637204 88 -0.617836030 89 -0.267475796 90 -0.537295678 91 -1.097115561 92 -1.686575209 93 -1.306395091 94 -1.266214974 95 -1.546214974 96 -1.536034856 97 -1.176034856 98 -1.144593917 99 -0.893513213 100 -0.950090982 101 -1.279010277 102 -1.378109690 103 -1.467209103 104 -1.206488634 105 -0.925948281 106 -0.814687460 107 -0.584687460 108 -0.174687460 109 -0.324687460 110 -0.163606755 111 0.147293832 112 -0.072345933 113 0.047654067 114 0.637654067 115 0.677654067 116 0.769095006 117 1.250355828 118 0.860896180 119 0.991256415 120 0.381796767 121 0.091976885 122 0.143597941 123 -0.015501472 124 0.686840055 125 1.038461111 126 0.829721933 127 0.550802638 128 0.570802638 129 0.161703225 130 0.251883342 131 0.032243577 132 0.082603812 133 0.803144164 134 0.533684516 135 0.574765220 136 -0.283793840 137 -0.763073371 138 -1.212713136 139 -0.811452314 140 -0.831092079 141 -0.830191492 142 -0.800011375 143 -0.989290905 144 -0.719110788 145 -0.878030083 146 -0.347849966 147 -0.327669848 148 -0.607489731 149 -1.046048792 150 -0.464968087 151 -0.594427735 152 -0.293887383 153 -0.283527148 154 -0.503166913 155 -0.222266326 156 -0.341365739 157 -0.490825387 158 -0.820285035 159 -0.949744682 160 -0.158844095 161 0.531516139 162 0.183137196 163 0.334037783 164 0.184938370 165 -0.044521278 166 0.786019075 167 0.476739544 168 0.197099779 169 0.188000366 170 0.498540718 171 0.999261188 172 0.691242479 173 0.442143066 174 0.802323184 175 1.073764123 176 1.044124358 177 1.094484593 178 0.405024945 179 0.505745415 180 0.826105649 181 0.566646002 182 0.317726706 183 -0.370292002 184 -0.099571533 185 0.131148937 186 -0.188130593 187 -0.457770359 188 -0.426869772 189 -0.836329419 190 -0.845428832 191 -0.564888480 192 -0.414348128 193 -0.394168010 194 -0.283627658 195 -0.233267423 196 -0.273087306 197 -0.772727071 198 -0.762186719 199 -0.681646367 200 -0.931466249 201 -0.541106015 202 0.189974690 203 0.890334925 204 1.041595747 205 1.411955981 206 1.593937273 207 2.347719738 208 2.109340795 209 3.170961852 210 3.761322087 211 3.872042556 212 3.353303378 213 3.424564200 214 2.684924435 215 1.106545491 216 0.596905726 217 0.287446078 218 -0.102193687 219 -1.411473217 220 -1.430932865 221 -2.399491926 222 -3.128231104 223 -3.707690752 224 -2.806429930 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/12v901256475355.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/22w8p1256475355.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/3dpt41256475355.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/4insu1256475355.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/5pcig1256475355.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/6h7gi1256475355.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/7uo9l1256475355.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/8cpo31256475355.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. 153.3 176.1 196.2 197.5 218.2 243.9 > > #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/9vt2y1256475355.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/10xwie1256475355.tab") > > system("convert tmp/12v901256475355.ps tmp/12v901256475355.png") > system("convert tmp/22w8p1256475355.ps tmp/22w8p1256475355.png") > system("convert tmp/3dpt41256475355.ps tmp/3dpt41256475355.png") > system("convert tmp/4insu1256475355.ps tmp/4insu1256475355.png") > system("convert tmp/5pcig1256475355.ps tmp/5pcig1256475355.png") > system("convert tmp/6h7gi1256475355.ps tmp/6h7gi1256475355.png") > system("convert tmp/7uo9l1256475355.ps tmp/7uo9l1256475355.png") > system("convert tmp/8cpo31256475355.ps tmp/8cpo31256475355.png") > > > proc.time() user system elapsed 1.639 1.208 2.656