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.457424847,0.463734016,0.470003629,0.470003629,0.470003629,0.470003629,0.476234179,0.476234179,0.482426149,0.488580015,0.488580015,0.488580015,0.488580015,0.488580015,0.494696242,0.494696242,0.494696242,0.500775288,0.500775288,0.500775288,0.500775288,0.500775288,0.506817602,0.512823626,0.518793793,0.518793793,0.518793793,0.518793793,0.524728529,0.530628251,0.530628251,0.536493371,0.548121409,0.548121409,0.548121409,0.553885113,0.553885113,0.553885113,0.559615788,0.576613364,0.598836501,0.604315967,0.609765572,0.615185639,0.620576488,0.620576488,0.625938431,0.625938431,0.625938431,0.625938431,0.625938431,0.625938431,0.625938431,0.631271777,0.631271777,0.625938431,0.625938431,0.625938431,0.625938431,0.625938431,0.625938431) > x <- c(-0.597837001,-0.597837001,-0.597837001,-0.597837001,-0.597837001,-0.579818495,-0.579818495,-0.579818495,-0.579818495,-0.579818495,-0.597837001,-0.579818495,-0.597837001,-0.597837001,-0.579818495,-0.597837001,-0.597837001,-0.597837001,-0.597837001,-0.634878272,-0.634878272,-0.634878272,-0.634878272,-0.616186139,-0.616186139,-0.616186139,-0.597837001,-0.597837001,-0.616186139,-0.597837001,-0.579818495,-0.544727175,-0.527632742,-0.510825624,-0.510825624,-0.510825624,-0.527632742,-0.510825624,-0.510825624,-0.478035801,-0.430782916,-0.385662481,-0.314710745,-0.248461359,-0.248461359,-0.198450939,-0.198450939,-0.210721031,-0.186329578,-0.162518929,-0.15082289,-0.162518929,-0.162518929,-0.198450939,-0.223143551,-0.210721031,-0.223143551,-0.223143551,-0.223143551,-0.223143551,-0.235722334) > 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 -4.599088e-02 2 -3.968171e-02 3 -3.341210e-02 4 -3.341210e-02 5 -3.341210e-02 6 -3.917303e-02 7 -3.294248e-02 8 -3.294248e-02 9 -2.675051e-02 10 -2.059665e-02 11 -1.483572e-02 12 -2.059665e-02 13 -1.483572e-02 14 -1.483572e-02 15 -1.448042e-02 16 -8.719489e-03 17 -8.719489e-03 18 -2.640443e-03 19 -2.640443e-03 20 9.202501e-03 21 9.202501e-03 22 9.202501e-03 23 1.524482e-02 24 1.527454e-02 25 2.124470e-02 26 2.124470e-02 27 1.537806e-02 28 1.537806e-02 29 2.717944e-02 30 2.721252e-02 31 2.145159e-02 32 1.609721e-02 33 2.225977e-02 34 1.688614e-02 35 1.688614e-02 36 2.264985e-02 37 2.802347e-02 38 2.264985e-02 39 2.838052e-02 40 3.489444e-02 41 4.200975e-02 42 3.306317e-02 43 1.582788e-02 44 6.649825e-05 45 5.457347e-03 46 -1.053213e-02 47 -5.170189e-03 48 -1.247159e-03 49 -9.045666e-03 50 -1.665848e-02 51 -2.039797e-02 52 -1.665848e-02 53 -1.665848e-02 54 1.631574e-04 55 8.057952e-03 56 -1.247159e-03 57 2.724606e-03 58 2.724606e-03 59 2.724606e-03 60 2.724606e-03 61 6.746332e-03 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1755l1256942215.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/2dvm51256942215.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/35b4d1256942215.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/41yn41256942215.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/5c18h1256942215.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/6l8x31256942215.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/7i4401256942215.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/8i9je1256942215.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. -0.6349 -0.5978 -0.5798 -0.4601 -0.2357 -0.1508 > > #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/9mxdc1256942215.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/10n4q01256942215.tab") > > system("convert tmp/1755l1256942215.ps tmp/1755l1256942215.png") > system("convert tmp/2dvm51256942215.ps tmp/2dvm51256942215.png") > system("convert tmp/35b4d1256942215.ps tmp/35b4d1256942215.png") > system("convert tmp/41yn41256942215.ps tmp/41yn41256942215.png") > system("convert tmp/5c18h1256942215.ps tmp/5c18h1256942215.png") > system("convert tmp/6l8x31256942215.ps tmp/6l8x31256942215.png") > system("convert tmp/7i4401256942215.ps tmp/7i4401256942215.png") > system("convert tmp/8i9je1256942215.ps tmp/8i9je1256942215.png") > > > proc.time() user system elapsed 1.550 1.119 2.020