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(6.9,6.8,6.7,6.6,6.5,6.5,7.0,7.5,7.6,7.6,7.6,7.8,8.0,8.0,8.0,7.9,7.9,8.0,8.5,9.2,9.4,9.5,9.5,9.6,9.7,9.7,9.6,9.5,9.4,9.3,9.6,10.2,10.2,10.1,9.9,9.8,9.8,9.7,9.5,9.3,9.1,9.0,9.5,10.0,10.2,10.1,10.0,9.9,10.0,9.9,9.7,9.5,9.2,9.0,9.3,9.8,9.8,9.6,9.4,9.3,9.2,9.2,9.0,8.8,8.7,8.7,9.1,9.7,9.8,9.6,9.4,9.4,9.5,9.4,9.3,9.2,9.0,8.9,9.2,9.8,9.9,9.6,9.2,9.1,9.1,9.0,8.9,8.7,8.5,8.3,8.5,8.7,8.4,8.1,7.8,7.7,7.5,7.2,6.8,6.7,6.4,6.3,6.8,7.3,7.1,7.0,6.8,6.6,6.3,6.1,6.1,6.3,6.3,6.0,6.2,6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8.0,8.1,8.2,8.3,8.2,8.0,7.9,7.6,7.6,8.3,8.4,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.4,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.5,8.2,8.1,7.9,8.6,8.7,8.7,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.0,8.2,8.1,8.1,8.0,7.9,7.9) > x <- c(1145.11 + ,1176.86 + ,1206.41 + ,1192.72 + ,1214.82 + ,1199.07 + ,1157.47 + ,1100.10 + ,1095.63 + ,1105.63 + ,1137.79 + ,1124.72 + ,1152.60 + ,1211.85 + ,1239.62 + ,1244.13 + ,1198.42 + ,1227.99 + ,1304.92 + ,1340.26 + ,1307.32 + ,1356.51 + ,1383.29 + ,1437.87 + ,1494.56 + ,1521.42 + ,1498.76 + ,1488.75 + ,1524.62 + ,1439.27 + ,1423.11 + ,1466.85 + ,1425.83 + ,1363.45 + ,1389.18 + ,1395.89 + ,1368.43 + ,1349.03 + ,1299.88 + ,1365.41 + ,1451.04 + ,1433.75 + ,1464.65 + ,1475.57 + ,1571.16 + ,1429.12 + ,1452.46 + ,1538.09 + ,1631.59 + ,1665.50 + ,1690.60 + ,1711.74 + ,1734.10 + ,1748.09 + ,1703.45 + ,1745.74 + ,1751.01 + ,1795.65 + ,1852.13 + ,1877.10 + ,1989.31 + ,2097.76 + ,2154.87 + ,2152.18 + ,2250.27 + ,2346.90 + ,2525.56 + ,2409.36 + ,2394.36 + ,2401.33 + ,2354.32 + ,2450.41 + ,2504.67 + ,2661.39 + ,2880.40 + ,3064.42 + ,3141.12 + ,3327.70 + ,3564.95 + ,3403.13 + ,3149.90 + ,3006.84 + ,3230.66 + ,3361.13 + ,3484.74 + ,3411.13 + ,3288.18 + ,3280.37 + ,3173.95 + ,3165.26 + ,3092.71 + ,3053.05 + ,3181.96 + ,2999.93 + ,3249.57 + ,3210.52 + ,3030.29 + ,2803.47 + ,2767.63 + ,2882.60 + ,2863.36 + ,2897.06 + ,3012.61 + ,3142.95 + ,3032.93 + ,3045.78 + ,3110.52 + ,3013.24 + ,2987.10 + ,2995.55 + ,2833.18 + ,2848.96 + ,2794.83 + ,2845.26 + ,2915.02 + ,2892.63 + ,2604.42 + ,2641.65 + ,2659.81 + ,2638.53 + ,2720.25 + ,2745.88 + ,2735.70 + ,2811.70 + ,2799.43 + ,2555.28 + ,2304.98 + ,2214.95 + ,2065.81 + ,1940.49 + ,2042.00 + ,1995.37 + ,1946.81 + ,1765.90 + ,1635.25 + ,1833.42 + ,1910.43 + ,1959.67 + ,1969.60 + ,2061.41 + ,2093.48 + ,2120.88 + ,2174.56 + ,2196.72 + ,2350.44 + ,2440.25 + ,2408.64 + ,2472.81 + ,2407.60 + ,2454.62 + ,2448.05 + ,2497.84 + ,2645.64 + ,2756.76 + ,2849.27 + ,2921.44 + ,2981.85 + ,3080.58 + ,3106.22 + ,3119.31 + ,3061.26 + ,3097.31 + ,3161.69 + ,3257.16 + ,3277.01 + ,3295.32 + ,3363.99 + ,3494.17 + ,3667.03 + ,3813.06 + ,3917.96 + ,3895.51 + ,3801.06 + ,3570.12 + ,3701.61 + ,3862.27 + ,3970.10 + ,4138.52 + ,4199.75 + ,4290.89) > 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.85995713 2 -1.95052265 3 -2.04174189 4 -2.14580986 5 -2.23924287 6 -2.24392297 7 -1.75628437 8 -1.27333181 9 -1.17466007 10 -1.17168858 11 -1.16213226 12 -0.96601600 13 -0.75773148 14 -0.74012540 15 -0.73187357 16 -0.83053343 17 -0.84411611 18 -0.73532942 19 -0.21246974 20 0.49803151 21 0.68824342 22 0.80286018 23 0.81081783 24 0.92703623 25 1.04388161 26 1.05186303 27 0.94512963 28 0.84215517 29 0.75281391 30 0.62745224 31 0.92265031 32 1.53564761 33 1.52345855 34 1.40492240 35 1.21256804 36 1.11456191 37 1.10640220 38 1.00063751 39 0.78603263 40 0.60550481 41 0.43094968 42 0.32581197 43 0.83499388 44 1.33823875 45 1.56664323 46 1.42443617 47 1.33137163 48 1.25681651 49 1.38459994 50 1.29467627 51 1.10213471 52 0.90841644 53 0.61506069 54 0.41921781 55 0.70595308 56 1.21851951 57 1.22008548 58 1.03335022 59 0.85013320 60 0.75755301 61 0.69089611 62 0.72312192 63 0.54009210 64 0.33929277 65 0.26844012 66 0.29715364 67 0.75024229 68 1.31571357 69 1.41125633 70 1.21332746 71 0.99935848 72 1.02791154 73 1.14403484 74 1.09060405 75 1.05568266 76 1.01036403 77 0.83315536 78 0.78859743 79 1.15909605 80 1.71101139 81 1.73576433 82 1.39325419 83 1.05976209 84 0.99853113 85 1.03526172 86 0.91338858 87 0.77685410 88 0.57453337 89 0.34291077 90 0.14032854 91 0.31877038 92 0.50698545 93 0.24529093 94 -0.10879911 95 -0.33461882 96 -0.44622249 97 -0.69977767 98 -1.06717702 99 -1.47782684 100 -1.54366361 101 -1.84938076 102 -1.93936684 103 -1.40503126 104 -0.86630085 105 -1.09899319 106 -1.19517483 107 -1.37593740 108 -1.60484406 109 -1.91261153 110 -2.11010063 111 -2.15834872 112 -1.95365971 113 -1.96974438 114 -2.25475916 115 -2.03403004 116 -1.84068321 117 -1.52632454 118 -0.81526168 119 -0.80986545 120 -0.71618878 121 -0.69190576 122 -0.88428983 123 -0.98731481 124 -1.16473148 125 -1.36837750 126 -1.54092644 127 -0.91530285 128 -0.84205518 129 -0.68637199 130 -0.52361071 131 -0.39344711 132 -0.30730317 133 -0.22173273 134 -0.37548997 135 -0.61431249 136 -0.65542646 137 -0.93254301 138 -0.91791139 139 -0.21496070 140 -0.08767945 141 -0.07814988 142 -0.07000799 143 -0.05405703 144 0.15252779 145 0.49820555 146 0.42489250 147 -0.08450038 148 -0.86543232 149 -1.18480941 150 -0.97083747 151 0.42721026 152 0.94200532 153 0.98592395 154 0.41894315 155 -0.05356759 156 0.06787766 157 0.28582843 158 0.41516596 159 0.32278486 160 0.02667454 161 -0.09057496 162 -0.27986274 163 0.43926772 164 0.56763654 165 0.57353495 166 0.37897575 167 0.29938097 168 0.43806384 169 0.68942903 170 0.73282170 171 0.66399264 172 0.55732164 173 0.32925591 174 -0.03936769 175 0.19970444 176 0.14744441 177 0.17948599 178 0.12953183 179 0.04772627 180 0.07480844 > library(lattice) > postscript(file="/var/www/rcomp/tmp/1d6bs1257770820.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/2hjeb1257770820.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/3qa8y1257770820.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/4xl661257770820.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/5ly4l1257770820.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/66raz1257770820.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/743qm1257770820.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/8zpz91257770820.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. 1096 1524 2409 2366 3036 4291 > > #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/9lxop1257770820.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/10suyn1257770820.tab") > > system("convert tmp/1d6bs1257770820.ps tmp/1d6bs1257770820.png") > system("convert tmp/2hjeb1257770820.ps tmp/2hjeb1257770820.png") > system("convert tmp/3qa8y1257770820.ps tmp/3qa8y1257770820.png") > system("convert tmp/4xl661257770820.ps tmp/4xl661257770820.png") > system("convert tmp/5ly4l1257770820.ps tmp/5ly4l1257770820.png") > system("convert tmp/66raz1257770820.ps tmp/66raz1257770820.png") > system("convert tmp/743qm1257770820.ps tmp/743qm1257770820.png") > system("convert tmp/8zpz91257770820.ps tmp/8zpz91257770820.png") > > > proc.time() user system elapsed 1.910 1.720 3.595