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(1.58,1.59,1.6,1.6,1.6,1.6,1.61,1.61,1.62,1.63,1.63,1.63,1.63,1.63,1.64,1.64,1.64,1.65,1.65,1.65,1.65,1.65,1.66,1.67,1.68,1.68,1.68,1.68,1.69,1.7,1.7,1.71,1.73,1.73,1.73,1.74,1.74,1.74,1.75,1.78,1.82,1.83,1.84,1.85,1.86,1.86,1.87,1.87,1.87,1.87,1.87,1.87,1.87,1.88,1.88,1.87,1.87,1.87,1.87,1.87) > x <- c(0.55,0.55,0.55,0.55,0.55,0.56,0.56,0.56,0.56,0.56,0.55,0.56,0.55,0.55,0.56,0.55,0.55,0.55,0.55,0.53,0.53,0.53,0.53,0.54,0.54,0.54,0.55,0.55,0.54,0.55,0.56,0.58,0.59,0.6,0.6,0.6,0.59,0.6,0.6,0.62,0.65,0.68,0.73,0.78,0.78,0.82,0.82,0.81,0.83,0.85,0.86,0.85,0.85,0.82,0.8,0.81,0.8,0.8,0.8,0.8) > 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.0767281809 2 -0.0667281809 3 -0.0567281809 4 -0.0567281809 5 -0.0567281809 6 -0.0649388923 7 -0.0549388923 8 -0.0549388923 9 -0.0449388923 10 -0.0349388923 11 -0.0267281809 12 -0.0349388923 13 -0.0267281809 14 -0.0267281809 15 -0.0249388923 16 -0.0167281809 17 -0.0167281809 18 -0.0067281809 19 -0.0067281809 20 0.0096932418 21 0.0096932418 22 0.0096932418 23 0.0196932418 24 0.0214825304 25 0.0314825304 26 0.0314825304 27 0.0232718191 28 0.0232718191 29 0.0414825304 30 0.0432718191 31 0.0350611077 32 0.0286396851 33 0.0404289737 34 0.0322182624 35 0.0322182624 36 0.0422182624 37 0.0504289737 38 0.0422182624 39 0.0522182624 40 0.0657968397 41 0.0811647057 42 0.0665325716 43 0.0354790149 44 0.0044254582 45 0.0144254582 46 -0.0184173871 47 -0.0084173871 48 -0.0002066758 49 -0.0166280985 50 -0.0330495212 51 -0.0412602325 52 -0.0330495212 53 -0.0330495212 54 0.0015826129 55 0.0180040355 56 -0.0002066758 57 0.0080040355 58 0.0080040355 59 0.0080040355 60 0.0080040355 > library(lattice) > postscript(file="/var/www/rcomp/tmp/1vcgc1256940794.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/29k2s1256940794.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/3pay81256940794.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/4tzgz1256940794.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/5pyhk1256940794.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/6hv6k1256940794.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/7brsj1256940794.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/8n1311256940794.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.5300 0.5500 0.5600 0.6388 0.7850 0.8600 > > #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/94lus1256940794.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/10x06l1256940794.tab") > > system("convert tmp/1vcgc1256940794.ps tmp/1vcgc1256940794.png") > system("convert tmp/29k2s1256940794.ps tmp/29k2s1256940794.png") > system("convert tmp/3pay81256940794.ps tmp/3pay81256940794.png") > system("convert tmp/4tzgz1256940794.ps tmp/4tzgz1256940794.png") > system("convert tmp/5pyhk1256940794.ps tmp/5pyhk1256940794.png") > system("convert tmp/6hv6k1256940794.ps tmp/6hv6k1256940794.png") > system("convert tmp/7brsj1256940794.ps tmp/7brsj1256940794.png") > system("convert tmp/8n1311256940794.ps tmp/8n1311256940794.png") > > > proc.time() user system elapsed 1.830 1.560 3.179