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(2150.3,2425.7,2642.0,2291.5,2570.7,2526.6,2266.2,1981.9,2630.3,2942.6,2713.4,2437.5,2678.9,2582.0,2780.0,2512.4,2658.4,2708.7,2518.7,2018.3,2579.3,2693.5,2468.8,2122.8,2412.8,2370.6,2642.5,2634.2,2457.5,2579.1,2505.9,1903.2,2660.2,2844.1,2607.1,2356.0,2659.9,2531.4,2845.7,2654.3,2588.2,2789.6,2533.1,1846.5,2796.3,2895.6,2472.2,2584.4,2630.4,2663.1,3176.2,2856.7,2551.4,3088.7,2628.3,2226.2,3023.6,3077.9,3084.1,2990.3,2949.6,3014.7,3517.7,3121.2,3067.4,3174.6,2676.3,2424.0,3195.1,3146.6,3506.7,3528.5) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-0.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/1wugr1228500544.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/2nihm1228500544.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.5098280073 0.4427755858 0.5156266872 0.2767850423 [6] 0.2365572314 0.2675204125 0.0677878763 0.0830293757 0.0555718476 [11] -0.1410310485 -0.1220911962 -0.1443776065 -0.1505507553 -0.0617264291 [16] -0.0105660265 -0.1350234510 0.0429049959 0.0107313225 -0.0584641863 [21] 0.1529049367 0.0783093494 0.0690627362 0.1845779684 0.0376825421 [26] -0.0541765941 0.0017989527 -0.1429185743 -0.1275165028 -0.1056480258 [31] -0.2155623500 -0.2161106399 -0.1957508867 -0.2578006794 -0.2791982452 [36] -0.1916124924 -0.2516278335 -0.1618615785 -0.1432254604 -0.1967912045 [41] -0.1408498375 -0.0800277876 -0.1106467567 0.0272145274 -0.0021625986 [46] -0.0286425765 0.0544654981 -0.0193102005 -0.0482813433 -0.0009346949 [51] -0.0208977996 -0.0081643879 0.0728125209 0.0145823071 -0.0100969397 [56] 0.0267380090 0.0173183386 -0.0072156685 0.0411681385 0.0531081485 > (mypacf <- c(rpacf$acf)) [1] 0.509828007 0.247070755 0.316157506 -0.156234654 -0.029782934 [6] 0.051135317 -0.143959442 0.014564852 -0.055794092 -0.180594767 [11] -0.060950036 -0.043384964 0.137854919 0.118673146 0.139918168 [16] -0.180440881 0.143561694 -0.045850841 -0.032126233 0.174033381 [21] -0.101782852 0.031535719 -0.049605600 -0.098564340 -0.116749752 [26] -0.100033030 -0.046265131 -0.017265010 0.015324203 -0.050594038 [31] -0.008209421 -0.006281825 0.050686469 -0.094310788 -0.012116439 [36] -0.054049357 -0.037711890 -0.059087910 -0.039480068 -0.072850733 [41] 0.039653084 0.015895107 0.108869094 -0.048727094 -0.002916093 [46] -0.039162954 -0.003738711 -0.027539999 0.002200898 -0.014484786 [51] 0.051586707 0.073847767 0.031934530 -0.027883262 -0.028602339 [56] 0.013834909 -0.035647605 -0.032499128 0.068518942 > 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/3by0g1228500544.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/4os9s1228500544.tab") > > system("convert tmp/1wugr1228500544.ps tmp/1wugr1228500544.png") > system("convert tmp/2nihm1228500544.ps tmp/2nihm1228500544.png") > > > proc.time() user system elapsed 0.568 0.309 1.332