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(11079.57694 + ,10688.9842 + ,10086.36942 + ,9433.814847 + ,8802.448758 + ,8245.710955 + ,7760.601438 + ,7348.820207 + ,6813.17089 + ,6424.178145 + ,6265.495915 + ,6180.641972 + ,6131.902172 + ,6144.765 + ,6451.903802 + ,7085.769891 + ,7914.432353 + ,8977.60533 + ,9849.744763 + ,10403.01974 + ,10919.38057 + ,11060.27431 + ,11321.63614 + ,11932.31375 + ,12323.60649 + ,11766.56869 + ,11650.76343 + ,11527.79534 + ,11012.33451 + ,10840.52663 + ,10295.91448 + ,9715.788191 + ,9484.677675 + ,9225.915845 + ,9182.738874 + ,8718.117843 + ,8922.277044 + ,8771.657643 + ,8437.867527 + ,7923.106695 + ,7175.935349 + ,6945.524833 + ,6460.415316 + ,6062.259743 + ,5757.720941 + ,5564.624568 + ,5703.118312 + ,5594.875883 + ,5608.70154 + ,5450.719311 + ,5211.145967 + ,5038.03808 + ,4922.532822 + ,4722.273621 + ,4388.483505 + ,4382.320676 + ,4215.075618 + ,4166.335818 + ,4304.429562 + ,4391.383505 + ,4449.586134 + ,4400.846334 + ,4662.908164 + ,4257.789761 + ,4520.251591 + ,4231.838447 + ,4290.441076 + ,4160.810161 + ,3871.197016 + ,3910.011159 + ,3722.277616 + ,3862.071359 + ,3826.257216 + ,3857.508531 + ,3952.625303 + ,4512.963106 + ,4549.777249 + ,4887.267365 + ,4888.967365 + ,4862.01605 + ,4885.404536 + ,4692.608164 + ,4584.465734 + ,4427.383505 + ,4639.305535 + ,4992.121308 + ,5611.56174 + ,6379.521573 + ,7500.660007 + ,8635.36127) > x <- c(103784.5647 + ,106789.1029 + ,113889.3931 + ,120709.6235 + ,112224.8795 + ,115336.2211 + ,123876.6481 + ,128645.1607 + ,117955.5279 + ,121200.0661 + ,127221.878 + ,130871.7754 + ,120395.7155 + ,122826.724 + ,127608.0832 + ,130425.8272 + ,118864.802 + ,119456.0505 + ,125726.0767 + ,128969.7266 + ,117441.3338 + ,120415.4962 + ,127525.8041 + ,129939.5224 + ,121157.9842 + ,122346.3257 + ,131061.1889 + ,133972.0435 + ,124923.4364 + ,126359.2311 + ,134604.5898 + ,137128.9057 + ,126495.632 + ,129016.3242 + ,136825.2729 + ,140536.7256 + ,131359.965 + ,134527.7854 + ,142275.3921 + ,146687.7849 + ,136205.9041 + ,140667.6305 + ,147443.0576 + ,152116.5872 + ,142296.2281 + ,146169.9972 + ,153908.1597 + ,158496.0314 + ,150180.0485 + ,155418.8604 + ,160725.5782 + ,167376.3729 + ,159676.2361 + ,163171.9967 + ,168006.6033 + ,172087.5947 + ,163770.3981 + ,167646.3382 + ,173556.5007 + ,179462.6033 + ,169624.6717 + ,175262.6119 + ,179659.9197 + ,185496.4408 + ,174269.7487 + ,180679.4066 + ,185375.475 + ,192056.3211 + ,180441.979 + ,186922.0218 + ,191210.7995 + ,197904.9619 + ,185547.9192 + ,191137.9534 + ,194532.0646 + ,202546.723 + ,189157.7658 + ,194107.1591 + ,197191.1591 + ,204767.1249 + ,193508.1506 + ,198230.9197 + ,203149.7914 + ,209895.6033 + ,198216.8513 + ,201090.2618 + ,204693.9886 + ,208318.8951 + ,192325.2205 + ,215331.5546) > 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 1097.10391 2 890.22170 3 721.74954 4 486.21351 5 -663.94672 6 -1030.44357 7 -993.35424 8 -1113.56788 9 -2302.82783 10 -2493.43540 11 -2283.91786 12 -2145.60121 13 -2834.89286 14 -2673.38761 15 -2073.89571 16 -1267.74050 17 -1145.96939 18 -46.64491 19 1208.87119 20 1960.47703 21 1771.94179 22 2094.68875 23 2790.80573 24 3549.06857 25 3403.41988 26 2919.04244 27 3336.10181 28 3391.11603 29 2322.38402 30 2238.36687 31 2197.91180 32 1772.13317 33 890.85806 34 786.22231 35 1220.51842 36 982.83174 37 625.88390 38 668.95881 39 808.89106 40 563.92311 41 -824.15601 42 -781.75717 43 -852.58761 44 -964.98326 45 -1869.98152 46 -1826.21881 47 -1214.58016 48 -1042.30017 49 -1536.94986 50 -1374.60835 51 -1289.70590 52 -1056.15527 53 -1642.48038 54 -1628.99358 55 -1667.17482 56 -1423.80809 57 -2099.60272 58 -1911.35068 59 -1411.88391 60 -963.80517 61 -1507.13646 62 -1211.14808 63 -680.21573 64 -728.46385 65 -1152.45079 66 -1048.94958 67 -703.20891 68 -424.34384 69 -1424.10837 70 -989.07623 71 -914.57526 72 -365.47132 73 -1156.84878 74 -783.79847 75 -481.15098 76 569.23789 77 -212.60703 78 427.51051 79 617.77968 80 1054.05586 81 389.02170 82 484.99597 83 677.61474 84 933.00078 85 430.83313 86 959.34172 87 1799.12968 88 2788.73206 89 2931.94768 90 5473.35625 > library(lattice) > postscript(file="/var/www/rcomp/tmp/10zlj1257361944.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/25vb61257361944.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/3zmp81257361944.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/4foxg1257361944.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/5b9y61257361944.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/66zrn1257361944.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/7hk691257361944.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/88tqj1257361944.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. 103800 127500 148800 155200 185500 215300 > > #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/9dhqe1257361944.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/10q27u1257361944.tab") > > system("convert tmp/10zlj1257361944.ps tmp/10zlj1257361944.png") > system("convert tmp/25vb61257361944.ps tmp/25vb61257361944.png") > system("convert tmp/3zmp81257361944.ps tmp/3zmp81257361944.png") > system("convert tmp/4foxg1257361944.ps tmp/4foxg1257361944.png") > system("convert tmp/5b9y61257361944.ps tmp/5b9y61257361944.png") > system("convert tmp/66zrn1257361944.ps tmp/66zrn1257361944.png") > system("convert tmp/7hk691257361944.ps tmp/7hk691257361944.png") > system("convert tmp/88tqj1257361944.ps tmp/88tqj1257361944.png") > > > proc.time() user system elapsed 1.970 1.870 3.742