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(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) > x <- c(4.1,4.1,4,3.9,3.8,3.8,4,4.4,4.6,4.6,4.6,4.7,4.8,4.8,4.7,4.7,4.7,4.6,5,5.4,5.5,5.6,5.6,5.8,6,6.1,6.1,6,6,6.1,6.5,7.1,7.4,7.4,7.5,7.6,7.8,7.8,7.7,7.6,7.5,7.3,7.6,8,8,7.9,7.8,7.7,7.8,7.7,7.5,7.3,7.1,7,7.3,7.8,7.9,7.9,7.8,7.8,7.9,7.8,7.6,7.4,7.2,6.9,7.1,7.5,7.6,7.4,7.3,7.2,7.3,7.2,7.1,7,6.9,6.8,7.2,7.6,7.7,7.6,7.5,7.5,7.6,7.6,7.6,7.5,7.3,7.2,7.4,8,8.2,8,7.7,7.7,7.8,7.8,7.7,7.5,7.3,7.1,7.1,7.2,6.8,6.6,6.4,6.4,6.5,6.3,5.9,5.5,5.2,4.9,5.4,5.8,5.7,5.6,5.5,5.4,5.4,5.4,5.5,5.8,5.7,5.4,5.6,5.8,6.2,6.8,6.7,6.7,6.4,6.3,6.3,6.4,6.3,6,6.3,6.3,6.6,7.5,7.8,7.9,7.8,7.6,7.5,7.6,7.5,7.3,7.6,7.5,7.6,7.9,7.9,8.1,8.2,8,7.5,6.8,6.5,6.6,7.6,8,8.1,7.7,7.5,7.6,7.8,7.8,7.8,7.5,7.5,7.1,7.5,7.5,7.6,7.7,7.7,7.9,8.1,8.2,8.2,8.2,7.9,7.3,6.9,6.6,6.7,6.9,7,7.1,7.2,7.1,6.9,7,6.8,6.4,6.7,6.6,6.4,6.3,6.2,6.5,6.8,6.8,6.4,6.1,5.8,6.1,7.2,7.3,6.9,6.1,5.8,6.2,7.1,7.7,7.9,7.7,7.4,7.5,8,8.1) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > 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 -22.55812594 2 -21.35812594 3 -19.86358022 4 -17.36903450 5 -16.47448878 6 -16.07448878 7 -17.86358022 8 -20.74176309 9 -21.83085453 10 -21.33085453 11 -20.83085453 12 -21.32540024 13 -21.41994596 14 -20.61994596 15 -18.72540024 16 -18.12540024 17 -17.92540024 18 -17.03085453 19 -20.10903740 20 -23.18722027 21 -22.98176599 22 -23.07631170 23 -22.97631170 24 -24.46540314 25 -25.95449458 26 -25.94904029 27 -25.64904029 28 -23.75449458 29 -23.25449458 30 -23.44904029 31 -26.32722316 32 -30.79449747 33 -32.97813462 34 -32.57813462 35 -33.27268034 36 -33.96722606 37 -35.45631750 38 -34.85631750 39 -33.56177178 40 -31.76722606 41 -30.97268034 42 -29.28358891 43 -31.66722606 44 -34.44540893 45 -33.84540893 46 -32.35086321 47 -31.45631750 48 -30.66177178 49 -31.35631750 50 -29.86177178 51 -27.87268034 52 -25.38358891 53 -23.69449747 54 -23.79995175 55 -25.68358891 56 -29.35631750 57 -29.35086321 58 -29.95086321 59 -29.15631750 60 -29.05631750 61 -29.75086321 62 -27.45631750 63 -25.16722606 64 -22.67813462 65 -20.98904319 66 -18.50540604 67 -19.99449747 68 -23.17268034 69 -23.86722606 70 -22.17813462 71 -21.08358891 72 -20.08904319 73 -20.88358891 74 -19.18904319 75 -17.79449747 76 -16.39995175 77 -15.40540604 78 -14.21086032 79 -16.88904319 80 -19.96722606 81 -20.66177178 82 -19.76722606 83 -18.77268034 84 -18.47268034 85 -19.16722606 86 -17.76722606 87 -17.06722606 88 -15.27268034 89 -13.48358891 90 -12.58904319 91 -14.07813462 92 -18.54540893 93 -20.03450037 94 -18.34540893 95 -15.96177178 96 -15.86177178 97 -16.65631750 98 -15.85631750 99 -14.46177178 100 -10.97268034 101 -8.78358891 102 -6.69449747 103 -6.19449747 104 -6.58904319 105 -3.11086032 106 -0.82176888 107 0.76732255 108 0.76732255 109 -0.02722316 110 2.16186827 111 5.84005114 112 9.21823401 113 11.60187117 114 13.98550832 115 10.01277973 116 7.63459686 117 9.12914258 118 10.22368830 119 11.21823401 120 12.31277973 121 12.41277973 122 13.31277973 123 13.01823401 124 11.93459686 125 13.62914258 126 16.71277973 127 15.72368830 128 14.13459686 129 11.45641399 130 6.78913968 131 7.78368540 132 7.98368540 133 10.66732255 134 11.76186827 135 12.36186827 136 12.36732255 137 13.56186827 138 16.14550542 139 14.46186827 140 14.66186827 141 12.77823112 142 5.72731966 143 3.74368250 144 3.04913679 145 4.44368250 146 6.13277394 147 7.02731966 148 6.33277394 149 7.92731966 150 10.11641109 151 8.03277394 152 9.12731966 153 8.53277394 154 6.34913679 155 6.84913679 156 5.76004535 157 5.26549963 158 7.15459107 159 11.42731966 160 17.48913968 161 20.07277684 162 20.17823112 163 12.73277394 164 10.05459107 165 9.56004535 166 13.03822822 167 15.02731966 168 14.43277394 169 13.34368250 170 13.64368250 171 14.04368250 172 17.52731966 173 18.02731966 174 21.30550253 175 18.92731966 176 19.12731966 177 18.53277394 178 18.03822822 179 18.43822822 180 17.04913679 181 15.76004535 182 15.56549963 183 16.66549963 184 17.06549963 185 19.84913679 186 25.01641109 187 28.39459396 188 31.27823112 189 30.78368540 190 29.69459396 191 29.20004825 192 28.70550253 193 28.01095681 194 29.10550253 195 30.89459396 196 30.20004825 197 31.98913968 198 35.46732255 199 33.38368540 200 34.27823112 201 36.06732255 202 37.46186827 203 38.45641399 204 36.77277684 205 34.58913968 206 35.68913968 207 40.96732255 208 44.25095971 209 47.53459686 210 45.35095971 211 37.01095681 212 36.91641109 213 40.79459396 214 47.35095971 215 50.63459686 216 47.65641399 217 40.80550253 218 36.23822822 219 35.04913679 220 36.93822822 221 40.12186538 222 40.02731966 223 36.35459107 224 36.26004535 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1nx031257935451.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/2ptx41257935451.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/31b901257935451.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/4csp91257935451.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/5am9n1257935451.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/6cb9f1257935451.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/71trb1257935451.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/8wzcj1257935451.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.800 6.200 7.200 6.827 7.600 8.200 > > #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/936ve1257935451.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/10q3zj1257935451.tab") > > system("convert tmp/1nx031257935451.ps tmp/1nx031257935451.png") > system("convert tmp/2ptx41257935451.ps tmp/2ptx41257935451.png") > system("convert tmp/31b901257935451.ps tmp/31b901257935451.png") > system("convert tmp/4csp91257935451.ps tmp/4csp91257935451.png") > system("convert tmp/5am9n1257935451.ps tmp/5am9n1257935451.png") > system("convert tmp/6cb9f1257935451.ps tmp/6cb9f1257935451.png") > system("convert tmp/71trb1257935451.ps tmp/71trb1257935451.png") > system("convert tmp/8wzcj1257935451.ps tmp/8wzcj1257935451.png") > > > proc.time() user system elapsed 1.652 1.191 2.106