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,293299) > x <- c(12.6946864,12.70162827,12.6681701,12.66835592,12.65631033,12.65164269,12.64236113,12.62132305,12.61259053,12.62489811,12.71732618,12.72990728,12.72466404,12.68828581,12.65691575,12.65869166,12.65465471,12.64324312,12.62136596,12.60816206,12.60626722,12.61695969,12.70613556,12.72213354,12.69959747,12.6414816,12.59783091,12.58249678,12.58293936,12.559114,12.52987568,12.51563607,12.4874134,12.48101137,12.60083401,12.62345974,12.56721659,12.52970205,12.4928443,12.49557681,12.50016289,12.47809017,12.45114206,12.44176908,12.4041158,12.43217581,12.54413291,12.56114581,12.50978554,12.47256683,12.45138074,12.46988202,12.48333689,12.48480605,12.48095819,12.47828061,12.45358485,12.48454115,12.59085874,12.6139116,12.56801768) > 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 466.56374 2 -4241.09783 3 -5064.64076 4 -3867.36137 5 -2662.92956 6 -1916.25406 7 -2447.78428 8 -3856.67307 9 -5422.97308 10 -9604.71827 11 -2619.34781 12 -772.31257 13 1208.52375 14 3108.73844 15 1585.97965 16 2471.37811 17 672.78508 18 2777.40112 19 2822.23286 20 3385.16175 21 2834.42533 22 -1974.30252 23 1773.73646 24 52.87754 25 5352.64328 26 1166.62363 27 -296.84548 28 -1726.73726 29 1373.09340 30 454.01044 31 -3690.17732 32 -3181.02013 33 -5811.11977 34 -15437.70701 35 -12063.33165 36 -13366.92039 37 -10398.54665 38 -8216.47202 39 -9343.98090 40 -6112.73190 41 -5434.92353 42 -5287.76092 43 -8791.57663 44 -7236.99288 45 -12542.98112 46 -15896.98979 47 -13311.24752 48 -15724.89764 49 -8597.78386 50 -4315.61720 51 351.96370 52 6795.24782 53 13124.82743 54 16909.93920 55 22245.08495 56 23604.75467 57 21154.57020 58 20599.73368 59 23739.82543 60 23099.62161 61 28105.01351 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1svla1256672244.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/28huo1256672244.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/34e8y1256672244.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/4elta1256672244.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/5xmjb1256672244.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/6fefu1256672244.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/79oul1256672244.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/87qe81256672244.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. 12.40 12.49 12.59 12.58 12.65 12.73 > > #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/9cgzn1256672245.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/10kosd1256672245.tab") > > system("convert tmp/1svla1256672244.ps tmp/1svla1256672244.png") > system("convert tmp/28huo1256672244.ps tmp/28huo1256672244.png") > system("convert tmp/34e8y1256672244.ps tmp/34e8y1256672244.png") > system("convert tmp/4elta1256672244.ps tmp/4elta1256672244.png") > system("convert tmp/5xmjb1256672244.ps tmp/5xmjb1256672244.png") > system("convert tmp/6fefu1256672244.ps tmp/6fefu1256672244.png") > system("convert tmp/79oul1256672244.ps tmp/79oul1256672244.png") > system("convert tmp/87qe81256672244.ps tmp/87qe81256672244.png") > > > proc.time() user system elapsed 1.620 1.180 2.037