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(97.6,96.9,105.6,102.8,101.7,104.2,92.7,91.9,106.5,112.3,102.8,96.5,101,98.9,105.1,103,99,104.3,94.6,90.4,108.9,111.4,100.8,102.5,98.2,98.7,113.3,104.6,99.3,111.8,97.3,97.7,115.6,111.9,107,107.1,100.6,99.2,108.4,103,99.8,115,90.8,95.9,114.4,108.2,112.6,109.1,105,105,118.5,103.7,112.5,116.6,96.6,101.9,116.5,119.3,115.4,108.5,111.5,108.8,121.8,109.6,112.2,119.6,104.1,105.3,115,124.1,116.8,107.5,115.6) > x <- c(89.6,92.8,107.6,104.6,103,106.9,56.3,93.4,109.1,113.8,97.4,72.5,82.7,88.9,105.9,100.8,94,105,58.5,87.6,113.1,112.5,89.6,74.5,82.7,90.1,109.4,96,89.2,109.1,49.1,92.9,107.7,103.5,91.1,79.8,71.9,82.9,90.1,100.7,90.7,108.8,44.1,93.6,107.4,96.5,93.6,76.5,76.7,84,103.3,88.5,99,105.9,44.7,94,107.1,104.8,102.5,77.7,85.2,91.3,106.5,92.4,97.5,107,51.1,98.6,102.2,114.3,99.4,72.5,92.3) > par2 = '0' > 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 -7.77557045 2 -9.38668199 3 -4.90057287 4 -6.84640580 5 -7.49085003 6 -6.10126722 7 -3.19431599 8 -14.55751541 9 -4.42765640 10 0.03414852 11 -4.79640483 12 -4.00681816 13 -2.41098620 14 -6.27626481 15 -4.91654486 16 -5.56446084 17 -7.62834882 18 -5.46029474 19 -1.92070517 20 -14.40612574 21 -3.16654583 22 -0.49571241 23 -4.57557045 24 1.42373713 25 -5.21098620 26 -6.81793163 27 2.28692689 28 -2.59779353 29 -5.96168151 30 0.87234360 31 3.45568498 32 -8.61515423 33 5.07095490 34 2.56678879 35 1.19734601 36 4.51470864 37 0.26401525 38 -4.26793067 39 2.88206837 40 -5.53598861 41 -5.88876505 42 4.15776030 43 -1.62070324 44 -10.61445988 45 3.95637160 46 0.85984529 47 6.08554012 48 7.45429241 49 3.29734794 50 1.21887474 51 9.22373326 52 -1.36237586 53 4.44803940 54 6.58345514 55 4.00846334 56 -4.72834882 57 6.14178831 58 9.59664973 59 6.35151115 60 6.51262559 61 7.37720791 62 2.94040154 63 11.61262172 64 3.42720695 65 4.57512293 66 9.27026055 67 9.68624026 68 -2.63807166 69 6.03692786 70 11.69178735 71 8.63415045 72 6.99318184 73 9.45567918 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1gsob1261050123.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/2yfjr1261050123.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/3xu191261050123.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/42dpy1261050123.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/50iyy1261050123.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/6qn291261050123.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/7nj851261050123.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/8nfbz1261050123.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() + } > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 44.1 85.2 93.6 92.0 104.8 114.3 > > #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/9gjtv1261050123.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/10092e1261050123.tab") > > try(system("convert tmp/1gsob1261050123.ps tmp/1gsob1261050123.png",intern=TRUE)) character(0) > try(system("convert tmp/2yfjr1261050123.ps tmp/2yfjr1261050123.png",intern=TRUE)) character(0) > try(system("convert tmp/3xu191261050123.ps tmp/3xu191261050123.png",intern=TRUE)) character(0) > try(system("convert tmp/42dpy1261050123.ps tmp/42dpy1261050123.png",intern=TRUE)) character(0) > try(system("convert tmp/50iyy1261050123.ps tmp/50iyy1261050123.png",intern=TRUE)) character(0) > try(system("convert tmp/6qn291261050123.ps tmp/6qn291261050123.png",intern=TRUE)) character(0) > try(system("convert tmp/7nj851261050123.ps tmp/7nj851261050123.png",intern=TRUE)) character(0) > try(system("convert tmp/8nfbz1261050123.ps tmp/8nfbz1261050123.png",intern=TRUE)) convert: unable to open image `tmp/8nfbz1261050123.ps': No such file or directory. convert: missing an image filename `tmp/8nfbz1261050123.png'. character(0) > > > proc.time() user system elapsed 1.488 1.080 2.349