R version 2.8.0 (2008-10-20) Copyright (C) 2008 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. > x <- c(44.9,48.1,52.3,48.9,52.6,60.3,50.5,41.6,56,51.4,52.9,54.9,43.9,51,51.9,54.3,50.3,57.2,48.8,41.1,58,63,53.8,54.7,55.5,56.1,69.6,69.4,57.2,68,53.3,47.9,60.8,61.7,57.8,51.4,50.5,48.1,58.7,54,56.1,60.4,51.2,50.7,56.4,53.3,52.6,47.7,49.5,48.5,55.3,49.8,57.4,64.6,53,41.5,55.9,58.4,53.5,50.6,58.5) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-1.3' > par1 = '60' > #'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: Write here your technical program description (don't use hard returns!) > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/rcomp/tmp/1ff6w1229076569.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2ast31229076569.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 -0.3987897849 -0.1030644303 0.1622306961 -0.0850860857 [6] 0.0457655786 0.0089554144 -0.0201584796 -0.0721177654 0.0600515759 [11] 0.0002340326 0.0445920635 -0.1169098094 -0.0124024810 0.1687150983 [16] -0.3148205274 0.2238244883 -0.0222618308 -0.0783234543 0.1647516954 [21] -0.0704869135 -0.1123515077 0.1236806942 0.0886010094 -0.2765066476 [26] 0.1125098203 -0.0596553394 -0.0012747895 0.0856862401 -0.0993913521 [31] 0.0929906416 -0.1612068243 0.0428778900 0.1505271662 -0.1519318652 [36] 0.0062542960 0.0753429168 -0.0197680825 -0.0228900981 0.1121712855 [41] -0.1054945792 0.0582580695 -0.0359250483 -0.0036378984 0.0058076304 [46] 0.0016394824 -0.0058209842 0.0148087934 > (mypacf <- c(rpacf$acf)) [1] -0.398789785 -0.311662424 -0.021030151 -0.053765703 0.038614754 [6] 0.029452666 0.024004831 -0.101105492 -0.030861355 -0.016582004 [11] 0.090342533 -0.081178693 -0.103767416 0.090619914 -0.260535013 [16] 0.022077866 -0.020153619 0.029975823 0.143011879 0.065317409 [21] -0.116323039 0.005139323 0.118310788 -0.200069324 -0.105040715 [26] -0.162862602 -0.119826484 -0.020923949 0.009296696 0.031042774 [31] -0.065007780 -0.112137724 0.041330619 0.018290127 -0.009017954 [36] -0.061559556 -0.008061016 -0.020594153 -0.061160029 0.010355144 [41] 0.022822713 -0.069576136 0.067994995 -0.061986811 0.022216682 [46] -0.057687088 0.009722906 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3u4z01229076569.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/4hlgf1229076569.tab") > > system("convert tmp/1ff6w1229076569.ps tmp/1ff6w1229076569.png") > system("convert tmp/2ast31229076569.ps tmp/2ast31229076569.png") > > > proc.time() user system elapsed 0.586 0.307 0.744