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.665330703,0.238621255,0.365170272,0.127492318,0.078845858,0.123522036,-0.025284855,-0.091898044,0.077101364,1.51510018,1.837358053,1.264067501,0.921777542,0.51510018,0.610648605,0.017325967,0.117486398,-0.091416751,0.122098404,0.10890411,0.104452536,1.184580881,1.213516116,0.746742495,9.61045E-07,-0.342128568,-0.410967545,-0.499838608,-0.672968729,-0.970742941,-1.063905148,-1.292840384,-1.195066171,0.10509426,0.076159024,-0.701583102,-0.876939011,-0.854360275,-0.587586654,-0.689652011,-0.616040597,-0.537977609,-0.582332925,-0.661979977,-0.323981161,0.807340293,0.653760966,0.293825138,0.049309391,-0.199818362,0.146762742,0.471246402,0.655826322,0.613375931,0.56456904,0.446762742,0.700021207,1.684440696,1.860117466,1.295569632) > x <- c(0.585202358,0.182976571,0.338460824,0.120814956,0.038781686,0.06119999,-0.145477372,-0.203187412,-0.06312324,1.328134042,1.632585617,1.008101956,0.670263571,0.339262979,0.457069277,-0.129575998,-0.020512418,-0.238318717,-0.055964585,-0.078062027,-0.082513602,0.988711593,1.017646829,0.613195254,-0.095707895,-0.437837424,-0.51557955,-0.562160654,-0.741968137,-1.093161246,-1.215258689,-1.468677585,-1.382032309,-0.08854924,-0.095226602,-0.886323453,-1.07948566,-1.114777396,-0.801262241,-0.910004959,-0.818587247,-0.782814218,-0.844975833,-0.986944931,-0.693461862,0.44008538,0.364408609,0.024504868,-0.144334109,-0.288849856,0.144536954,0.491278489,0.658052109,0.606698569,0.528956443,0.382214908,0.57982869,1.575377115,1.715441288,1.170925541) > par2 = '1' > 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.057355280 2 -0.091474108 3 -0.116684777 4 -0.141930487 5 -0.110508753 6 -0.087713857 7 -0.034794264 8 -0.045079836 9 -0.012789415 10 0.067279160 11 0.092378480 12 0.128612320 13 0.116067955 14 0.032462191 15 0.013026323 16 -0.007703905 17 -0.013994477 18 -0.010308795 19 0.025220453 20 0.033594265 21 0.033487630 22 0.068051574 23 0.068744705 24 -0.003265825 25 -0.058085716 26 -0.066281300 27 -0.059240434 28 -0.102646226 29 -0.100276084 30 -0.055269885 31 -0.029259447 32 -0.010846340 33 0.002358151 34 0.040020410 35 0.017602583 36 0.012006882 37 0.025186053 38 0.082211125 39 0.042979727 40 0.047052198 41 0.031435776 42 0.074582665 43 0.090899906 44 0.149821136 45 0.201367159 46 0.226295066 47 0.146579701 48 0.118405349 49 0.038684105 50 -0.069389721 51 -0.145813810 52 -0.159765623 53 -0.137964324 54 -0.130291330 55 -0.103218378 56 -0.077798279 57 -0.017419832 58 -0.004700783 59 0.034266998 60 0.001191243 > library(lattice) > postscript(file="/var/www/html/rcomp/tmp/15sy71257513990.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/2yjrd1257513990.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/3w1tz1257513990.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/400sr1257513990.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/57u6s1257513990.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/6b2tl1257513990.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/7lv351257513990.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/875et1257513990.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.469e+00 -5.950e-01 -5.954e-02 -1.667e-11 5.007e-01 1.715e+00 > > #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/9td0x1257513990.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/10me451257513990.tab") > > system("convert tmp/15sy71257513990.ps tmp/15sy71257513990.png") > system("convert tmp/2yjrd1257513990.ps tmp/2yjrd1257513990.png") > system("convert tmp/3w1tz1257513990.ps tmp/3w1tz1257513990.png") > system("convert tmp/400sr1257513990.ps tmp/400sr1257513990.png") > system("convert tmp/57u6s1257513990.ps tmp/57u6s1257513990.png") > system("convert tmp/6b2tl1257513990.ps tmp/6b2tl1257513990.png") > system("convert tmp/7lv351257513990.ps tmp/7lv351257513990.png") > system("convert tmp/875et1257513990.ps tmp/875et1257513990.png") > > > proc.time() user system elapsed 1.613 1.157 2.523