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(1.4,1.2,1,1.7,2.4,2,2.1,2,1.8,2.7,2.3,1.9,2,2.3,2.8,2.4,2.3,2.7,2.7,2.9,3,2.2,2.3,2.8,2.8,2.8,2.2,2.6,2.8,2.5,2.4,2.3,1.9,1.7,2,2.1,1.7,1.8,1.8,1.8,1.3,1.3,1.3,1.2,1.4,2.2,2.9,3.1,3.5,3.6,4.4,4.1,5.1,5.8,5.9,5.4,5.5,4.8,3.2,2.7,2.1,1.9,0.6,0.7,-0.2,-1,-1.7,-0.7,-1) > x <- c(0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.693147181,0.792992516,0.810930216,0.810930216,0.896088025,0.916290732,0.916290732,0.970778917,1.011600912,1.075002423,1.098612289,1.153731588,1.178654996,1.220829921,1.252762968,1.252762968,1.294727168,1.32175584,1.32175584,1.360976553,1.386294361,1.386294361,1.386294361,1.386294361,1.386294361,1.386294361,1.386294361,1.386294361,1.386294361,1.386294361,1.386294361,1.386294361,1.430311247,1.446918983,1.446918983,1.378766095,1.229640551,1.011600912,0.837247525,0.693147181,0.506817602,0.270027137,0.086177696,0,0,0,0) > 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.32060803 2 -0.52060803 3 -0.72060803 4 -0.02060803 5 0.67939197 6 0.27939197 7 0.37939197 8 0.27939197 9 0.07939197 10 0.97939197 11 0.57939197 12 0.17939197 13 0.27939197 14 0.57939197 15 1.07939197 16 0.67939197 17 0.57939197 18 0.97939197 19 0.97939197 20 1.17939197 21 1.27939197 22 0.47939197 23 0.57939197 24 0.83349755 25 0.78932142 26 0.78932142 27 -0.02040125 28 0.32984447 29 0.52984447 30 0.09565352 31 -0.10488098 32 -0.36102325 33 -0.81916852 34 -1.15491375 35 -0.91629396 36 -0.92016039 37 -1.39880360 38 -1.29880360 39 -1.40215107 40 -1.46871602 41 -1.96871602 42 -2.06530695 43 -2.12765847 44 -2.22765847 45 -2.02765847 46 -1.22765847 47 -0.52765847 48 -0.32765847 49 0.07234153 50 0.17234153 51 0.97234153 52 0.67234153 53 1.67234153 54 2.37234153 55 2.36393881 56 1.82303805 57 1.92303805 58 1.39088180 59 0.15814121 60 0.19511902 61 0.02450838 62 0.17939197 63 -0.66172427 64 0.02143221 65 -0.42579199 66 -1.01355760 67 -1.71355760 68 -0.71355760 69 -1.01355760 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1epw51256492718.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/28p581256492718.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/3kpn81256492718.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/4uc9n1256492718.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/5wq2b1256492718.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/64g7s1256492718.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/7t90u1256492718.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/8vsob1256492718.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.0000 0.6931 0.8372 0.9213 1.3220 1.4470 > > #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/9pehw1256492718.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/105jub1256492718.tab") > > system("convert tmp/1epw51256492718.ps tmp/1epw51256492718.png") > system("convert tmp/28p581256492718.ps tmp/28p581256492718.png") > system("convert tmp/3kpn81256492718.ps tmp/3kpn81256492718.png") > system("convert tmp/4uc9n1256492718.ps tmp/4uc9n1256492718.png") > system("convert tmp/5wq2b1256492718.ps tmp/5wq2b1256492718.png") > system("convert tmp/64g7s1256492718.ps tmp/64g7s1256492718.png") > system("convert tmp/7t90u1256492718.ps tmp/7t90u1256492718.png") > system("convert tmp/8vsob1256492718.ps tmp/8vsob1256492718.png") > > > proc.time() user system elapsed 1.609 1.186 12.516