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(0.58221562,0.667829373,0.815364813,0.712949808,0.770108222,1.011600912,1.026041596,1.057790294,1.211940974,1.088561953,1.131402111,0.91228271,0.78845736,0.810930216,0.737164066,1.026041596,1.1442228,1.075002423,0.97455964,0.982078472,0.815364813,0.854415328,0.75612198,0.779324877,1.064710737,0.966983846,0.982078472,0.593326845,0.285178942,-0.127833372,0.246860078,0.231111721,0.231111721,0.254642218,0.09531018,0.31481074,0.19062036,0.553885113,0.565313809,0.392042088,0.039220713,0.482426149,0.39877612,0.58221562,0.587786665,0.457424847,0.620576488,0.553885113,0.463734016,0.231111721,0.122217633,0.652325186,0.959350221,0.815364813,0.879626748,0.815364813,0.708035793,1.050821625,0.936093359,0.819779831,0.815364813,0.943905899,1.121677562,1.01523068,0.920282753,1.05431203,1.1442228,1.134622726,1.150572028,0.904218151,0.943905899,1.061256502) > x <- c(5.272486607,5.275560379,5.278114659,5.279134547,5.279134547,5.279134547,5.279134547,5.283203729,5.28675073,5.288267031,5.289276622,5.2907891,5.291292752,5.295814236,5.298317367,5.304796333,5.309257307,5.312713247,5.315666005,5.315666005,5.318119994,5.31861007,5.319589502,5.320567975,5.322033893,5.323497665,5.326418797,5.330300412,5.332235585,5.333201768,5.336576079,5.33753808,5.339939041,5.340418543,5.342334252,5.342812606,5.345677938,5.346154696,5.346631227,5.347107531,5.350909817,5.353752073,5.355170178,5.356586275,5.357529226,5.358471289,5.360822572,5.363168339,5.364573162,5.365976015,5.367376902,5.369707363,5.370638028,5.374815338,5.377128547,5.379436418,5.380818588,5.382198851,5.384036242,5.384953673,5.387243576,5.388615005,5.390440655,5.395444077,5.39771011,5.398162702,5.401776075,5.402677382,5.403577877,5.404927102,5.40672324,5.407620101) > 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.158925761 2 -0.073064216 3 0.074677137 4 -0.027655649 5 0.029502765 6 0.270995455 7 0.285436139 8 0.317512874 9 0.471949496 10 0.348692711 11 0.391614258 12 0.172616785 13 0.048832037 14 0.071669393 15 -0.001894967 16 0.287504865 17 0.406045691 18 0.337103915 19 0.236899168 20 0.244418000 21 0.077902170 22 0.116992192 23 0.018777801 24 0.042059578 25 0.327563613 26 0.229954724 27 0.245284837 28 -0.143153873 29 -0.451145772 30 -0.864080197 31 -0.489114727 32 -0.504785532 33 -0.504591978 34 -0.481022826 35 -0.640200429 36 -0.420661307 37 -0.544620698 38 -0.181317511 39 -0.169850399 40 -0.343083723 41 -0.695598576 42 -0.252164012 43 -0.335699720 44 -0.152146061 45 -0.146499000 46 -0.276784874 47 -0.113443684 48 -0.179945955 49 -0.269983802 50 -0.502493006 51 -0.611274161 52 -0.080978738 53 0.226121323 54 0.082472669 55 0.146921083 56 0.082845197 57 -0.024372399 58 0.318524703 59 0.203944558 60 0.087704989 61 0.083474572 62 0.212126216 63 0.390045054 64 0.284001523 65 0.189236272 66 0.323302035 67 0.413504097 68 0.403976682 69 0.419998578 70 0.173753468 71 0.213586012 72 0.331008916 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1jm1r1291411029.ps",horizontal=F,onefile=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/2jm1r1291411029.ps",horizontal=F,onefile=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/3bv0b1291411029.ps",horizontal=F,onefile=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/4bv0b1291411029.ps",horizontal=F,onefile=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/5bv0b1291411029.ps",horizontal=F,onefile=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/6bv0b1291411029.ps",horizontal=F,onefile=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/74nhw1291411029.ps",horizontal=F,onefile=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/8xwzz1291411029.ps",horizontal=F,onefile=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. 5.272 5.315 5.344 5.342 5.375 5.408 > > #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/9iwfn1291411029.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/10mfeb1291411029.tab") > > try(system("convert tmp/1jm1r1291411029.ps tmp/1jm1r1291411029.png",intern=TRUE)) character(0) > try(system("convert tmp/2jm1r1291411029.ps tmp/2jm1r1291411029.png",intern=TRUE)) character(0) > try(system("convert tmp/3bv0b1291411029.ps tmp/3bv0b1291411029.png",intern=TRUE)) character(0) > try(system("convert tmp/4bv0b1291411029.ps tmp/4bv0b1291411029.png",intern=TRUE)) character(0) > try(system("convert tmp/5bv0b1291411029.ps tmp/5bv0b1291411029.png",intern=TRUE)) character(0) > try(system("convert tmp/6bv0b1291411029.ps tmp/6bv0b1291411029.png",intern=TRUE)) character(0) > try(system("convert tmp/74nhw1291411029.ps tmp/74nhw1291411029.png",intern=TRUE)) character(0) > try(system("convert tmp/8xwzz1291411029.ps tmp/8xwzz1291411029.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.717 1.281 3.898