R version 2.8.0 (2008-10-20) 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.800641,0.769764,0.745823,0.762253,0.768403,0.757518,0.772917,0.787774,0.822030,0.830772,0.813537,0.815927,0.832293,0.848464,0.843455,0.826241,0.837661,0.831947,0.814930,0.783085,0.790514,0.788395,0.780579,0.785731,0.792959,0.776337,0.756830,0.769290,0.764877,0.755173,0.739864,0.740138,0.745212,0.729076,0.734107,0.719632,0.702889,0.681013,0.686342,0.679440,0.678058,0.644039,0.634880,0.642797,0.642963,0.634115,0.667780,0.695894,0.750638,0.785423,0.743550,0.755344,0.782167,0.766284,0.758150,0.732601,0.713470,0.709824,0.700869,0.700869) > x <- c(2.08,2.12,2.14,2.13,2.10,2.09,2.10,2.09,2.08,2.07,2.08,2.09,2.11,2.20,2.42,2.46,2.50,2.59,2.75,2.78,2.90,3.03,3.10,3.23,3.36,3.51,3.61,3.67,3.74,3.82,3.89,3.98,4.08,4.14,4.33,4.57,4.63,4.57,4.71,4.54,4.30,4.36,4.61,4.71,4.68,4.91,4.75,4.77,5.18,3.42,2.71,2.29,2.00,1.64,1.30,1.08,1.00,1.00,1.00,1.00) > 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.024572613 2 -0.005316013 3 -0.028762826 4 -0.012579919 5 -0.007171200 6 -0.018303294 7 -0.002657200 8 0.011952706 9 0.045961613 10 0.054456519 11 0.037468613 12 0.040105706 13 0.056965893 14 0.075360735 15 0.075787793 16 0.059562167 17 0.071970541 18 0.068480382 19 0.055416879 20 0.024313159 21 0.034707282 22 0.035800497 23 0.029714152 24 0.038078368 25 0.048518584 26 0.035602986 27 0.018566922 28 0.032509483 29 0.029826137 30 0.022098886 31 0.008519540 32 0.011017382 33 0.018562317 34 0.003908878 35 0.013634655 36 0.005089900 37 -0.010170539 38 -0.033529100 39 -0.024740791 40 -0.035843381 41 -0.043155626 42 -0.075692064 43 -0.078673726 44 -0.068285791 45 -0.068861072 46 -0.072025921 47 -0.042314417 48 -0.013706230 49 0.051168604 50 0.042465145 51 -0.016951495 52 -0.015535423 53 0.004121865 54 -0.020656502 55 -0.037191682 56 -0.068176739 57 -0.089284487 58 -0.092930487 59 -0.101885487 60 -0.101885487 > library(lattice) > postscript(file="/var/www/html/freestat/rcomp/tmp/1fl5j1257354748.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/freestat/rcomp/tmp/2gkmf1257354748.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/freestat/rcomp/tmp/3dnqf1257354748.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/freestat/rcomp/tmp/4zasv1257354748.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/freestat/rcomp/tmp/5y38k1257354748.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/freestat/rcomp/tmp/6kp7f1257354748.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/freestat/rcomp/tmp/7ejmc1257354748.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/freestat/rcomp/tmp/8kkhl1257354748.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.000 2.098 2.840 3.052 4.180 5.180 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/9oy041257354748.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/freestat/rcomp/tmp/10ddjb1257354748.tab") > > system("convert tmp/1fl5j1257354748.ps tmp/1fl5j1257354748.png") > system("convert tmp/2gkmf1257354748.ps tmp/2gkmf1257354748.png") > system("convert tmp/3dnqf1257354748.ps tmp/3dnqf1257354748.png") > system("convert tmp/4zasv1257354748.ps tmp/4zasv1257354748.png") > system("convert tmp/5y38k1257354748.ps tmp/5y38k1257354748.png") > system("convert tmp/6kp7f1257354748.ps tmp/6kp7f1257354748.png") > system("convert tmp/7ejmc1257354748.ps tmp/7ejmc1257354748.png") > system("convert tmp/8kkhl1257354748.ps tmp/8kkhl1257354748.png") > > > proc.time() user system elapsed 2.572 1.908 2.968