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.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/1bwg61228943477.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/2eak81228943477.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.059207384 0.064003628 0.134742936 0.136493673 [6] 0.112210428 0.103247419 0.052060606 0.069506771 0.065095895 [11] -0.035494691 0.027552993 -0.250590851 0.015239409 0.114428016 [16] -0.010685811 -0.062055514 -0.003728593 0.018260786 0.001650086 [21] 0.058971243 0.065587441 0.049402517 0.182091229 -0.039390874 [26] -0.038908271 -0.028190348 0.061612757 0.023416886 0.113337316 [31] -0.069541460 -0.032007450 0.026319112 -0.095158315 -0.072476062 [36] -0.099693674 -0.038606160 0.014302332 0.023672533 -0.223578839 [41] -0.092163924 -0.035859460 -0.042747240 0.041405607 -0.118944738 [46] -0.068833034 -0.013070610 -0.066471721 -0.064377762 -0.078067634 [51] -0.022488167 0.051824554 0.017916931 -0.185328723 -0.014887691 [56] -0.073183626 -0.033902890 -0.025040014 -0.022734231 -0.043211390 [61] -0.036832602 > (mypacf <- c(rpacf$acf)) [1] 5.920738e-02 6.071094e-02 1.285115e-01 1.218879e-01 8.983718e-02 [6] 7.027830e-02 7.246201e-03 2.224638e-02 1.704759e-02 -8.132460e-02 [11] -7.231153e-03 -2.970396e-01 1.385334e-02 1.376964e-01 5.279725e-02 [16] -1.871495e-05 1.922970e-02 4.650335e-02 8.143931e-03 7.417979e-02 [21] 8.856961e-02 -1.498802e-02 1.724521e-01 -1.792575e-01 -1.002078e-01 [26] -4.917605e-02 2.455577e-02 -2.713280e-02 1.285932e-01 -4.630736e-02 [31] -4.475869e-02 5.103193e-02 -3.348905e-02 -1.036389e-01 -7.927424e-03 [36] -1.065240e-01 -2.042732e-02 9.001943e-02 -1.351598e-01 -1.007433e-01 [41] 7.007590e-02 -3.308428e-02 5.529269e-02 -3.793465e-02 -4.583999e-02 [46] -7.957266e-02 1.724700e-02 -2.658332e-02 -9.955563e-02 5.726683e-02 [51] 2.141886e-03 -5.079817e-02 -3.747483e-02 3.612446e-02 -5.609899e-02 [56] 7.871179e-03 2.165403e-02 -3.825965e-02 -1.129487e-03 1.570128e-03 > 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/3bnit1228943477.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/4htuj1228943477.tab") > > system("convert tmp/1bwg61228943477.ps tmp/1bwg61228943477.png") > system("convert tmp/2eak81228943477.ps tmp/2eak81228943477.png") > > > proc.time() user system elapsed 0.613 0.327 1.557