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(12.49654956,12.49637379,12.48664324,12.46405424,12.44840687,12.44850104,12.53273622,12.56147528,12.56584977,12.55335058,12.53064218,12.53507059,12.53223477,12.53214456,12.52466091,12.50673264,12.49552814,12.48745869,12.56813953,12.58171752,12.58553595,12.57136138,12.54780602,12.55198589,12.54322322,12.54400096,12.53118055,12.52531152,12.52216723,12.51102104,12.57695321,12.58013652,12.58553595,12.53719488,12.50553259,12.49072889,12.50259304,12.48437083,12.44979499,12.44253905,12.4133185,12.36892252,12.46286758,12.47224887,12.44769638,12.43178489,12.40255184,12.41756863,12.4233631,12.40917266,12.37615292,12.37617401,12.32631488,12.33199579,12.42091786,12.42252587,12.4170181,12.40941341,12.41415535,12.45201433,12.48491199,12.5000362,12.51739556,12.52074834,12.49661313,12.51353161,12.58693764) > x <- c(12.59443229,12.58959203,12.57954817,12.55931771,12.54901675,12.57020869,12.66432942,12.69284735,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) > 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.0013785010 2 0.0014736613 3 -0.0019737288 4 -0.0119071148 5 -0.0211104903 6 -0.0342734095 7 -0.0089175445 8 0.0019814904 9 0.0052055218 10 -0.0116363093 11 -0.0134142073 12 -0.0091020411 13 -0.0044024745 14 -0.0015727385 15 -0.0032501023 16 -0.0080175337 17 -0.0137592117 18 -0.0295279420 19 -0.0066675359 20 -0.0009599327 21 0.0061385226 22 0.0147211631 23 0.0107900416 24 0.0138589516 25 0.0076216854 26 0.0155381992 27 0.0164035330 28 0.0187944962 29 0.0168355655 30 -0.0009995369 31 0.0091466852 32 0.0023221032 33 0.0218194727 34 0.0098340772 35 0.0054784467 36 0.0002673526 37 0.0118546369 38 0.0085369105 39 -0.0077482484 40 -0.0060962838 41 -0.0176615152 42 -0.0580525630 43 -0.0390652192 44 -0.0438379576 45 -0.0332062948 46 -0.0256497303 47 -0.0318255954 48 -0.0185181878 49 -0.0155926421 50 -0.0159750014 51 -0.0321367521 52 -0.0262521861 53 -0.0525564697 54 -0.0644291228 55 -0.0455443056 56 -0.0545790934 57 -0.0279573047 58 -0.0122790033 59 0.0057163663 60 0.0320014593 61 0.0564821262 62 0.0706872705 63 0.0904537449 64 0.0954815446 65 0.0867953163 66 0.0843483946 67 0.0912450927 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1umvp1260303533.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/2idbs1260303533.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/3n2xg1260303533.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/4vbil1260303533.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/58gjw1260303533.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/62s8n1260303533.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/7qow01260303533.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/8vgzb1260303533.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/98cns1260303533.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/109n5w1260303533.tab") > system("convert tmp/1umvp1260303533.ps tmp/1umvp1260303533.png") > system("convert tmp/2idbs1260303533.ps tmp/2idbs1260303533.png") > system("convert tmp/3n2xg1260303533.ps tmp/3n2xg1260303533.png") > system("convert tmp/4vbil1260303533.ps tmp/4vbil1260303533.png") > system("convert tmp/58gjw1260303533.ps tmp/58gjw1260303533.png") > system("convert tmp/62s8n1260303533.ps tmp/62s8n1260303533.png") > system("convert tmp/7qow01260303533.ps tmp/7qow01260303533.png") > system("convert tmp/8vgzb1260303533.ps tmp/8vgzb1260303533.png") > > > proc.time() user system elapsed 1.571 1.168 1.972