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(2.109240969,2.110252917,2.110791661,2.111363344,2.111497749,2.111699278,2.111766433,2.111632112,2.111934276,2.112236231,2.112169148,2.112135603,2.112102055,2.111531343,2.111262514,2.111430552,2.111060782,2.110959881,2.110657038,2.110858957,2.110556043,2.110959881,2.110858957,2.111228898,2.111363344,2.111430552,2.111632112,2.111699278,2.111900713,2.112437417,2.112034951,2.112102055,2.112504459,2.113140837,2.113676012,2.114210528,2.115310895,2.116740535,2.118066222,2.118892725,2.119717659,2.12169113,2.125481266,2.128496199,2.135132651,2.13801834,2.139942023,2.140350889,2.140633725,2.140508043,2.140853581,2.141919874,2.143951116,2.145507171,2.147738141,2.150971232,2.151584339,2.151247237,2.150326536,2.149742415) > x <- c(2.178545315,2.169645049,2.152165991,2.171404635,2.169409898,2.177824972,2.179494341,2.182528775,2.196424914,2.189265669,2.196507792,2.203304916,2.20561031,2.175105741,2.180956951,2.187887178,2.180355296,2.185655459,2.192567453,2.201041896,2.193375081,2.193958978,2.194236749,2.187774455,2.207688213,2.204445581,2.19080776,2.188956593,2.180068501,2.183526073,2.187464315,2.190079454,2.184719815,2.190583796,2.191814172,2.209139536,2.220186568,2.216271493,2.215716855,2.212746765,2.203984244,2.215320251,2.223054413,2.222196046,2.220866133,2.2254902,2.22297645,2.213597437,2.226032503,2.228066553,2.219689289,2.214525955,2.196811543,2.206825876,2.213623993,2.207391978,2.201178556,2.204608289,2.203848464,2.216060286) > 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 -1.886738e-03 2 3.777825e-03 3 1.345375e-02 4 3.968428e-03 5 5.145582e-03 6 9.481300e-04 7 1.426221e-04 8 -1.577950e-03 9 -8.539995e-03 10 -4.495543e-03 11 -8.348447e-03 12 -1.193519e-02 13 -1.317388e-02 14 2.201673e-03 15 -1.125876e-03 16 -4.580616e-03 17 -1.013093e-03 18 -3.884655e-03 19 -7.800744e-03 20 -1.202884e-02 21 -8.323927e-03 22 -8.225321e-03 23 -8.471450e-03 24 -4.723344e-03 25 -1.499882e-02 26 -1.323652e-02 27 -5.905790e-03 28 -4.870927e-03 29 -2.324011e-05 30 -1.293982e-03 31 -3.755165e-03 32 -5.055125e-03 33 -1.850969e-03 34 -4.279988e-03 35 -4.387992e-03 36 -1.291031e-02 37 -1.758478e-02 38 -1.410854e-02 39 -1.249291e-02 40 -1.011380e-02 41 -4.708253e-03 42 -8.660681e-03 43 -8.913579e-03 44 -5.449935e-03 45 1.881729e-03 46 2.350187e-03 47 5.587933e-03 48 1.089968e-02 49 4.682083e-03 50 3.493101e-03 51 8.217855e-03 52 1.198328e-02 53 2.327474e-02 54 1.959580e-02 55 1.827305e-02 56 2.476393e-02 57 2.862510e-02 58 2.649511e-02 59 2.597160e-02 60 1.900375e-02 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/161kq1256744164.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/2mris1256744164.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/3ealw1256744164.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/4mvlt1256744164.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/54xpn1256744164.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/6xo091256744164.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/7hb4u1256744164.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/8qetu1256744164.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. 2.152 2.187 2.197 2.198 2.214 2.228 > > #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/9bkjp1256744164.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/1091yn1256744164.tab") > > system("convert tmp/161kq1256744164.ps tmp/161kq1256744164.png") > system("convert tmp/2mris1256744164.ps tmp/2mris1256744164.png") > system("convert tmp/3ealw1256744164.ps tmp/3ealw1256744164.png") > system("convert tmp/4mvlt1256744164.ps tmp/4mvlt1256744164.png") > system("convert tmp/54xpn1256744164.ps tmp/54xpn1256744164.png") > system("convert tmp/6xo091256744164.ps tmp/6xo091256744164.png") > system("convert tmp/7hb4u1256744164.ps tmp/7hb4u1256744164.png") > system("convert tmp/8qetu1256744164.ps tmp/8qetu1256744164.png") > > > proc.time() user system elapsed 1.568 1.158 2.013