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(0.3307415885252,0.0294054201834,-0.2973179466524,-0.2478797180063,-0.1770627958916,-0.0035735370933,0.0924179578814,0.0178051563753,0.2418561865275,0.1966390885407,0.1993114252243,0.1846135734646,0.1618987116543,0.2033199302497,0.2140092769839,0.2220262870347,0.2874985357822,0.2768091890479,0.3262474176940,0.3730133096566,0.4703409729730,0.3130983599102,0.0304685483534,-0.0722037883302,-0.0775484616973,-0.0428080848109,-0.0294464013930,-0.0973783611901,-0.1252252707336,-0.1559571425947,-0.0091912506322,0.1587407091649,0.0507236991142,-0.2931572305307,-0.5971657355561,-0.8918210621890,-1.0276849817832,-0.7288085244910,-0.5606639390598,-0.4058810370466,-0.3909705596529,-0.5094642908039,-0.6867494289936,-0.5918814767267,-0.6357624063717,-0.2555923058645,0.0989779705148,0.3350545157430,0.1537608725281,-0.0729624943077,-0.2529199691809,-0.0248604340034,0.4152246162502,0.5243651690087,0.6377268524266,0.6096673172491,0.4482035735269,0.4455312368433,0.5695822669955,0.6428589001598) > x <- c(0.628621083,0.318767883,0.041703886,0.02627228,0.328491871,0.820417862,0.510858263,0.25806906,0.615426657,0.87940785,0.84911425,0.900729052,0.213224654,0.308673849,0.627499448,0.366618647,0.109425439,-0.57940016,-0.314831766,-0.089969772,-0.409676171,-0.684373776,-0.656282179,-1.065988578,-1.075401378,-0.799218182,-0.650686183,-0.634209387,-0.532136596,-0.478760192,-0.523898198,-1.020374994,-1.009494193,-0.9356598,-1.1852194,-0.7958066,-0.072853008,0.61628378,0.758796971,1.122778165,1.290153351,2.031198541,1.788702938,2.838280126,3.422114519,3.52330651,3.008297715,3.074334111,2.332278908,0.755214912,0.243012909,-0.070069894,-0.464473899,-1.764491488,-1.78595949,-2.752876686,-3.476123879,-4.055830278,-3.158472681,-3.565536678) > 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.399090374 2 0.064064451 3 -0.292783562 4 -0.245023183 5 -0.141346494 6 0.085628951 7 0.147962614 8 0.045864519 9 0.308770367 10 0.292255447 11 0.291634017 12 0.282548146 13 0.185082226 14 0.236881456 15 0.282236109 16 0.261888042 17 0.299396158 18 0.213812102 19 0.292016353 20 0.363231066 21 0.425797655 22 0.238687689 23 -0.040887776 24 -0.188106717 25 -0.194474827 26 -0.129705572 27 -0.100194284 28 -0.166334753 29 -0.183083480 30 -0.208011836 31 -0.066153714 32 0.047797259 33 -0.059036702 34 -0.394889757 35 -0.726032407 36 -0.978347614 37 -1.035606152 38 -0.661801151 39 -0.478161374 40 -0.283803483 41 -0.250694617 42 -0.288615901 43 -0.492267130 44 -0.283280628 45 -0.263682344 46 0.127490171 47 0.426064512 48 0.669321070 49 0.407345163 50 0.009150600 51 -0.226497634 52 -0.032479002 53 0.364723245 54 0.332515335 55 0.443542843 56 0.310352223 57 0.070251175 58 0.004548454 59 0.226167485 60 0.255184817 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1b4er1256835593.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/2vxf61256835593.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/3hwha1256835593.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/4a4ql1256835593.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/5r82o1256835593.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/6zlo91256835593.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/72ur51256835593.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/88n8q1256835593.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. -4.056e+00 -7.122e-01 3.399e-02 6.667e-11 7.561e-01 3.523e+00 > > #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/95eoc1256835593.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/100fib1256835593.tab") > > system("convert tmp/1b4er1256835593.ps tmp/1b4er1256835593.png") > system("convert tmp/2vxf61256835593.ps tmp/2vxf61256835593.png") > system("convert tmp/3hwha1256835593.ps tmp/3hwha1256835593.png") > system("convert tmp/4a4ql1256835593.ps tmp/4a4ql1256835593.png") > system("convert tmp/5r82o1256835593.ps tmp/5r82o1256835593.png") > system("convert tmp/6zlo91256835593.ps tmp/6zlo91256835593.png") > system("convert tmp/72ur51256835593.ps tmp/72ur51256835593.png") > system("convert tmp/88n8q1256835593.ps tmp/88n8q1256835593.png") > > > proc.time() user system elapsed 1.564 1.144 4.577