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(-7.384479833,-348.812296,656.3387963,168.4268193,163.9341261,-219.1238071,131.7351533,68.87952107,-499.4813227,88.460018,-3.676899151,-250.2346886,174.1014888,-231.4249098,544.4571966,124.3024887,245.2234366,98.23681742,372.6587033,36.0872455,-337.1878898,-72.72145156,-121.8431801,-137.6524521,19.966092,-447.5428034,769.4438158,243.4453361,-164.2602175,454.3943467,-69.44942508,405.8522526,-358.8682021,-83.29905889,50.36917358,-94.12503992,-307.9726466,-171.4972374,581.7501227,244.4978459,74.07234434,218.1732414,41.97296758,230.9245802,-379.8087485,-230.0475763,-14.66583292,-134.2125562,-277.3250263,-389.3945325,682.2209027,-261.6970045,148.0023313,158.047103,-258.1716876,153.2005099,-667.3263955,-162.5924918,-58.96570282,-588.4092144) > x <- c(-50.74706514,-48.93785253,-47.15852374,-45.17543128,-46.94276659,-47.29735115,-42.25443623,-45.636011,-40.5706558,-34.94664303,-32.38276206,-32.7877051,-26.14063339,-22.09709979,-21.64764034,-16.98759233,-17.90735002,-15.42376615,-11.53425643,-13.32206639,-9.014273186,-4.253762759,-0.425986315,2.843751224,5.304276145,3.352359662,4.868775794,2.749804351,0.226872673,0.617183142,-0.16183631,0.436478416,2.548934314,6.596089819,10.3692672,9.720903334,12.32020087,12.14404607,12.94839943,13.76345412,16.31332119,16.81965467,15.68801627,17.19533256,18.78454744,24.92140923,27.36016736,27.69815372,30.48854798,30.43069115,30.29093572,28.97275052,27.2951215,25.22718201,26.17030799,25.74716525,29.830356,38.0397072,56.54216423,59.12713853) > 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 -107.775455 2 -445.624175 3 563.046895 4 79.057994 5 71.069049 6 -312.690345 7 48.144821 8 -21.400451 9 -579.740697 10 19.326413 11 -67.738477 12 -315.097350 13 122.388475 14 -275.138756 15 501.632499 16 90.696586 17 209.798012 18 67.724572 19 349.840926 20 9.732712 21 -355.020481 22 -81.136507 23 -122.685893 24 -132.026768 25 30.459338 26 -440.910959 27 779.075528 28 248.885169 29 -163.811404 30 455.615296 31 -69.769580 32 406.715721 33 -353.825743 34 -70.250267 35 70.882298 36 -74.894549 37 -283.600065 38 -147.473136 39 607.365445 40 271.725560 41 106.344363 42 251.446920 43 73.007969 44 264.941448 45 -342.647998 46 -180.746507 47 39.459738 48 -79.418360 49 -217.010700 50 -329.194662 51 742.144300 52 -204.381322 53 201.999225 54 207.953071 55 -206.399970 56 204.135141 57 -608.314145 58 -87.339996 59 52.889495 60 -471.440261 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1d57e1262079948.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/2vkjr1262079948.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/39fq71262079948.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/4w7li1262079948.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/5idvq1262079948.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/6cl6k1262079948.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/7qwun1262079948.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/8rolf1262079948.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. -5.075e+01 -1.884e+01 3.098e+00 4.000e-10 2.032e+01 5.913e+01 > > #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/9vlx71262079948.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/10ebfp1262079948.tab") > try(system("convert tmp/1d57e1262079948.ps tmp/1d57e1262079948.png",intern=TRUE)) character(0) > try(system("convert tmp/2vkjr1262079948.ps tmp/2vkjr1262079948.png",intern=TRUE)) character(0) > try(system("convert tmp/39fq71262079948.ps tmp/39fq71262079948.png",intern=TRUE)) character(0) > try(system("convert tmp/4w7li1262079948.ps tmp/4w7li1262079948.png",intern=TRUE)) character(0) > try(system("convert tmp/5idvq1262079948.ps tmp/5idvq1262079948.png",intern=TRUE)) character(0) > try(system("convert tmp/6cl6k1262079948.ps tmp/6cl6k1262079948.png",intern=TRUE)) character(0) > try(system("convert tmp/7qwun1262079948.ps tmp/7qwun1262079948.png",intern=TRUE)) character(0) > try(system("convert tmp/8rolf1262079948.ps tmp/8rolf1262079948.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.625 1.206 2.179