R version 2.8.1 (2008-12-22) 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(0.732368,0.751416,0.760806,0.756122,0.741937,0.737164,0.741937,0.737164,0.732368,0.727549,0.732368,0.737164,0.746688,0.788457,0.883768,0.900161,0.916291,0.951658,1.011601,1.022451,1.064711,1.108563,1.131402,1.172482,1.211941,1.255616,1.283708,1.300192,1.319086,1.34025,1.358409,1.381282,1.406097,1.420696,1.465568,1.519513,1.532557,1.519513,1.549688,1.512927,1.458615,1.472472,1.528228,1.549688,1.543298,1.591274,1.558145,1.562346,1.644805,1.229641,0.996949,0.828552,0.693147,0.494696,0.262364,0.076961,0,0,0,0) > x <- c(-0.22234,-0.26167,-0.29327,-0.27148,-0.26344,-0.27771,-0.25758,-0.23854,-0.19598,-0.1854,-0.20636,-0.20343,-0.18357,-0.16433,-0.17025,-0.19087,-0.17714,-0.18399,-0.20465,-0.24451,-0.23507,-0.23776,-0.24772,-0.24114,-0.23198,-0.25317,-0.27862,-0.26229,-0.26804,-0.28081,-0.30129,-0.30092,-0.29409,-0.31598,-0.3091,-0.32902,-0.35256,-0.38417,-0.37638,-0.38649,-0.38852,-0.44,-0.45432,-0.44193,-0.44167,-0.45552,-0.4038,-0.36256,-0.28683,-0.24153,-0.29632,-0.28058,-0.24569,-0.2662,-0.27687,-0.31115,-0.33761,-0.34274,-0.35543,-0.35543) > 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.14886152 2 -0.21574614 3 -0.27539939 4 -0.23247414 5 -0.22909244 6 -0.26504415 7 -0.21628885 8 -0.17946111 9 -0.09126721 10 -0.07296983 11 -0.11394661 12 -0.10274881 13 -0.04983244 14 0.03397429 15 0.11635060 16 0.08769070 17 0.13381955 18 0.15421990 19 0.16902259 20 0.09278196 21 0.15566754 22 0.19364213 23 0.19471939 24 0.25017612 25 0.30964892 26 0.30702562 27 0.27951158 28 0.33167521 29 0.33800596 30 0.33126862 31 0.30468061 32 0.32836202 33 0.36809998 34 0.33487123 35 0.39477543 36 0.40519697 37 0.36680812 38 0.28469902 39 0.33189449 40 0.27304402 41 0.21429665 42 0.11567433 43 0.14014237 44 0.18867345 45 0.18285152 46 0.20056648 47 0.28044118 48 0.37474799 49 0.62267045 50 0.30648300 51 -0.04592038 52 -0.17992685 53 -0.23910023 54 -0.48236380 55 -0.73800882 56 -0.99831064 57 -1.13308443 58 -1.14429304 59 -1.17201958 60 -1.17201958 > library(lattice) > postscript(file="/var/www/rcomp/tmp/123j61256759181.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/rcomp/tmp/2he8o1256759181.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/rcomp/tmp/3epzi1256759181.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/rcomp/tmp/4rg8y1256759181.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/rcomp/tmp/5lpd91256759181.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/rcomp/tmp/61x981256759181.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/rcomp/tmp/7f1nu1256759181.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/rcomp/tmp/849151256759181.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.4555 -0.3389 -0.2773 -0.2878 -0.2383 -0.1643 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/9kxhy1256759181.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/rcomp/tmp/10zjj61256759181.tab") > > system("convert tmp/123j61256759181.ps tmp/123j61256759181.png") > system("convert tmp/2he8o1256759181.ps tmp/2he8o1256759181.png") > system("convert tmp/3epzi1256759181.ps tmp/3epzi1256759181.png") > system("convert tmp/4rg8y1256759181.ps tmp/4rg8y1256759181.png") > system("convert tmp/5lpd91256759181.ps tmp/5lpd91256759181.png") > system("convert tmp/61x981256759181.ps tmp/61x981256759181.png") > system("convert tmp/7f1nu1256759181.ps tmp/7f1nu1256759181.png") > system("convert tmp/849151256759181.ps tmp/849151256759181.png") > > > proc.time() user system elapsed 1.780 1.570 3.147