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(4.820281566,4.776009406,4.802872845,4.787241712,4.828553709,4.868226519,4.841427376,4.801559,4.781138269,4.809171692,4.759263721,4.737250526,4.728360797,4.723930522,4.730921391,4.746496122,4.795873187,4.782814153,4.759435145,4.762772046,4.765672083,4.783985603,4.79512917,4.76294287,4.760206188,4.782395445,4.808029394,4.820926519,4.773139237,4.726856704,4.734354644,4.739963282,4.776599302,4.790487252,4.772970146,4.773561837,4.769158036,4.767714115,4.772208886,4.795955821,4.826552187,4.876417952,4.868610794,4.880906187,4.903272776,4.907864016,4.943925529,4.915225109,4.879767019,4.85903691,4.897018567,4.92906364,4.985180725,4.975077199,5.005957705,5.054971108,5.06940722,5.106672482,5.094608728,5.033244437,5.01734606) > x <- c(4.652912182,4.655387902,4.656243456,4.65937424,4.659847747,4.665041583,4.665983025,4.667299557,4.67226793,4.674323045,4.675815026,4.675815026,4.676094524,4.677955856,4.680926798,4.685551298,4.68564357,4.681390212,4.682408966,4.683426684,4.684905154,4.688039664,4.688223741,4.691714787,4.691623074,4.691623074,4.696289779,4.698205052,4.698933716,4.697293475,4.698842662,4.700025717,4.70157068,4.701843073,4.702387637,4.700389453,4.701752284,4.701752284,4.707817023,4.709259895,4.709440107,4.698022803,4.6987516,4.700662167,4.702115392,4.702387637,4.702750514,4.703747749,4.705106015,4.705920089,4.709079649,4.71115051,4.71124045,4.715727177,4.715816706,4.716979861,4.716443188,4.716085247,4.718588153,4.717248089,4.71885595) > 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.114007260 2 0.061602727 3 0.085655797 4 0.059740502 5 0.099497099 6 0.122108927 7 0.092217286 8 0.048024297 9 0.011283196 10 0.032565871 11 -0.022243037 12 -0.044256232 13 -0.054064071 14 -0.064608546 15 -0.067376781 16 -0.066992848 17 -0.017918883 18 -0.017006266 19 -0.043731730 20 -0.043737882 21 -0.045694400 22 -0.037677281 23 -0.027138380 24 -0.070792249 25 -0.073227668 26 -0.051038411 27 -0.040733897 28 -0.034128160 29 -0.084308996 30 -0.125203580 31 -0.122794490 32 -0.121072012 33 -0.089510967 34 -0.076517788 35 -0.095823706 36 -0.088668276 37 -0.097548775 38 -0.098992696 39 -0.114419695 40 -0.095412381 41 -0.065407985 42 0.021961934 43 0.011760786 44 0.017780249 45 0.035373209 46 0.039070164 47 0.073939680 48 0.041963491 49 0.002043698 50 -0.021360524 51 0.006242446 52 0.031485047 53 0.087306693 54 0.062464933 55 0.093051349 56 0.138243960 57 0.154442964 58 0.192884009 59 0.172598579 60 0.115636200 61 0.094456238 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/1grp01256813615.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/2s2f01256813615.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/3s2qw1256813615.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/4iaw91256813615.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/5fzhd1256813615.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/6dhg31256813615.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/7asyn1256813615.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/82ql71256813615.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. 4.653 4.681 4.699 4.693 4.705 4.719 > > #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/9u59x1256813615.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/10e7km1256813615.tab") > > system("convert tmp/1grp01256813615.ps tmp/1grp01256813615.png") > system("convert tmp/2s2f01256813615.ps tmp/2s2f01256813615.png") > system("convert tmp/3s2qw1256813615.ps tmp/3s2qw1256813615.png") > system("convert tmp/4iaw91256813615.ps tmp/4iaw91256813615.png") > system("convert tmp/5fzhd1256813615.ps tmp/5fzhd1256813615.png") > system("convert tmp/6dhg31256813615.ps tmp/6dhg31256813615.png") > system("convert tmp/7asyn1256813615.ps tmp/7asyn1256813615.png") > system("convert tmp/82ql71256813615.ps tmp/82ql71256813615.png") > > > proc.time() user system elapsed 1.547 1.122 3.650