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 <- array(list(3,101.2,3.21,101.1,3.37,100.7,3.51,100.1,3.75,99.9,4.11,99.7,4.25,99.5,4.25,99.2,4.5,99,4.7,99,4.75,99.3,4.75,99.5,4.75,99.7,4.75,100,4.75,100.4,4.75,100.6,4.58,100.7,4.5,100.7,4.5,100.6,4.49,100.5,4.03,100.6,3.75,100.5,3.39,100.4,3.25,100.3,3.25,100.4,3.25,100.4,3.25,100.4,3.25,100.4,3.25,100.4,3.25,100.5,3.25,100.6,3.25,100.6,3.25,100.5,3.25,100.5,3.25,100.7,2.85,101.1,2.75,101.5,2.75,101.9,2.55,102.1,2.5,102.1,2.5,102.1,2.1,102.4,2,102.8,2,103.1,2,103.1,2,102.9,2,102.4,2,101.9,2,101.3,2,100.7,2,100.6,2,101,2,101.5,2,101.9,2,102.1,2,102.3,2,102.5,2,102.9,2,103.6,2,104.3),dim=c(2,60),dimnames=list(c('Rente','Tprod'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Rente','Tprod'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > #'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!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Tprod Rente t 1 101.2 3.00 1 2 101.1 3.21 2 3 100.7 3.37 3 4 100.1 3.51 4 5 99.9 3.75 5 6 99.7 4.11 6 7 99.5 4.25 7 8 99.2 4.25 8 9 99.0 4.50 9 10 99.0 4.70 10 11 99.3 4.75 11 12 99.5 4.75 12 13 99.7 4.75 13 14 100.0 4.75 14 15 100.4 4.75 15 16 100.6 4.75 16 17 100.7 4.58 17 18 100.7 4.50 18 19 100.6 4.50 19 20 100.5 4.49 20 21 100.6 4.03 21 22 100.5 3.75 22 23 100.4 3.39 23 24 100.3 3.25 24 25 100.4 3.25 25 26 100.4 3.25 26 27 100.4 3.25 27 28 100.4 3.25 28 29 100.4 3.25 29 30 100.5 3.25 30 31 100.6 3.25 31 32 100.6 3.25 32 33 100.5 3.25 33 34 100.5 3.25 34 35 100.7 3.25 35 36 101.1 2.85 36 37 101.5 2.75 37 38 101.9 2.75 38 39 102.1 2.55 39 40 102.1 2.50 40 41 102.1 2.50 41 42 102.4 2.10 42 43 102.8 2.00 43 44 103.1 2.00 44 45 103.1 2.00 45 46 102.9 2.00 46 47 102.4 2.00 47 48 101.9 2.00 48 49 101.3 2.00 49 50 100.7 2.00 50 51 100.6 2.00 51 52 101.0 2.00 52 53 101.5 2.00 53 54 101.9 2.00 54 55 102.1 2.00 55 56 102.3 2.00 56 57 102.5 2.00 57 58 102.9 2.00 58 59 103.6 2.00 59 60 104.3 2.00 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Rente t 102.22643 -0.60179 0.02354 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.6236 -0.4784 -0.1294 0.4936 1.8645 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 102.226427 0.828026 123.458 < 2e-16 *** Rente -0.601786 0.173837 -3.462 0.00102 ** t 0.023545 0.009938 2.369 0.02124 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.689 on 57 degrees of freedom Multiple R-squared: 0.6751, Adjusted R-squared: 0.6637 F-statistic: 59.22 on 2 and 57 DF, p-value: 1.216e-14 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 8.082504e-03 0.0161650077 0.991917496 [2,] 2.267216e-03 0.0045344327 0.997732784 [3,] 1.315694e-03 0.0026313877 0.998684306 [4,] 4.346518e-04 0.0008693035 0.999565348 [5,] 6.102924e-04 0.0012205847 0.999389708 [6,] 3.965728e-03 0.0079314563 0.996034272 [7,] 3.087458e-03 0.0061749160 0.996912542 [8,] 1.246677e-03 0.0024933537 0.998753323 [9,] 4.510435e-04 0.0009020871 0.999548956 [10,] 1.722732e-04 0.0003445465 0.999827727 [11,] 5.945918e-05 0.0001189184 0.999940541 [12,] 1.122622e-04 0.0002245244 0.999887738 [13,] 3.225030e-04 0.0006450060 0.999677497 [14,] 6.958128e-04 0.0013916257 0.999304187 [15,] 1.498937e-03 0.0029978731 0.998501063 [16,] 1.080225e-02 0.0216044963 0.989197752 [17,] 3.295226e-02 0.0659045199 0.967047740 [18,] 6.187255e-02 0.1237451091 0.938127445 [19,] 7.484718e-02 0.1496943530 0.925152823 [20,] 6.282097e-02 0.1256419326 0.937179034 [21,] 4.809018e-02 0.0961803681 0.951909816 [22,] 3.474499e-02 0.0694899805 0.965255010 [23,] 2.405191e-02 0.0481038231 0.975948088 [24,] 1.609853e-02 0.0321970624 0.983901469 [25,] 9.963049e-03 0.0199260974 0.990036951 [26,] 5.824796e-03 0.0116495921 0.994175204 [27,] 3.315835e-03 0.0066316698 0.996684165 [28,] 1.947306e-03 0.0038946113 0.998052694 [29,] 1.180640e-03 0.0023612809 0.998819360 [30,] 7.109704e-04 0.0014219409 0.999289030 [31,] 4.693414e-04 0.0009386828 0.999530659 [32,] 3.695090e-04 0.0007390179 0.999630491 [33,] 4.232391e-04 0.0008464781 0.999576761 [34,] 4.321529e-04 0.0008643058 0.999567847 [35,] 3.403626e-04 0.0006807252 0.999659637 [36,] 2.495634e-04 0.0004991268 0.999750437 [37,] 1.604999e-04 0.0003209998 0.999839500 [38,] 2.199695e-04 0.0004399390 0.999780030 [39,] 7.964569e-04 0.0015929139 0.999203543 [40,] 4.755242e-03 0.0095104838 0.995244758 [41,] 4.012573e-02 0.0802514513 0.959874274 [42,] 2.408743e-01 0.4817486745 0.759125663 [43,] 7.707595e-01 0.4584810818 0.229240541 [44,] 9.858237e-01 0.0283525636 0.014176282 [45,] 9.910857e-01 0.0178286337 0.008914317 [46,] 9.834951e-01 0.0330098617 0.016504931 [47,] 9.621266e-01 0.0757468285 0.037873414 [48,] 9.218431e-01 0.1563137305 0.078156865 [49,] 8.910413e-01 0.2179174518 0.108958726 > postscript(file="/var/www/html/rcomp/tmp/1eft91258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2o9t71258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3i2gw1258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4g2x71258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/59d901258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 60 Frequency = 1 1 2 3 4 5 6 0.75538515 0.75821559 0.43095674 -0.10833783 -0.18745383 -0.19435554 7 8 9 10 11 12 -0.33365010 -0.65719467 -0.73029280 -0.63348023 -0.32693551 -0.15048007 13 14 15 16 17 18 0.02597537 0.30243080 0.67888624 0.85534168 0.82949355 0.75780613 19 20 21 22 23 24 0.63426156 0.50469914 0.30433316 0.01228860 -0.32789882 -0.53569338 25 26 27 28 29 30 -0.45923794 -0.48278250 -0.50632707 -0.52987163 -0.55341619 -0.47696076 31 32 33 34 35 36 -0.40050532 -0.42404988 -0.54759445 -0.57113901 -0.39468357 -0.25894241 37 38 39 40 41 42 0.05733445 0.43378989 0.48988819 0.43625434 0.41270977 0.44845093 43 44 45 46 47 48 0.76472780 1.04118324 1.01763867 0.79409411 0.27054955 -0.25299502 49 50 51 52 53 54 -0.87653958 -1.50008414 -1.62362871 -1.24717327 -0.77071783 -0.39426240 55 56 57 58 59 60 -0.21780696 -0.04135152 0.13510391 0.51155935 1.18801479 1.86447022 > postscript(file="/var/www/html/rcomp/tmp/6bxys1258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 0.75538515 NA 1 0.75821559 0.75538515 2 0.43095674 0.75821559 3 -0.10833783 0.43095674 4 -0.18745383 -0.10833783 5 -0.19435554 -0.18745383 6 -0.33365010 -0.19435554 7 -0.65719467 -0.33365010 8 -0.73029280 -0.65719467 9 -0.63348023 -0.73029280 10 -0.32693551 -0.63348023 11 -0.15048007 -0.32693551 12 0.02597537 -0.15048007 13 0.30243080 0.02597537 14 0.67888624 0.30243080 15 0.85534168 0.67888624 16 0.82949355 0.85534168 17 0.75780613 0.82949355 18 0.63426156 0.75780613 19 0.50469914 0.63426156 20 0.30433316 0.50469914 21 0.01228860 0.30433316 22 -0.32789882 0.01228860 23 -0.53569338 -0.32789882 24 -0.45923794 -0.53569338 25 -0.48278250 -0.45923794 26 -0.50632707 -0.48278250 27 -0.52987163 -0.50632707 28 -0.55341619 -0.52987163 29 -0.47696076 -0.55341619 30 -0.40050532 -0.47696076 31 -0.42404988 -0.40050532 32 -0.54759445 -0.42404988 33 -0.57113901 -0.54759445 34 -0.39468357 -0.57113901 35 -0.25894241 -0.39468357 36 0.05733445 -0.25894241 37 0.43378989 0.05733445 38 0.48988819 0.43378989 39 0.43625434 0.48988819 40 0.41270977 0.43625434 41 0.44845093 0.41270977 42 0.76472780 0.44845093 43 1.04118324 0.76472780 44 1.01763867 1.04118324 45 0.79409411 1.01763867 46 0.27054955 0.79409411 47 -0.25299502 0.27054955 48 -0.87653958 -0.25299502 49 -1.50008414 -0.87653958 50 -1.62362871 -1.50008414 51 -1.24717327 -1.62362871 52 -0.77071783 -1.24717327 53 -0.39426240 -0.77071783 54 -0.21780696 -0.39426240 55 -0.04135152 -0.21780696 56 0.13510391 -0.04135152 57 0.51155935 0.13510391 58 1.18801479 0.51155935 59 1.86447022 1.18801479 60 NA 1.86447022 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.75821559 0.75538515 [2,] 0.43095674 0.75821559 [3,] -0.10833783 0.43095674 [4,] -0.18745383 -0.10833783 [5,] -0.19435554 -0.18745383 [6,] -0.33365010 -0.19435554 [7,] -0.65719467 -0.33365010 [8,] -0.73029280 -0.65719467 [9,] -0.63348023 -0.73029280 [10,] -0.32693551 -0.63348023 [11,] -0.15048007 -0.32693551 [12,] 0.02597537 -0.15048007 [13,] 0.30243080 0.02597537 [14,] 0.67888624 0.30243080 [15,] 0.85534168 0.67888624 [16,] 0.82949355 0.85534168 [17,] 0.75780613 0.82949355 [18,] 0.63426156 0.75780613 [19,] 0.50469914 0.63426156 [20,] 0.30433316 0.50469914 [21,] 0.01228860 0.30433316 [22,] -0.32789882 0.01228860 [23,] -0.53569338 -0.32789882 [24,] -0.45923794 -0.53569338 [25,] -0.48278250 -0.45923794 [26,] -0.50632707 -0.48278250 [27,] -0.52987163 -0.50632707 [28,] -0.55341619 -0.52987163 [29,] -0.47696076 -0.55341619 [30,] -0.40050532 -0.47696076 [31,] -0.42404988 -0.40050532 [32,] -0.54759445 -0.42404988 [33,] -0.57113901 -0.54759445 [34,] -0.39468357 -0.57113901 [35,] -0.25894241 -0.39468357 [36,] 0.05733445 -0.25894241 [37,] 0.43378989 0.05733445 [38,] 0.48988819 0.43378989 [39,] 0.43625434 0.48988819 [40,] 0.41270977 0.43625434 [41,] 0.44845093 0.41270977 [42,] 0.76472780 0.44845093 [43,] 1.04118324 0.76472780 [44,] 1.01763867 1.04118324 [45,] 0.79409411 1.01763867 [46,] 0.27054955 0.79409411 [47,] -0.25299502 0.27054955 [48,] -0.87653958 -0.25299502 [49,] -1.50008414 -0.87653958 [50,] -1.62362871 -1.50008414 [51,] -1.24717327 -1.62362871 [52,] -0.77071783 -1.24717327 [53,] -0.39426240 -0.77071783 [54,] -0.21780696 -0.39426240 [55,] -0.04135152 -0.21780696 [56,] 0.13510391 -0.04135152 [57,] 0.51155935 0.13510391 [58,] 1.18801479 0.51155935 [59,] 1.86447022 1.18801479 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.75821559 0.75538515 2 0.43095674 0.75821559 3 -0.10833783 0.43095674 4 -0.18745383 -0.10833783 5 -0.19435554 -0.18745383 6 -0.33365010 -0.19435554 7 -0.65719467 -0.33365010 8 -0.73029280 -0.65719467 9 -0.63348023 -0.73029280 10 -0.32693551 -0.63348023 11 -0.15048007 -0.32693551 12 0.02597537 -0.15048007 13 0.30243080 0.02597537 14 0.67888624 0.30243080 15 0.85534168 0.67888624 16 0.82949355 0.85534168 17 0.75780613 0.82949355 18 0.63426156 0.75780613 19 0.50469914 0.63426156 20 0.30433316 0.50469914 21 0.01228860 0.30433316 22 -0.32789882 0.01228860 23 -0.53569338 -0.32789882 24 -0.45923794 -0.53569338 25 -0.48278250 -0.45923794 26 -0.50632707 -0.48278250 27 -0.52987163 -0.50632707 28 -0.55341619 -0.52987163 29 -0.47696076 -0.55341619 30 -0.40050532 -0.47696076 31 -0.42404988 -0.40050532 32 -0.54759445 -0.42404988 33 -0.57113901 -0.54759445 34 -0.39468357 -0.57113901 35 -0.25894241 -0.39468357 36 0.05733445 -0.25894241 37 0.43378989 0.05733445 38 0.48988819 0.43378989 39 0.43625434 0.48988819 40 0.41270977 0.43625434 41 0.44845093 0.41270977 42 0.76472780 0.44845093 43 1.04118324 0.76472780 44 1.01763867 1.04118324 45 0.79409411 1.01763867 46 0.27054955 0.79409411 47 -0.25299502 0.27054955 48 -0.87653958 -0.25299502 49 -1.50008414 -0.87653958 50 -1.62362871 -1.50008414 51 -1.24717327 -1.62362871 52 -0.77071783 -1.24717327 53 -0.39426240 -0.77071783 54 -0.21780696 -0.39426240 55 -0.04135152 -0.21780696 56 0.13510391 -0.04135152 57 0.51155935 0.13510391 58 1.18801479 0.51155935 59 1.86447022 1.18801479 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7eq7a1258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8t9pl1258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9rkxw1258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10gpql1258663264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #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, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11k96h1258663264.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/126vey1258663264.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/13zyyf1258663265.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/14qcoe1258663265.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/15nsbb1258663265.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/16n6ei1258663265.tab") + } > system("convert tmp/1eft91258663264.ps tmp/1eft91258663264.png") > system("convert tmp/2o9t71258663264.ps tmp/2o9t71258663264.png") > system("convert tmp/3i2gw1258663264.ps tmp/3i2gw1258663264.png") > system("convert tmp/4g2x71258663264.ps tmp/4g2x71258663264.png") > system("convert tmp/59d901258663264.ps tmp/59d901258663264.png") > system("convert tmp/6bxys1258663264.ps tmp/6bxys1258663264.png") > system("convert tmp/7eq7a1258663264.ps tmp/7eq7a1258663264.png") > system("convert tmp/8t9pl1258663264.ps tmp/8t9pl1258663264.png") > system("convert tmp/9rkxw1258663264.ps tmp/9rkxw1258663264.png") > system("convert tmp/10gpql1258663264.ps tmp/10gpql1258663264.png") > > > proc.time() user system elapsed 2.467 1.552 2.873