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.076361633,-0.348454796,-0.283006118,-0.007232932,0.551647427,0.442754039,0.337847343,0.323229476,0.115153871,0.399615998,0.192767068,0.418016111,-0.059699309,0.134576212,0.125069487,0.115869431,0.010144951,0.043597878,0.144313438,0.13358004,0.481139719,0.318783783,0.072067942,-0.107768101,0.017404776,-0.122155466,-0.217555438,-0.031942803,-0.140196797,0.05361772,-0.136542831,-0.21497381,-0.743213372,-0.824506591,-0.595449247,-0.56038681,-0.68839587,-0.767005239,-0.624071644,-0.648911795,-0.624991649,-0.602093732,-0.689929213,-0.799027046,-0.476205295,-0.036925666,0.395198364,0.390189445,0.321623971,0.344547945,0.648636859,0.504424477,0.919042344,1.224153486,1.143704106,1.056047014,0.814748984,0.296068259,-0.758033683,-1.304545078) > x <- c(4998.477077,4869.464392,5029.318192,5141.405027,4868.991452,4910.137253,4932.838384,5000.468837,5037.831116,5109.718032,5141.405027,5024.688789,4921.487818,4947.972471,4992.055913,5034.520534,5061.005188,5368.88928,5365.578699,5415.137423,5657.755764,5946.249307,6162.382994,6531.649318,6877.84157,7060.769441,7039.48713,7568.507253,8069.350962,7172.556276,7589.489563,7489.699174,7157.595129,7071.047066,7399.167589,7236.849088,7366.334713,7729.925753,7531.190855,7646.015332,7535.347317,7429.408704,7373.128816,7415.220497,7772.190375,8053.116874,8367.04919,8390.223261,9170.101709,9526.598646,9507.681036,8787.020118,8719.489665,8695.842653,9068.146618,8548.4853,8739.653155,9288.936767,9076.686602,9292.074409) > 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.07634978 2 -0.34844214 3 -0.28299446 4 -0.00722197 5 0.55166008 6 0.44276644 7 0.33785960 8 0.32324131 9 0.11516548 10 0.39962716 11 0.19277803 12 0.41802780 13 -0.05968698 14 0.13458838 15 0.12508138 16 0.11588106 17 0.01015641 18 0.04360742 19 0.14432301 20 0.13358930 21 0.48114747 22 0.31878974 23 0.07207255 24 -0.10776579 25 0.01740494 26 -0.12215644 27 -0.21755628 28 -0.03194694 29 -0.14020405 30 0.05361605 31 -0.13654710 32 -0.21497745 33 -0.74321495 34 -0.82450763 35 -0.59545233 36 -0.56038888 37 -0.68839875 38 -0.76701038 39 -0.62407555 40 -0.64891641 41 -0.62499558 42 -0.60209700 43 -0.68993213 44 -0.79903023 45 -0.47621070 46 -0.03693281 47 0.39518926 48 0.39018020 49 0.32160988 50 0.34453163 51 0.64862066 52 0.50441277 53 0.91903105 54 1.22414234 55 1.14369065 56 1.05603679 57 0.81473757 58 0.29605343 59 -0.75804720 60 -1.30455993 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1im0o1257348672.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/2i0ft1257348672.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/372o51257348672.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/408iz1257348672.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/5hsbg1257348672.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/6c6ww1257348672.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/7h8on1257348672.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/8le5v1257348672.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. 4869 5133 7205 6904 8057 9527 > > #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/9134h1257348672.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/10ewj61257348672.tab") > > system("convert tmp/1im0o1257348672.ps tmp/1im0o1257348672.png") > system("convert tmp/2i0ft1257348672.ps tmp/2i0ft1257348672.png") > system("convert tmp/372o51257348672.ps tmp/372o51257348672.png") > system("convert tmp/408iz1257348672.ps tmp/408iz1257348672.png") > system("convert tmp/5hsbg1257348672.ps tmp/5hsbg1257348672.png") > system("convert tmp/6c6ww1257348672.ps tmp/6c6ww1257348672.png") > system("convert tmp/7h8on1257348672.ps tmp/7h8on1257348672.png") > system("convert tmp/8le5v1257348672.ps tmp/8le5v1257348672.png") > > > proc.time() user system elapsed 1.614 1.198 3.641