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(6.031286041,5.987331016,5.991464547,6.057369322,5.969346742,5.984439932,5.978379308,5.969985515,6.010408963,6.035720638,6.061689992,6.115560945,6.058538913,6.042395276,6.071776449,6.05713524,6.058889523,6.029121538,6.069813514,6.067615075,6.085865223,6.144400203,6.130138942,6.214107973,6.272877007,6.342561463,6.335497416,6.37502482,6.49375384,6.43775165,6.434466259,6.457162043,6.431411594,6.397929156,6.420157781,6.475047434,6.461077475,6.492542819,6.507874549,6.489584798,6.512636463,6.50204014,6.484253483,6.500914225,6.510258341,6.610022871,6.672349351,6.664727847,6.741405492,6.818650804,6.896188643,6.788690172,6.748759547,6.789253235,6.843216758,6.816188085,6.712044485,6.779921907,6.592359368,6.656726524) > x <- c(1.785909056,1.825355419,1.906575144,2.071913275,1.808288771,1.819698838,1.77070606,1.893111963,1.906575144,1.922787732,1.979621206,2.043166486,1.854734268,1.902107526,1.982379829,1.960798762,1.924248652,1.998773639,1.948763218,1.981001469,1.924978313,1.997417706,2.019558832,2.118061113,2.201659174,2.279316466,2.282382386,2.449711158,2.633326655,2.48906466,2.423031246,2.429658176,2.545531272,2.449279472,2.514465452,2.628285233,2.565718293,2.608598122,2.659559992,2.590392158,2.598979106,2.604909442,2.52332576,2.54709867,2.493205453,2.622855355,2.664446564,2.629006994,2.703372612,2.844327819,3.003700443,2.817801065,2.811809435,2.824943953,2.865623588,2.867330559,2.608598122,2.507971923,2.307572635,2.293544348) > 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.083944257 2 0.009438284 3 -0.049332326 4 -0.111480843 5 0.004672016 6 0.010928185 7 0.042812144 8 -0.060384213 9 -0.030387910 10 -0.017632778 11 -0.035680574 12 -0.031025022 13 0.057892456 14 0.005058543 15 -0.027730653 16 -0.025657468 17 0.004404634 18 -0.083082462 19 -0.003657744 20 -0.030824496 21 0.030815217 22 0.033246365 23 0.001836948 24 0.009516612 25 0.003539499 26 0.013078894 27 0.003640313 28 -0.086427314 29 -0.109907285 30 -0.054179512 31 -0.006322459 32 0.011240812 33 -0.104252586 34 -0.063188640 35 -0.091446126 36 -0.124709143 37 -0.090221420 38 -0.091966220 39 -0.116104123 40 -0.080823842 41 -0.064422712 42 -0.079612041 43 -0.034212674 44 -0.035963894 45 0.015120163 46 0.014471699 47 0.044586062 48 0.064412271 49 0.083494235 50 0.051570669 51 0.005675462 52 0.042154833 53 0.006864686 54 0.037185776 55 0.059643190 56 0.031292480 57 0.127535446 58 0.273347195 59 0.240992583 60 0.316224555 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1td1e1257172620.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/2t5i11257172620.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/37wqf1257172620.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/45m5t1257172620.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/5ze8o1257172620.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/6opj01257172620.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/756ov1257172620.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/8tyzw1257172620.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.771 1.975 2.426 2.321 2.609 3.004 > > #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/9w1ac1257172620.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/10r8wx1257172620.tab") > > system("convert tmp/1td1e1257172620.ps tmp/1td1e1257172620.png") > system("convert tmp/2t5i11257172620.ps tmp/2t5i11257172620.png") > system("convert tmp/37wqf1257172620.ps tmp/37wqf1257172620.png") > system("convert tmp/45m5t1257172620.ps tmp/45m5t1257172620.png") > system("convert tmp/5ze8o1257172620.ps tmp/5ze8o1257172620.png") > system("convert tmp/6opj01257172620.ps tmp/6opj01257172620.png") > system("convert tmp/756ov1257172620.ps tmp/756ov1257172620.png") > system("convert tmp/8tyzw1257172620.ps tmp/8tyzw1257172620.png") > > > proc.time() user system elapsed 1.624 1.206 2.346