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(1375.06,1334.38,1335.61,1307.24,1183.2,1187.79,1270.81,1238.67,1204.45,1178.5,1044.64,1076.59,1129.68,1144.93,1140.21,1100.29,1153.79,1114.2,1079.27,1014.05,903.69,912.55,867.81,854.54,911.17,899.26,895.87,837.61,846.62,890.19,935.96,988,992.55,989.53,1019.44,1038.73,1049.9,1080.64,1132.52,1143.37,1123.98,1133.07,1102.78,1132.76,1105.85,1088.93,1117.66,1118.07,1168.94,1199.21,1181.4,1199.63,1194.9,1164.42,1178.28,1202.25,1222.24,1224.27,1225.91,1191.96,1237.37,1262.07,1278.72,1276.65,1293.83,1302.18,1290,1253.12,1260.24,1287.15,1317.81,1363.38,1388.63,1416.42,1424.16,1444.65,1406.95,1463.65,1511.14,1514.49,1520.98,1454.62,1497.12,1539.66,1463.39,1479.23,1378.76,1354.87,1316.94,1370.47,1403.22,1341.25,1257.33,1281.47,1216.93,969.13,883.04) > 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/1rihw1229013353.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/2uynn1229013353.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.000000000 0.939430867 0.872757970 0.832147691 0.791561308 [6] 0.755224791 0.718023754 0.680642292 0.635185339 0.579190364 [11] 0.524330684 0.470961204 0.423866925 0.373104972 0.331861655 [16] 0.287787228 0.241438729 0.200796549 0.161276911 0.124059184 [21] 0.083935285 0.050100553 0.028701508 0.008293288 -0.011315187 [26] -0.031924889 -0.054315026 -0.075006422 -0.092564008 -0.109708908 [31] -0.128031421 -0.141147588 -0.153093230 -0.168625810 -0.181944188 [36] -0.194822308 -0.206340082 -0.220674624 -0.241241213 -0.254947184 [41] -0.268674210 -0.281614533 -0.296711310 -0.316123718 -0.337821640 [46] -0.353303546 -0.363993761 -0.374540440 -0.377368435 -0.384833248 [51] -0.400285526 -0.409836608 -0.419514766 -0.422150992 -0.416714773 [56] -0.413761210 -0.405229309 -0.393548854 -0.370606556 -0.342483121 [61] -0.319294233 > (mypacf <- c(rpacf$acf)) [1] 0.939430867 -0.083190719 0.190268796 -0.049364601 0.064980079 [6] -0.044108835 0.007019308 -0.105218545 -0.100550438 -0.049407833 [11] -0.056871148 0.013632224 -0.086720053 0.084061283 -0.094461282 [16] 0.023325523 -0.013706006 -0.002306771 -0.013311733 -0.060544427 [21] 0.038721944 0.038275614 0.017290180 -0.005354700 -0.011656275 [26] -0.048185481 0.001196657 -0.017516265 -0.041412218 -0.039924294 [31] 0.003726239 -0.015927658 -0.042178604 0.007078521 -0.026788954 [36] -0.007636825 -0.053972347 -0.067159057 0.020088736 -0.056877857 [41] 0.007854238 -0.067294283 -0.041226441 -0.065679938 0.035042563 [46] -0.025678143 -0.009621855 0.050614538 -0.080638292 -0.041322003 [51] -0.016331047 -0.023557153 0.009755502 0.028142126 -0.041960175 [56] 0.051400040 0.008145486 0.120561580 0.026165804 -0.014770989 > 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/3tja11229013353.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/4dsuh1229013353.tab") > > system("convert tmp/1rihw1229013353.ps tmp/1rihw1229013353.png") > system("convert tmp/2uynn1229013353.ps tmp/2uynn1229013353.png") > > > proc.time() user system elapsed 0.596 0.328 0.821