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(3.861884491,3.86432807,3.864492015,3.863257308,3.860453306,3.849318732,3.844063366,3.844181192,3.845531265,3.835138386,3.840896665,3.843161358,3.848062114,3.850490024,3.851442229,3.853087325,3.851779838,3.840943954,3.834650174,3.835185604,3.840041333,3.85185285,3.855980758,3.85724753,3.854755941,3.861171308,3.865913967,3.869739954,3.86908917,3.85765146,3.84534727,3.838506216,3.853366873,3.8585208,3.864809349,3.865086762,3.871043125,3.873953266,3.871181262,3.874806751,3.874289451,3.854408916,3.840662338,3.833562198,3.850478329,3.861866435,3.865858029,3.872258448,3.872886015,3.876970667,3.873825677,3.878687726,3.872366111,3.860679016,3.848518938,3.84031302,3.86456395,3.879947833,3.893237105,3.903049256,3.912810243,3.919609086,3.930075738,3.933031449,3.933305731,3.926413182,3.910060531,3.903890717,3.922433331) > x <- c(3.109060959,3.310543013,3.310543013,3.414442608,3.56671182,3.234749174,3.310543013,3.27336401,3.478158423,3.346389145,3.346389145,3.414442608,3.5085559,3.310543013,3.152736022,3.015534901,3.109060959,3.194583132,3.194583132,3.27336401,3.380994674,3.346389145,3.109060959,2.912350665,3.234749174,3.310543013,3.152736022,2.734367509,2.965273066,3.27336401,3.414442608,3.310543013,3.310543013,3.063390922,3.310543013,3.414442608,3.538056564,3.5085559,3.594568775,3.56671182,3.621670704,3.5085559,3.56671182,3.478158423,3.346389145,3.346389145,3.446807893,3.5085559,3.5085559,3.346389145,3.478158423,3.414442608,3.346389145,3.27336401,3.310543013,3.194583132,2.965273066,3.152736022,2.912350665,2.912350665,2.517696473,2.341805806,2.00148,1,2.174751721,2.186051277,2.564949357,2.884800713,2.587764035) > 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.007006867 2 0.004209398 3 0.004373343 4 0.007662506 5 0.011488424 6 -0.014100063 7 -0.016055306 8 -0.017556283 9 -0.007289301 10 -0.023419517 11 -0.017661238 12 -0.012433444 13 -0.003434922 14 -0.009628648 15 -0.015547483 16 -0.019876231 17 -0.017111520 18 -0.024223702 19 -0.030517482 20 -0.026551871 21 -0.017009819 22 -0.006705053 23 -0.012910600 24 -0.020208748 25 -0.008662854 26 0.001052636 27 -0.001075745 28 -0.015465850 29 -0.006062826 30 -0.004086015 31 -0.010247532 32 -0.021612456 33 -0.006751799 34 -0.012359067 35 0.004690677 36 0.009491960 37 0.020830571 38 0.022456230 39 0.023429294 40 0.025841869 41 0.027717522 42 0.002911880 43 -0.008302544 44 -0.019258368 45 -0.008079574 46 0.003308532 47 0.011672436 48 0.020761412 49 0.021388979 50 0.018412764 51 0.021005111 52 0.023092924 53 0.013808208 54 -0.001058459 55 -0.011599734 56 -0.024854636 57 -0.010588046 58 0.012958121 59 0.015780827 60 0.025592978 61 0.018170412 62 0.017310838 63 0.012959438 64 -0.027690074 65 0.023733817 66 0.017333260 67 0.017478128 68 0.025234892 69 0.030844297 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1z91s1256766546.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/2pixy1256766546.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/38xtg1256766546.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/4r0ti1256766546.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/59hsq1256766546.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/6nkyp1256766546.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/7kzcq1256766546.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/8nuv31256766546.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 3.109 3.311 3.163 3.414 3.622 > > #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/989pd1256766546.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/105srl1256766546.tab") > > system("convert tmp/1z91s1256766546.ps tmp/1z91s1256766546.png") > system("convert tmp/2pixy1256766546.ps tmp/2pixy1256766546.png") > system("convert tmp/38xtg1256766546.ps tmp/38xtg1256766546.png") > system("convert tmp/4r0ti1256766546.ps tmp/4r0ti1256766546.png") > system("convert tmp/59hsq1256766546.ps tmp/59hsq1256766546.png") > system("convert tmp/6nkyp1256766546.ps tmp/6nkyp1256766546.png") > system("convert tmp/7kzcq1256766546.ps tmp/7kzcq1256766546.png") > system("convert tmp/8nuv31256766546.ps tmp/8nuv31256766546.png") > > > proc.time() user system elapsed 1.639 1.200 2.920