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. > x <- c(464,675,703,887,1139,1077,1318,1260,1120,963,996,960,530,883,894,1045,1199,1287,1565,1577,1076,918,1008,1063,544,635,804,980,1018,1064,1404,1286,1104,999,996,1015,615,722,832,977,1270,1437,1520,1708,1151,934,1159,1209,699,830,996,1124,1458,1270,1753,2258,1208,1241,1265,1828,809,997,1164,1205,1538,1513,1378,2083,1357,1536,1526,1376,779,1005,1193,1522,1539,1546,2116,2326,1596,1356,1553,1613,814,1150,1225,1691,1759,1754,2100,2062,2012,1897,1964,2186,966,1549,1538,1612,2078,2137,2907,2249,1883,1739,1828,1868,1138,1430,1809,1763,2200,2067,2503,2141,2103,1972,2181,2344,970,1199,1718,1683,2025,2051,2439,2353,2230,1852,2147,2286,1007,1665,1642,1518,1831,2207,2822,2393,2306,1785,2047,2171,1212,1335,2011,1860,1954,2152,2835,2224,2182,1992,2389,2724,891,1247,2017,2257,2255,2255,3057,3330,1896,2096,2374,2535,1041,1728,2201,2455,2204,2660,3670,2665,2639,2226,2586,2684,1185,1749,2459,2618,2585,3310,3923) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1cb8n1272913165.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2cb8n1272913165.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.00000000 0.70565938 0.53662046 0.50642193 0.45195117 0.31377963 [7] 0.19054601 0.35065752 0.46315074 0.48275257 0.50149862 0.62247044 [13] 0.78146243 0.55807330 0.42171169 0.40531524 0.35121435 0.21128525 [19] 0.10962621 0.26842970 0.34759625 0.37627067 0.40101768 0.52682873 [25] 0.64244280 0.44659312 0.32123701 0.29124728 0.23510933 0.11676114 [31] 0.04994966 0.17577932 0.23794466 0.27113292 0.28779403 0.38531027 [37] 0.51102952 0.33730281 0.22914980 0.19096633 0.14688575 0.03836289 [43] -0.03071002 0.08733357 0.14087685 0.18385854 0.21221727 0.28625228 [49] 0.38460669 0.23495338 0.12816736 0.10343947 0.06840440 -0.03037861 [55] -0.10099645 0.01514291 0.04960931 0.08836924 0.11967231 0.19699867 [61] 0.29103013 > (mypacf <- c(rpacf$acf)) [1] 0.705659380 0.077015631 0.205518440 0.032645212 -0.135586389 [6] -0.110940964 0.441646245 0.247494882 0.186284210 0.060765094 [11] 0.203169387 0.435068334 -0.286508110 -0.090692716 -0.066909691 [16] -0.056206001 -0.100449689 -0.121853837 -0.026966403 -0.077685190 [21] 0.097950449 -0.015644874 0.120908766 0.136063152 -0.020250212 [26] -0.050591814 -0.060806802 -0.019668968 0.044200153 0.006837862 [31] -0.167462687 -0.086187505 -0.004046794 -0.051105800 -0.029145893 [36] 0.223740805 -0.050889955 0.023602229 -0.023409211 0.036732109 [41] 0.059543228 -0.011218646 -0.037957514 -0.104163670 0.012769058 [46] 0.009518809 -0.048616526 -0.040083795 -0.037474911 -0.022157224 [51] 0.085942781 0.023232102 0.007169341 -0.018045343 0.005743376 [56] -0.067728772 0.019752008 0.042841832 -0.018594235 0.019435508 > 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/3xc6t1272913165.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/4iu4y1272913165.tab") > > try(system("convert tmp/1cb8n1272913165.ps tmp/1cb8n1272913165.png",intern=TRUE)) character(0) > try(system("convert tmp/2cb8n1272913165.ps tmp/2cb8n1272913165.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.615 0.324 0.742