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.034947641,0.034947641,0.025154648,0.0227064,0.0227064,0.003120415,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,-0.001776081,0.008506561,0.01046516,0.01046516,0.020258152,0.0227064,0.0227064,0.029561495,0.034947641,0.043761334,0.047188881,0.055512925,0.059430122,0.066285216,0.071671362,0.071671362,0.079016106,0.083912603,0.083912603,0.091257347,0.096153843,0.096153843,0.096153843,0.096153843,0.096153843,0.096153843,0.096153843,0.096153843,0.096153843,0.096153843,0.096153843,0.096153843,0.104967536,0.108395084,0.108395084,-0.632584216,-0.907763354,-0.940569878) > x <- c(-0.015358691,-0.185358691,-0.202353256,-0.144101897,-0.174101897,0.051908975,0.048411693,0.028411693,0.058411693,0.048411693,0.068411693,0.058411693,0.058411693,-0.031588307,-0.051588307,-0.151588307,-0.041588307,-0.021588307,0.008411693,0.008411693,0.008411693,0.008411693,0.048411693,0.068411693,0.058411693,0.028411693,0.018411693,0.028411693,0.018411693,0.008411693,-0.001588307,0.008411693,0.018411693,0.038411693,0.128411693,0.103755986,0.097154898,0.137154898,-0.005850538,0.095898103,0.125898103,0.082794298,0.084641309,-0.055063584,-0.006615486,-0.074670107,-0.017872281,-0.080976087,-0.149129076,-0.079129076,-0.173883153,-0.220385871,-0.130385871,-0.205139948,-0.261642666,-0.071642666,0.168357334,0.228357334,0.168357334,0.308357334,0.138357334,-0.101642666,-0.041642666,0.208357334,0.308357334,0.278357334,0.298652441,0.057100539,0.077100539,0.510401082,-0.888440492,-0.817872281) > 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.042204599 2 0.122529339 3 0.120766252 4 0.090794326 5 0.104969280 6 -0.021406496 7 -0.024650532 8 -0.015200563 9 -0.029375517 10 -0.024650532 11 -0.034100501 12 -0.029375517 13 -0.029375517 14 0.013149346 15 0.022599315 16 0.069849162 17 0.017874330 18 0.008424361 19 -0.005750593 20 -0.005750593 21 -0.005750593 22 -0.005750593 23 -0.024650532 24 -0.034100501 25 -0.029375517 26 -0.015200563 27 -0.010475578 28 -0.015200563 29 -0.010475578 30 -0.005750593 31 -0.001025608 32 -0.005750593 33 -0.010475578 34 -0.019925547 35 -0.062450410 36 -0.040517984 37 -0.035440381 38 -0.054340320 39 0.023022522 40 -0.022605307 41 -0.036780261 42 -0.009558684 43 -0.005045248 44 0.069778793 45 0.050314688 46 0.090794436 47 0.067874747 48 0.104546293 49 0.142134623 50 0.109059729 51 0.161175630 52 0.188044590 53 0.145519728 54 0.188185659 55 0.219779603 56 0.130004893 57 0.016605260 58 -0.011744648 59 0.016605260 60 -0.049544526 61 0.030780214 62 0.144179847 63 0.115829939 64 -0.002294679 65 -0.049544526 66 -0.035369572 67 -0.036145286 68 0.081415167 69 0.071965197 70 -0.873747947 71 -0.487976579 72 -0.554126475 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/17uys1257411419.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/2rghq1257411419.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/3zkp11257411419.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/4o3v41257411419.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/50e231257411419.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/6zfmf1257411419.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/7w7j41257411419.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/8lr2n1257411419.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. -8.884e-01 -5.921e-02 1.841e-02 -9.722e-11 7.852e-02 5.104e-01 > > #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/9y2gv1257411419.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/10wp7y1257411419.tab") > > system("convert tmp/17uys1257411419.ps tmp/17uys1257411419.png") > system("convert tmp/2rghq1257411419.ps tmp/2rghq1257411419.png") > system("convert tmp/3zkp11257411419.ps tmp/3zkp11257411419.png") > system("convert tmp/4o3v41257411419.ps tmp/4o3v41257411419.png") > system("convert tmp/50e231257411419.ps tmp/50e231257411419.png") > system("convert tmp/6zfmf1257411419.ps tmp/6zfmf1257411419.png") > system("convert tmp/7w7j41257411419.ps tmp/7w7j41257411419.png") > system("convert tmp/8lr2n1257411419.ps tmp/8lr2n1257411419.png") > > > proc.time() user system elapsed 1.586 1.166 2.016