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(2400,4700,3700,2900,2800,3000,3100,3700,3000,2000,1900,1900,1800,3400,3800,2800,3100,2100,2000,2500,2400,2500,3300,3100,3700,5600,3700,2900,4000,2900,2400,3300,3800,4400,4000,3100,2700,5200,4600,3700,3200,2400,2200,3200,3100,2300,2500,2900,2700,5000,3500,3000,3800,2800,2400,2700,2800,2700,2600,3100) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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/1ucx21229439105.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/23he91229439105.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.3964386665 0.0523223458 0.0753984228 -0.1192804743 [6] -0.0534419991 0.1254561652 -0.1015749937 -0.1330737673 0.0695317913 [11] -0.0039539820 0.0856083853 0.3350183126 -0.0059964145 -0.1397322951 [16] -0.0640446102 -0.2633593999 -0.2158170280 -0.0360444782 -0.1509728226 [21] -0.2347862430 -0.1259379021 -0.1919666524 -0.0246664687 0.2444418781 [26] -0.0095137537 -0.0571474137 0.0167255090 -0.1796031720 -0.1634066937 [31] 0.0186755535 0.0067432166 -0.0171500533 0.0005807239 -0.0371542328 [36] 0.0770559057 0.2351337975 0.0588004971 -0.0042916378 -0.0418616161 [41] -0.1114374017 -0.0390987781 0.0659715577 0.0175789972 -0.0041695538 [46] 0.0355693404 0.0308300613 0.0396355077 0.1054574851 -0.0076725949 [51] 0.0029476139 0.0249843271 -0.0290339965 -0.0221752950 -0.0019863398 [56] -0.0081939266 -0.0180805315 -0.0130530900 0.0085381815 0.0002353692 > (mypacf <- c(rpacf$acf)) [1] 0.396438667 -0.124391012 0.122185632 -0.236254965 0.133748487 [6] 0.087566761 -0.222614645 0.005226361 0.117381457 -0.033927228 [11] 0.121796723 0.232153681 -0.270049748 -0.002177929 -0.101122449 [16] -0.151969943 -0.058625919 -0.049276882 -0.007943296 -0.228512175 [21] -0.094888720 -0.100192928 0.104231062 0.060243717 -0.110785193 [26] 0.118499569 -0.060626262 -0.076018227 -0.120825174 0.059555253 [31] 0.125566597 -0.053846111 -0.133859409 0.084334912 -0.005954942 [36] -0.094021275 -0.046497004 -0.037600463 -0.113585163 0.043187288 [41] -0.066841254 -0.040232768 -0.075598075 0.031680278 0.038556265 [46] -0.006785521 -0.095781253 0.057098065 -0.052773721 -0.039980060 [51] 0.055290447 0.088469114 -0.038678308 -0.130120455 -0.009871583 [56] 0.011165741 -0.067435026 -0.045366949 -0.044040153 > 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/3b0ac1229439105.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/411a91229439105.tab") > > system("convert tmp/1ucx21229439105.ps tmp/1ucx21229439105.png") > system("convert tmp/23he91229439105.ps tmp/23he91229439105.png") > > > proc.time() user system elapsed 0.600 0.320 0.689