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(82140706404,80112773764,76555695969,77236747225,76799928384,76786072609,75645351369,72981022500,71363779600,70221290049,82517733081,84789286596,85439290000,83051170596,79229301529,79894414336,78506436100,78628646464,76638170896,75743846656,75269019904,73609658721,83985199204,84521607076,85439290000,77565592036,72806070276,70682071321,72379293156,69788958976,65126019204,64187742609,60544047249,55399978384,66851205136,68117346049,64853243569,62821913449,59254270084,61060881025,61772628681,60044111521,56206926400,56209297225,50874606916,51455931921,61471268356,61669278889,60993686961,60073029604,60645465169,65415735225,69864533761,72010112409,74554118116,75055725369,71518804900,73980192049,85679144100,87545566161) > x <- c(3760265041,3374215744,2983672129,2861715025,2685726976,2552068324,2405902500,2219446321,2048829696,1967543449,3009839044,3349052641,3489264900,3166650529,2791748569,2673096804,2445005809,2397571225,2201674084,2139617536,2043040000,1977669841,2821628161,3026760256,3208202881,2688111409,2303040100,2092513536,2152032100,1976780521,1729062724,1665700969,1451305216,1257482521,1969140625,2139525025,2080272100,1881390625,1613387889,1650634384,1647548100,1558117729,1349460225,1342049956,1076233636,1082870649,1687237776,1785400516,1867536225,1690525456,1629979129,1766184676,1909777401,1945339236,1998090000,1980784036,1728813241,1803700900,2566030336,2793862449) > 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 -10474983478 2 -7249211272 3 -5491421513 4 -3150668677 5 -1192484410 6 612606549 7 1461040849 8 1334174783 9 2038835838 10 2002562393 11 114512767 12 -2230256381 13 -3488387068 14 -1486080955 15 -205948129 16 2073884243 17 3789972703 18 4557715401 19 5233183709 20 5183380595 21 6022867515 22 5253122046 23 4143321277 24 1888107742 25 336556800 26 -459270259 27 21603490 28 762638711 29 1649878581 30 1444524965 31 152751002 32 76757959 33 -649247833 34 -3155603742 35 -1389258323 36 -2441861039 37 -4899596608 38 -4224369360 39 -4144791285 40 -2845064032 41 -2091315457 42 -2602783973 43 -3600370761 44 -3497154354 45 -5214377931 46 -4723375348 47 -2932808467 48 -4070684482 49 -5864052756 50 -4375788915 51 -2979384665 52 -62721772 53 2431938261 54 4093559584 55 5919685615 56 6656807937 57 6548931886 58 7991180650 59 9315670466 60 8081548929 > library(lattice) > postscript(file="/var/www/rcomp/tmp/17td21256778666.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/26m4c1256778666.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/3oli91256778666.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/4kd111256778666.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/5nst71256778666.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/6ry1i1256778666.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/7fh5j1256778666.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/8nht61256778666.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.076e+09 1.729e+09 2.046e+09 2.191e+09 2.676e+09 3.760e+09 > > #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/9q5z01256778666.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/10lscj1256778666.tab") > > system("convert tmp/17td21256778666.ps tmp/17td21256778666.png") > system("convert tmp/26m4c1256778666.ps tmp/26m4c1256778666.png") > system("convert tmp/3oli91256778666.ps tmp/3oli91256778666.png") > system("convert tmp/4kd111256778666.ps tmp/4kd111256778666.png") > system("convert tmp/5nst71256778666.ps tmp/5nst71256778666.png") > system("convert tmp/6ry1i1256778666.ps tmp/6ry1i1256778666.png") > system("convert tmp/7fh5j1256778666.ps tmp/7fh5j1256778666.png") > system("convert tmp/8nht61256778666.ps tmp/8nht61256778666.png") > > > proc.time() user system elapsed 1.620 1.450 3.181