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.589615427,1.297013668,0.767420705,0.152624224,0.060022464,0.174818946,0.274818946,0.174818946,0.052624224,-0.147375776,0.323031261,1.052624224,1.252624224,1.060022464,0.367420705,-0.032579295,-0.117782813,-0.202986332,-0.295588091,-0.495588091,-0.695588091,-0.417782813,0.137827742,1.308234779,1.786040057,1.493438298,0.808234779,0.41563302,0.323031261,0.330429502,0.423031261,0.608234779,0.61563302,0.400836539,0.271243576,0.093438298,-0.113959943,-0.328756424,-0.036154665,0.056447094,-0.121358184,-0.499163461,-0.799163461,-0.928756424,-0.950951146,-0.973145869,-0.850951146,-0.569570498,-0.162172258,-0.191765221,0.149048854,0.026854131,-0.043552906,-0.376968739,-0.832579295,-1.217782813,-1.532579295,-1.754774017,-1.747375776,-1.410384573) > x <- c(0.660209233,0.566270709,0.342024802,0.029901849,0.035963326,0.048086279,0.148086279,0.048086279,0.029901849,-0.070098151,0.105655942,0.429901849,0.529901849,0.435963326,0.142024802,0.042024802,-0.045852244,-0.033729291,-0.127667814,-0.227667814,-0.327667814,-0.245852244,0.017778895,0.593532988,0.775348558,0.681410035,0.393532988,0.199594465,0.105655942,0.111717418,0.205655942,0.293532988,0.299594465,0.187471511,0.063225604,0.081410035,-0.024651442,-0.136774396,-0.042835873,0.051102651,-0.030712919,-0.212528489,-0.412528489,-0.336774396,-0.454958826,-0.473143256,-0.354958826,-0.188282582,-0.082221105,-0.106467012,0.045041174,0.026856744,-0.048897349,-0.094344058,-0.357975198,-0.545852244,-0.657975198,-0.776159628,-0.770098151,-0.539790767) > 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.083288509 2 0.005015966 3 -0.012939732 4 0.084400458 5 -0.022031108 6 0.065105763 7 -0.063053257 8 0.065105763 9 -0.015599542 10 0.012559479 11 0.081967699 12 0.071764377 13 0.043605357 14 0.065332811 15 0.043378308 16 -0.128462671 17 -0.013166782 18 -0.126029912 19 -0.004302457 20 0.023856563 21 0.052015583 22 0.143151258 23 0.097263589 24 -0.045964272 25 0.017012383 26 -0.061260162 27 -0.089646231 28 -0.039759756 29 0.081967699 30 0.075536136 31 -0.046191321 32 -0.061487211 33 -0.067918776 34 -0.026896624 35 0.126988657 36 -0.092306040 37 -0.057715454 38 -0.016693302 39 0.061579243 40 -0.060148214 41 -0.051283889 42 -0.014260543 43 0.142057498 44 -0.160375261 45 0.087078454 46 0.106373149 47 -0.041080566 48 -0.139986803 49 0.025422610 50 0.051148871 51 0.046283353 52 -0.034421953 53 0.068010806 54 -0.161714261 55 -0.015826590 56 0.027628319 57 -0.031349529 58 0.016104186 59 0.009672621 60 -0.178803247 > library(lattice) > postscript(file="/var/www/html/freestat/rcomp/tmp/145dw1256828017.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/2x2ye1256828017.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/3f3r91256828017.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/4vry11256828017.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/5uj0g1256828017.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/6vj4j1256828017.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/7bhn31256828017.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/8k5s91256828017.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. -7.762e-01 -1.943e-01 2.838e-02 3.333e-11 1.579e-01 7.753e-01 > > #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/9dzzn1256828017.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/102s2u1256828017.tab") > > system("convert tmp/145dw1256828017.ps tmp/145dw1256828017.png") > system("convert tmp/2x2ye1256828017.ps tmp/2x2ye1256828017.png") > system("convert tmp/3f3r91256828017.ps tmp/3f3r91256828017.png") > system("convert tmp/4vry11256828017.ps tmp/4vry11256828017.png") > system("convert tmp/5uj0g1256828017.ps tmp/5uj0g1256828017.png") > system("convert tmp/6vj4j1256828017.ps tmp/6vj4j1256828017.png") > system("convert tmp/7bhn31256828017.ps tmp/7bhn31256828017.png") > system("convert tmp/8k5s91256828017.ps tmp/8k5s91256828017.png") > > > proc.time() user system elapsed 2.698 1.999 4.064