R version 2.8.0 (2008-10-20) 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(1.6891,1.7236,1.8072,1.7847,1.6813,1.6469,1.689,1.7169,1.8036,1.7955,1.7172,1.7348,1.7094,1.6963,1.6695,1.6537,1.6662,1.6793,1.7922,1.8045,1.7927,1.7831,1.7847,1.8076,1.8218,1.8112,1.795,1.7813,1.7866,1.7552,1.7184,1.7114,1.6967,1.6867,1.6337,1.6626,1.6374,1.626,1.637,1.6142,1.7033,1.7483,1.7135,1.7147,1.7396,1.7049,1.6867,1.7462,1.7147,1.667,1.6806,1.6738,1.6571,1.5875,1.6002,1.6144,1.6009,1.5937,1.603,1.5979) > x <- c(1.5291,1.5358,1.5355,1.5287,1.5334,1.5225,1.5135,1.5144,1.4913,1.4793,1.4663,1.4749,1.4745,1.4775,1.4678,1.4658,1.4572,1.4721,1.4624,1.4636,1.4649,1.465,1.4673,1.4679,1.4621,1.4674,1.4695,1.4964,1.5155,1.5411,1.5476,1.54,1.5474,1.5485,1.559,1.5544,1.5657,1.5734,1.567,1.5547,1.54,1.5192,1.527,1.5387,1.5431,1.5426,1.5216,1.5364,1.5469,1.5501,1.5494,1.5475,1.5448,1.5391,1.5578,1.5528,1.5496,1.549,1.5449,1.5479) > 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 -0.0045317418 2 0.0374542287 3 0.1207190360 4 0.0906213346 5 -0.0075273129 6 -0.0541059814 7 -0.0220617626 8 0.0068438155 9 0.0677339769 10 0.0462262686 11 -0.0465987488 12 -0.0193898911 13 -0.0452368148 14 -0.0549848877 15 -0.0926227852 16 -0.1106574033 17 -0.1077662610 18 -0.0780183564 19 0.0240437460 20 0.0376845168 21 0.0273370186 22 0.0178487495 23 0.0220185602 24 0.0455889457 25 0.0533085533 26 0.0486302911 27 0.0347766401 28 0.0511322530 29 0.0777728554 30 0.0749759666 31 0.0454384753 32 0.0299469266 33 0.0235150135 34 0.0147440534 35 -0.0265242018 36 -0.0027638233 37 -0.0153382313 38 -0.0181349518 39 -0.0142857296 40 -0.0508286306 41 0.0218469266 42 0.0436068988 43 0.0175219093 44 0.0317944249 45 0.0616105846 46 0.0263519301 47 -0.0153115595 48 0.0607246141 49 0.0409563589 50 -0.0031682522 51 0.0096496315 52 0.0007267444 53 -0.0189899900 54 -0.0949586515 55 -0.0613649726 56 -0.0527515178 57 -0.0698269067 58 -0.0776972921 59 -0.0729782591 60 -0.0747263320 > library(lattice) > postscript(file="/var/www/html/freestat/rcomp/tmp/1ffe11257799159.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/freestat/rcomp/tmp/23lfu1257799159.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/freestat/rcomp/tmp/3f49s1257799159.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/freestat/rcomp/tmp/4ckx71257799159.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/freestat/rcomp/tmp/5mb151257799159.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/freestat/rcomp/tmp/6j3hy1257799159.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/freestat/rcomp/tmp/73zlw1257799159.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/freestat/rcomp/tmp/80p361257799159.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.457 1.475 1.534 1.518 1.548 1.573 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/9winl1257799159.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/freestat/rcomp/tmp/100yct1257799159.tab") > > system("convert tmp/1ffe11257799159.ps tmp/1ffe11257799159.png") > system("convert tmp/23lfu1257799159.ps tmp/23lfu1257799159.png") > system("convert tmp/3f49s1257799159.ps tmp/3f49s1257799159.png") > system("convert tmp/4ckx71257799159.ps tmp/4ckx71257799159.png") > system("convert tmp/5mb151257799159.ps tmp/5mb151257799159.png") > system("convert tmp/6j3hy1257799159.ps tmp/6j3hy1257799159.png") > system("convert tmp/73zlw1257799159.ps tmp/73zlw1257799159.png") > system("convert tmp/80p361257799159.ps tmp/80p361257799159.png") > > > proc.time() user system elapsed 2.564 1.943 2.963