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(451,450,444,429,421,400,389,384,432,446,431,423,416,416,413,399,386,374,365,365,418,428,424,421,417,423,423,419,406,398,390,391,444,460,455,456,452,459,461,451,443,439,430,436,488,506,502,501,501,515,521,520,512,509,505,511,570,592,594,586,586,592,594,586,572,563,555,554,601,622,617,606,595,599,600,592,575,567,555,555,608,631,629,624,610,616,621,604,584,574,555,545,599,620,608,590,579,580,579,572,560,551,537,541,588,607,599,578,563,566,561,554,540,526,512,505,554,584,569,540,522,526,527,516,503,489,479,475,524,552,532,511,492,492,493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502) > par5 = '12' > par4 = '1' > par3 = '1' > 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/1verc1229254322.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/2gf0n1229254322.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.0563490904 0.0620837973 0.1358883592 0.1362993750 [6] 0.1162047297 0.1054800017 0.0511559121 0.0709648086 0.0661155925 [11] -0.0360417037 0.0304788236 -0.2488433001 0.0157132970 0.1162977224 [16] -0.0081379591 -0.0600933579 -0.0044699119 0.0186678436 0.0007859998 [21] 0.0585546492 0.0637830605 0.0465675403 0.1831196456 -0.0392918193 [26] -0.0409156428 -0.0256785817 0.0622539723 0.0240209773 0.1140697641 [31] -0.0702881383 -0.0313724466 0.0267604046 -0.0954238481 -0.0717301332 [36] -0.0985969992 -0.0401371943 0.0142584505 0.0254561834 -0.2238993117 [41] -0.0921163177 -0.0358955257 -0.0455304076 0.0403493730 -0.1198746466 [46] -0.0714800531 -0.0130202481 -0.0659827199 -0.0660711020 -0.0779022307 [51] -0.0223532805 0.0517340896 0.0179722226 -0.1865850802 -0.0155276202 [56] -0.0733737060 -0.0324438684 -0.0232188949 -0.0221415555 -0.0459803049 [61] -0.0356765218 > (mypacf <- c(rpacf$acf)) [1] 0.056349090 0.059096221 0.130132945 0.122441002 0.094959401 [6] 0.073086824 0.006367506 0.022679420 0.016493708 -0.083130708 [11] -0.005995475 -0.296946153 0.011576631 0.137345115 0.057417986 [16] 0.003541820 0.020143866 0.047277363 0.004263733 0.071523488 [21] 0.086299806 -0.018553086 0.175199008 -0.176707774 -0.102120942 [26] -0.047713274 0.026555355 -0.025413333 0.128479734 -0.045155884 [31] -0.045091985 0.048065638 -0.034892438 -0.108212417 -0.008122470 [36] -0.107012852 -0.023169476 0.094245086 -0.130399213 -0.097628481 [41] 0.070304620 -0.035457091 0.052587964 -0.039799286 -0.047389289 [46] -0.082178729 0.018185448 -0.027039031 -0.101090436 0.063359351 [51] 0.007180159 -0.049791430 -0.037474088 0.033927194 -0.059758719 [56] 0.008916805 0.023310455 -0.040364557 -0.003444990 0.004725984 > 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/3qafc1229254322.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/4krbh1229254322.tab") > > system("convert tmp/1verc1229254322.ps tmp/1verc1229254322.png") > system("convert tmp/2gf0n1229254322.ps tmp/2gf0n1229254322.png") > > > proc.time() user system elapsed 0.588 0.315 0.701