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(286602,283042,276687,277915,277128,277103,275037,270150,267140,264993,287259,291186,292300,288186,281477,282656,280190,280408,276836,275216,274352,271311,289802,290726,292300,278506,269826,265861,269034,264176,255198,253353,246057,235372,258556,260993,254663,250643,243422,247105,248541,245039,237080,237085,225554,226839,247934,248333,246969,245098,246263,255765,264319,268347,273046,273963,267430,271993,292710,295881) > 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) > 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 -20095.2013 2 -13729.3362 3 -10042.9159 4 -5679.2289 5 -1941.3310 6 1470.2191 7 3162.3460 8 3069.3940 9 4446.1851 10 4389.1677 11 -143.7037 12 -4938.3577 13 -7429.4102 14 -3248.5454 15 -318.2938 16 3911.4083 17 7309.9454 18 8747.5547 19 10212.3430 20 10187.9033 21 11807.0462 22 10446.8041 23 7238.4602 24 2888.2284 25 -202.9142 26 -624.6381 27 596.0816 28 2044.0127 29 3686.7076 30 3334.6697 31 725.8393 32 509.9583 33 -1273.6283 34 -6975.1769 35 -2088.8979 36 -4032.7181 37 -8839.2429 38 -7745.7232 39 -8075.9996 40 -5350.6588 41 -3835.3062 42 -5037.9268 43 -7632.0517 44 -7436.5234 45 -12133.0156 46 -11018.6624 47 -5462.7830 48 -7587.6838 49 -11063.5073 50 -8383.3139 51 -5661.5835 52 338.3822 53 5200.4133 54 8314.0690 55 11656.7733 56 13018.7338 57 12964.2539 58 15601.7878 59 16718.2363 60 14031.3554 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1phpk1256748760.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/2z7b51256748760.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/3fcp51256748760.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/44fbd1256748760.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/5a4x41256748760.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/6ckqn1256748760.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/7enab1256748760.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/856e21256748760.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/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/94irs1256748760.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/10ndlm1256748760.tab") > > system("convert tmp/1phpk1256748760.ps tmp/1phpk1256748760.png") > system("convert tmp/2z7b51256748760.ps tmp/2z7b51256748760.png") > system("convert tmp/3fcp51256748760.ps tmp/3fcp51256748760.png") > system("convert tmp/44fbd1256748760.ps tmp/44fbd1256748760.png") > system("convert tmp/5a4x41256748760.ps tmp/5a4x41256748760.png") > system("convert tmp/6ckqn1256748760.ps tmp/6ckqn1256748760.png") > system("convert tmp/7enab1256748760.ps tmp/7enab1256748760.png") > system("convert tmp/856e21256748760.ps tmp/856e21256748760.png") > > > proc.time() user system elapsed 1.631 1.214 3.875