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(3.967916254,3.967916254,3.968505941,3.968653363,3.968653363,3.969832737,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.97012758,3.969508409,3.969390472,3.969390472,3.968800785,3.968653363,3.968653363,3.968240582,3.967916254,3.967385536,3.967179145,3.966677911,3.966442036,3.966029256,3.965704928,3.965704928,3.965262662,3.964967819,3.964967819,3.964525554,3.96423071,3.96423071,3.96423071,3.96423071,3.96423071,3.96423071,3.96423071,3.96423071,3.96423071,3.96423071,3.96423071,3.96423071,3.963699992,3.963493601,3.963493601,3.22355257,2.964466585,2.966442036) > x <- c(2.164990976,1.994990976,1.910193625,1.951494287,1.921494287,2.011899584,1.974500909,1.954500909,1.984500909,1.974500909,1.994500909,1.984500909,1.984500909,1.894500909,1.874500909,1.774500909,1.884500909,1.904500909,1.934500909,1.934500909,1.934500909,1.934500909,1.974500909,1.994500909,1.984500909,1.954500909,1.944500909,1.954500909,1.944500909,1.934500909,1.924500909,1.934500909,1.944500909,1.964500909,2.054500909,2.101038128,2.107997598,2.147997598,2.072794949,2.191494287,2.221494287,2.225852433,2.264990976,2.186308593,2.258487666,2.248065414,2.331984355,2.316342501,2.285481044,2.355481044,2.311579057,2.298977733,2.388977733,2.365075747,2.342474422,2.532474422,2.772474422,2.832474422,2.772474422,2.912474422,2.742474422,2.502474422,2.562474422,2.812474422,2.912474422,2.882474422,2.963792039,2.745971112,2.765971112,3.192491376,1.688555482,1.531984355) > 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 3.988971e-02 2 4.748234e-02 3 5.185930e-02 4 5.016213e-02 5 5.150200e-02 6 4.864364e-02 7 5.060881e-02 8 5.150206e-02 9 5.016218e-02 10 5.060881e-02 11 4.971556e-02 12 5.016218e-02 13 5.016218e-02 14 5.418181e-02 15 5.507507e-02 16 5.954132e-02 17 5.462844e-02 18 5.373519e-02 19 5.239531e-02 20 5.239531e-02 21 5.239531e-02 22 5.239531e-02 23 5.060881e-02 24 4.971556e-02 25 5.016218e-02 26 5.150206e-02 27 5.194869e-02 28 5.150206e-02 29 5.194869e-02 30 5.239531e-02 31 5.284194e-02 32 5.239531e-02 33 5.194869e-02 34 5.105543e-02 35 4.703580e-02 36 4.433816e-02 37 4.390939e-02 38 4.212289e-02 39 4.489195e-02 40 3.944311e-02 41 3.810323e-02 42 3.749580e-02 43 3.542345e-02 44 3.840689e-02 45 3.497679e-02 46 3.494104e-02 47 3.095713e-02 48 3.124296e-02 49 3.229698e-02 50 2.917060e-02 51 3.068911e-02 52 3.095708e-02 53 2.693745e-02 54 2.756271e-02 55 2.827729e-02 56 1.979141e-02 57 9.072387e-03 58 6.392633e-03 59 9.072387e-03 60 2.819627e-03 61 1.041226e-02 62 2.113128e-02 63 1.845153e-02 64 7.285884e-03 65 2.819627e-03 66 4.159504e-03 67 -3.067895e-06 68 9.518984e-03 69 8.625733e-03 70 -7.503648e-01 71 -9.422811e-01 72 -9.333128e-01 > library(lattice) > postscript(file="/var/www/rcomp/tmp/1rsxd1257762206.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/2mg7q1257762206.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/34bjj1257762206.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/42jvn1257762206.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/5if591257762206.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/61lm11257762206.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/724nh1257762206.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/8pc741257762206.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. 1.532 1.945 2.064 2.202 2.346 3.192 > > #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/9bgs81257762206.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/10rws11257762206.tab") > > system("convert tmp/1rsxd1257762206.ps tmp/1rsxd1257762206.png") > system("convert tmp/2mg7q1257762206.ps tmp/2mg7q1257762206.png") > system("convert tmp/34bjj1257762206.ps tmp/34bjj1257762206.png") > system("convert tmp/42jvn1257762206.ps tmp/42jvn1257762206.png") > system("convert tmp/5if591257762206.ps tmp/5if591257762206.png") > system("convert tmp/61lm11257762206.ps tmp/61lm11257762206.png") > system("convert tmp/724nh1257762206.ps tmp/724nh1257762206.png") > system("convert tmp/8pc741257762206.ps tmp/8pc741257762206.png") > > > proc.time() user system elapsed 1.770 1.720 3.415