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(2.433613355,2.415913778,2.397895273,2.459588842,2.517696473,2.48490665,2.493205453,2.48490665,2.468099531,2.541601993,2.509599262,2.4765384,2.48490665,2.509599262,2.549445171,2.517696473,2.509599262,2.541601993,2.541601993,2.557227311,2.564949357,2.501435952,2.509599262,2.549445171,2.549445171,2.549445171,2.501435952,2.533696814,2.549445171,2.525728644,2.517696473,2.509599262,2.4765384,2.459588842,2.48490665,2.493205453,2.459588842,2.468099531,2.468099531,2.468099531,2.424802726,2.424802726,2.424802726,2.415913778,2.433613355,2.501435952,2.557227311,2.57261223,2.602689685,2.610069793,2.667228207,2.646174797,2.714694744,2.76000994,2.766319109,2.734367509,2.740840024,2.694627181,2.58021683,2.541601993,2.493205453,2.4765384,2.360854001,2.370243741,2.282382386,2.197224577,2.116255515,2.2300144,2.197224577) > x <- c(2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.48490665,2.502255288,2.505525937,2.505525937,2.521720623,2.525728644,2.525728644,2.536866389,2.545531272,2.559550193,2.564949357,2.577941516,2.583997552,2.59450816,2.602689685,2.602689685,2.613739522,2.621038824,2.621038824,2.63188884,2.63905733,2.63905733,2.63905733,2.63905733,2.63905733,2.63905733,2.63905733,2.63905733,2.63905733,2.63905733,2.63905733,2.63905733,2.651832521,2.656756907,2.656756907,2.636912173,2.596746132,2.545531272,2.51041194,2.48490665,2.456164181,2.42568729,2.406043801,2.397895273,2.397895273,2.397895273,2.397895273) > 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.01410260 2 -0.03180218 3 -0.04982068 4 0.01187288 5 0.06998052 6 0.03719069 7 0.04548950 8 0.03719069 9 0.02038357 10 0.09388604 11 0.06188330 12 0.02882244 13 0.03719069 14 0.06188330 15 0.10172921 16 0.06998052 17 0.06188330 18 0.09388604 19 0.09388604 20 0.10951135 21 0.11723340 22 0.05371999 23 0.06188330 24 0.08458708 25 0.08135536 26 0.08135536 27 0.01734423 28 0.04564478 29 0.06139313 30 0.02667144 31 0.01007752 32 -0.01187174 33 -0.05026750 34 -0.08005457 35 -0.06072071 36 -0.06280740 37 -0.10450815 38 -0.09599746 39 -0.10691577 40 -0.11412819 41 -0.15742499 42 -0.16814586 43 -0.17522902 44 -0.18411797 45 -0.16641839 46 -0.09859579 47 -0.04280443 48 -0.02741952 49 0.00265794 50 0.01003805 51 0.06719646 52 0.04614305 53 0.11466300 54 0.15997819 55 0.15366424 56 0.11684687 57 0.12331938 58 0.09671506 59 0.02199264 60 0.03398304 61 0.02028780 62 0.02882244 63 -0.05846162 64 -0.01895776 65 -0.08740945 66 -0.16451572 67 -0.24548478 68 -0.13172590 69 -0.16451572 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1tdpv1256750590.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/20oyb1256750590.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/3yaf51256750590.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/4eomn1256750590.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/58kln1256750590.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/6t5oj1256750590.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/7taf91256750590.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/82aex1256750590.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. 2.398 2.485 2.510 2.539 2.621 2.657 > > #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/942sa1256750590.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/10tqn51256750590.tab") > > system("convert tmp/1tdpv1256750590.ps tmp/1tdpv1256750590.png") > system("convert tmp/20oyb1256750590.ps tmp/20oyb1256750590.png") > system("convert tmp/3yaf51256750590.ps tmp/3yaf51256750590.png") > system("convert tmp/4eomn1256750590.ps tmp/4eomn1256750590.png") > system("convert tmp/58kln1256750590.ps tmp/58kln1256750590.png") > system("convert tmp/6t5oj1256750590.ps tmp/6t5oj1256750590.png") > system("convert tmp/7taf91256750590.ps tmp/7taf91256750590.png") > system("convert tmp/82aex1256750590.ps tmp/82aex1256750590.png") > > > proc.time() user system elapsed 1.588 1.147 2.009