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(-540.33,-523.22,-503.80,-480.13,-452.36,-453.28,-661.26,-718.93,-712.26,-670.19,-623.90,-611.27,-602.79,-577.93,-552.90,-536.12,-504.48,-518.66,-732.24,-774.67,-772.03,-717.16,-662.92,-656.24,-649.06,-632.14,-592.99,-560.51,-525.84,-537.76,-733.93,-778.58,-772.77,-702.91,-652.63,-635.84,-607.10,-589.02,-556.86,-530.38,-506.83,-506.39,-695.70,-733.00,-732.26,-681.35,-631.57,-604.75,-562.64,-554.09,-522.00,-499.05,-481.10,-486.21,-654.56,-687.20,-689.68,-615.44,-557.36,-517.26) > x <- c(-541.92,-525.95,-508.18,-487.35,-460.37,-460.77,-669.77,-731.59,-722.54,-678.58,-632.18,-622.86,-616.41,-595.08,-567.00,-546.17,-514.43,-530.00,-744.66,-790.91,-780.96,-726.99,-675.13,-669.87,-664.81,-648.05,-607.95,-577.31,-546.17,-554.39,-754.57,-804.78,-795.53,-731.15,-678.08,-657.36,-631.28,-614.61,-585.32,-559.84,-533.66,-537.62,-732.75,-776.80,-772.70,-720.64,-665.67,-639.99,-602.99,-591.98,-556.54,-544.37,-526.10,-531.06,-704.67,-738.21,-729.55,-648.80,-589.78,-554.99) > 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 -18.7680743 2 -17.1768336 3 -15.0247330 4 -11.5961705 5 -10.0438365 6 -10.5751387 7 -15.4605427 8 -13.0572991 9 -15.1815866 10 -15.8294739 11 -14.6284177 12 -11.0550762 13 -8.8428281 14 -4.7101378 15 -6.9667228 16 -10.4281603 17 -9.6313300 18 -8.6812685 19 -13.6665987 20 -11.1534166 21 -18.1822742 22 -15.7573237 23 -11.9119923 24 -10.3433683 25 -8.0803954 26 -7.4468328 27 -7.2637864 28 -4.5580372 29 -0.1481603 30 -4.0804207 31 -5.7266110 32 -1.5853207 33 -4.7639571 34 2.5351333 35 1.2446539 36 -2.0998917 37 1.2970123 38 3.1780318 39 6.8756361 40 8.5955867 41 6.7053163 42 10.9934244 43 11.2999245 44 16.8052688 45 13.5611164 46 13.8820989 47 10.2453049 48 12.1109067 49 18.2663610 50 16.1174543 51 13.7688300 52 24.8926997 53 25.0889280 54 24.7987806 55 25.1533396 56 25.1056494 57 14.2103422 58 9.9819755 59 10.7096164 60 17.0026260 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/10whx1261147904.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/272js1261147904.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/3a7xo1261147904.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/4m8zx1261147904.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/5pyak1261147904.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/6fvmc1261147904.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/7bf8x1261147904.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/8spxz1261147904.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. -804.8 -721.1 -627.1 -631.8 -552.3 -460.4 > > #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/95u021261147905.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/10ktdp1261147905.tab") > > try(system("convert tmp/10whx1261147904.ps tmp/10whx1261147904.png",intern=TRUE)) character(0) > try(system("convert tmp/272js1261147904.ps tmp/272js1261147904.png",intern=TRUE)) character(0) > try(system("convert tmp/3a7xo1261147904.ps tmp/3a7xo1261147904.png",intern=TRUE)) character(0) > try(system("convert tmp/4m8zx1261147904.ps tmp/4m8zx1261147904.png",intern=TRUE)) character(0) > try(system("convert tmp/5pyak1261147904.ps tmp/5pyak1261147904.png",intern=TRUE)) character(0) > try(system("convert tmp/6fvmc1261147904.ps tmp/6fvmc1261147904.png",intern=TRUE)) character(0) > try(system("convert tmp/7bf8x1261147904.ps tmp/7bf8x1261147904.png",intern=TRUE)) character(0) > try(system("convert tmp/8spxz1261147904.ps tmp/8spxz1261147904.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.631 1.179 2.564