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(111.4,91.2,111.5,92.2,111.6,93.2,111.7,94.2,111.8,95.2,111.9,96.2,111.10,97.2,111.11,98.2,111.12,99.2,111.13,100.2,111.14,101.2,111.15,102.2,111.16,103.2,111.17,104.2,111.18,105.2,111.19,106.2,111.20,107.2,111.21,108.2,111.22,109.2,111.23,110.2,111.24,111.2,111.25,112.2,111.26,113.2,111.27,114.2,111.28,115.2,111.29,116.2,111.30,117.2,111.31,118.2,111.32,119.2,111.33,120.2,111.34,121.2,111.35,122.2,111.36,123.2,111.37,124.2,111.38,125.2,111.39,126.2,111.40,127.2,111.41,128.2,111.42,129.2,111.43,130.2,111.44,131.2,111.45,132.2,111.46,133.2,111.47,134.2,111.48,135.2,111.49,136.2,111.50,137.2,111.51,138.2,111.52,139.2,111.53,140.2,111.54,141.2,111.55,142.2,111.56,143.2,111.57,144.2,111.58,145.2,111.59,146.2,111.60,147.2,111.61,148.2,111.62,149.2,111.63,150.2,111.64,151.2),dim=c(2,61),dimnames=list(c('biti','Bosnië'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('biti','Bosnië'),1:61)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Geen lineaire trend' > par2 = 'Omvatten niet seizoensgebonden Dummies' > par1 = '1' > #'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 biti Bosni\353 1 111.40 91.2 2 111.50 92.2 3 111.60 93.2 4 111.70 94.2 5 111.80 95.2 6 111.90 96.2 7 111.10 97.2 8 111.11 98.2 9 111.12 99.2 10 111.13 100.2 11 111.14 101.2 12 111.15 102.2 13 111.16 103.2 14 111.17 104.2 15 111.18 105.2 16 111.19 106.2 17 111.20 107.2 18 111.21 108.2 19 111.22 109.2 20 111.23 110.2 21 111.24 111.2 22 111.25 112.2 23 111.26 113.2 24 111.27 114.2 25 111.28 115.2 26 111.29 116.2 27 111.30 117.2 28 111.31 118.2 29 111.32 119.2 30 111.33 120.2 31 111.34 121.2 32 111.35 122.2 33 111.36 123.2 34 111.37 124.2 35 111.38 125.2 36 111.39 126.2 37 111.40 127.2 38 111.41 128.2 39 111.42 129.2 40 111.43 130.2 41 111.44 131.2 42 111.45 132.2 43 111.46 133.2 44 111.47 134.2 45 111.48 135.2 46 111.49 136.2 47 111.50 137.2 48 111.51 138.2 49 111.52 139.2 50 111.53 140.2 51 111.54 141.2 52 111.55 142.2 53 111.56 143.2 54 111.57 144.2 55 111.58 145.2 56 111.59 146.2 57 111.60 147.2 58 111.61 148.2 59 111.62 149.2 60 111.63 150.2 61 111.64 151.2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `Bosni\353` 1.108e+02 4.979e-03 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.17805 -0.10273 -0.02741 0.04790 0.62693 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.108e+02 1.428e-01 775.975 < 2e-16 *** `Bosni\353` 4.979e-03 1.166e-03 4.271 7.19e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.1603 on 59 degrees of freedom Multiple R-squared: 0.2361, Adjusted R-squared: 0.2232 F-statistic: 18.24 on 1 and 59 DF, p-value: 7.185e-05 > 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,] 5.741744e-41 1.148349e-40 1.000000e+00 [2,] 6.689121e-01 6.621759e-01 3.310879e-01 [3,] 1.000000e+00 0.000000e+00 0.000000e+00 [4,] 1.000000e+00 0.000000e+00 0.000000e+00 [5,] 1.000000e+00 0.000000e+00 0.000000e+00 [6,] 1.000000e+00 0.000000e+00 0.000000e+00 [7,] 1.000000e+00 0.000000e+00 0.000000e+00 [8,] 1.000000e+00 0.000000e+00 0.000000e+00 [9,] 1.000000e+00 0.000000e+00 0.000000e+00 [10,] 1.000000e+00 0.000000e+00 0.000000e+00 [11,] 1.000000e+00 0.000000e+00 0.000000e+00 [12,] 1.000000e+00 0.000000e+00 0.000000e+00 [13,] 1.000000e+00 0.000000e+00 0.000000e+00 [14,] 1.000000e+00 0.000000e+00 0.000000e+00 [15,] 1.000000e+00 0.000000e+00 0.000000e+00 [16,] 1.000000e+00 0.000000e+00 0.000000e+00 [17,] 1.000000e+00 0.000000e+00 0.000000e+00 [18,] 1.000000e+00 0.000000e+00 0.000000e+00 [19,] 1.000000e+00 0.000000e+00 0.000000e+00 [20,] 1.000000e+00 0.000000e+00 0.000000e+00 [21,] 1.000000e+00 0.000000e+00 0.000000e+00 [22,] 1.000000e+00 0.000000e+00 0.000000e+00 [23,] 1.000000e+00 0.000000e+00 0.000000e+00 [24,] 1.000000e+00 0.000000e+00 0.000000e+00 [25,] 1.000000e+00 0.000000e+00 0.000000e+00 [26,] 1.000000e+00 0.000000e+00 0.000000e+00 [27,] 1.000000e+00 0.000000e+00 0.000000e+00 [28,] 1.000000e+00 0.000000e+00 0.000000e+00 [29,] 1.000000e+00 6.916919e-322 3.458460e-322 [30,] 1.000000e+00 2.718219e-315 1.359109e-315 [31,] 1.000000e+00 3.753712e-313 1.876856e-313 [32,] 1.000000e+00 3.056748e-309 1.528374e-309 [33,] 1.000000e+00 1.984840e-276 9.924200e-277 [34,] 1.000000e+00 7.039319e-275 3.519659e-275 [35,] 1.000000e+00 1.581551e-252 7.907753e-253 [36,] 1.000000e+00 5.788494e-244 2.894247e-244 [37,] 1.000000e+00 2.836150e-225 1.418075e-225 [38,] 1.000000e+00 5.284422e-215 2.642211e-215 [39,] 1.000000e+00 7.889474e-205 3.944737e-205 [40,] 1.000000e+00 1.239576e-200 6.197881e-201 [41,] 1.000000e+00 3.616187e-180 1.808093e-180 [42,] 1.000000e+00 2.629970e-173 1.314985e-173 [43,] 1.000000e+00 6.300560e-153 3.150280e-153 [44,] 1.000000e+00 9.862669e-146 4.931335e-146 [45,] 1.000000e+00 5.921077e-126 2.960539e-126 [46,] 1.000000e+00 1.884983e-117 9.424915e-118 [47,] 1.000000e+00 3.402856e-103 1.701428e-103 [48,] 1.000000e+00 7.072122e-90 3.536061e-90 [49,] 1.000000e+00 9.846222e-79 4.923111e-79 [50,] 1.000000e+00 4.334273e-65 2.167136e-65 [51,] 1.000000e+00 2.134400e-51 1.067200e-51 [52,] 1.000000e+00 8.261192e-41 4.130596e-41 > postscript(file="/var/www/html/rcomp/tmp/1o8ri1258725313.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/2rgn61258725313.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/3a5vl1258725313.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/4upti1258725313.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/5c3n31258725313.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 = 61 Frequency = 1 1 2 3 4 5 6 0.151824432 0.246845584 0.341866737 0.436887890 0.531909043 0.626930196 7 8 9 10 11 12 -0.178048652 -0.173027499 -0.168006346 -0.162985193 -0.157964040 -0.152942887 13 14 15 16 17 18 -0.147921735 -0.142900582 -0.137879429 -0.132858276 -0.127837123 -0.122815970 19 20 21 22 23 24 -0.117794818 -0.112773665 -0.107752512 -0.102731359 -0.097710206 -0.092689053 25 26 27 28 29 30 -0.087667901 -0.082646748 -0.077625595 -0.072604442 -0.067583289 -0.062562136 31 32 33 34 35 36 -0.057540984 -0.052519831 -0.047498678 -0.042477525 -0.037456372 -0.032435219 37 38 39 40 41 42 -0.027414067 -0.022392914 -0.017371761 -0.012350608 -0.007329455 -0.002308302 43 44 45 46 47 48 0.002712850 0.007734003 0.012755156 0.017776309 0.022797462 0.027818614 49 50 51 52 53 54 0.032839767 0.037860920 0.042882073 0.047903226 0.052924379 0.057945531 55 56 57 58 59 60 0.062966684 0.067987837 0.073008990 0.078030143 0.083051296 0.088072448 61 0.093093601 > postscript(file="/var/www/html/rcomp/tmp/6wp081258725313.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 0.151824432 NA 1 0.246845584 0.151824432 2 0.341866737 0.246845584 3 0.436887890 0.341866737 4 0.531909043 0.436887890 5 0.626930196 0.531909043 6 -0.178048652 0.626930196 7 -0.173027499 -0.178048652 8 -0.168006346 -0.173027499 9 -0.162985193 -0.168006346 10 -0.157964040 -0.162985193 11 -0.152942887 -0.157964040 12 -0.147921735 -0.152942887 13 -0.142900582 -0.147921735 14 -0.137879429 -0.142900582 15 -0.132858276 -0.137879429 16 -0.127837123 -0.132858276 17 -0.122815970 -0.127837123 18 -0.117794818 -0.122815970 19 -0.112773665 -0.117794818 20 -0.107752512 -0.112773665 21 -0.102731359 -0.107752512 22 -0.097710206 -0.102731359 23 -0.092689053 -0.097710206 24 -0.087667901 -0.092689053 25 -0.082646748 -0.087667901 26 -0.077625595 -0.082646748 27 -0.072604442 -0.077625595 28 -0.067583289 -0.072604442 29 -0.062562136 -0.067583289 30 -0.057540984 -0.062562136 31 -0.052519831 -0.057540984 32 -0.047498678 -0.052519831 33 -0.042477525 -0.047498678 34 -0.037456372 -0.042477525 35 -0.032435219 -0.037456372 36 -0.027414067 -0.032435219 37 -0.022392914 -0.027414067 38 -0.017371761 -0.022392914 39 -0.012350608 -0.017371761 40 -0.007329455 -0.012350608 41 -0.002308302 -0.007329455 42 0.002712850 -0.002308302 43 0.007734003 0.002712850 44 0.012755156 0.007734003 45 0.017776309 0.012755156 46 0.022797462 0.017776309 47 0.027818614 0.022797462 48 0.032839767 0.027818614 49 0.037860920 0.032839767 50 0.042882073 0.037860920 51 0.047903226 0.042882073 52 0.052924379 0.047903226 53 0.057945531 0.052924379 54 0.062966684 0.057945531 55 0.067987837 0.062966684 56 0.073008990 0.067987837 57 0.078030143 0.073008990 58 0.083051296 0.078030143 59 0.088072448 0.083051296 60 0.093093601 0.088072448 61 NA 0.093093601 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.246845584 0.151824432 [2,] 0.341866737 0.246845584 [3,] 0.436887890 0.341866737 [4,] 0.531909043 0.436887890 [5,] 0.626930196 0.531909043 [6,] -0.178048652 0.626930196 [7,] -0.173027499 -0.178048652 [8,] -0.168006346 -0.173027499 [9,] -0.162985193 -0.168006346 [10,] -0.157964040 -0.162985193 [11,] -0.152942887 -0.157964040 [12,] -0.147921735 -0.152942887 [13,] -0.142900582 -0.147921735 [14,] -0.137879429 -0.142900582 [15,] -0.132858276 -0.137879429 [16,] -0.127837123 -0.132858276 [17,] -0.122815970 -0.127837123 [18,] -0.117794818 -0.122815970 [19,] -0.112773665 -0.117794818 [20,] -0.107752512 -0.112773665 [21,] -0.102731359 -0.107752512 [22,] -0.097710206 -0.102731359 [23,] -0.092689053 -0.097710206 [24,] -0.087667901 -0.092689053 [25,] -0.082646748 -0.087667901 [26,] -0.077625595 -0.082646748 [27,] -0.072604442 -0.077625595 [28,] -0.067583289 -0.072604442 [29,] -0.062562136 -0.067583289 [30,] -0.057540984 -0.062562136 [31,] -0.052519831 -0.057540984 [32,] -0.047498678 -0.052519831 [33,] -0.042477525 -0.047498678 [34,] -0.037456372 -0.042477525 [35,] -0.032435219 -0.037456372 [36,] -0.027414067 -0.032435219 [37,] -0.022392914 -0.027414067 [38,] -0.017371761 -0.022392914 [39,] -0.012350608 -0.017371761 [40,] -0.007329455 -0.012350608 [41,] -0.002308302 -0.007329455 [42,] 0.002712850 -0.002308302 [43,] 0.007734003 0.002712850 [44,] 0.012755156 0.007734003 [45,] 0.017776309 0.012755156 [46,] 0.022797462 0.017776309 [47,] 0.027818614 0.022797462 [48,] 0.032839767 0.027818614 [49,] 0.037860920 0.032839767 [50,] 0.042882073 0.037860920 [51,] 0.047903226 0.042882073 [52,] 0.052924379 0.047903226 [53,] 0.057945531 0.052924379 [54,] 0.062966684 0.057945531 [55,] 0.067987837 0.062966684 [56,] 0.073008990 0.067987837 [57,] 0.078030143 0.073008990 [58,] 0.083051296 0.078030143 [59,] 0.088072448 0.083051296 [60,] 0.093093601 0.088072448 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.246845584 0.151824432 2 0.341866737 0.246845584 3 0.436887890 0.341866737 4 0.531909043 0.436887890 5 0.626930196 0.531909043 6 -0.178048652 0.626930196 7 -0.173027499 -0.178048652 8 -0.168006346 -0.173027499 9 -0.162985193 -0.168006346 10 -0.157964040 -0.162985193 11 -0.152942887 -0.157964040 12 -0.147921735 -0.152942887 13 -0.142900582 -0.147921735 14 -0.137879429 -0.142900582 15 -0.132858276 -0.137879429 16 -0.127837123 -0.132858276 17 -0.122815970 -0.127837123 18 -0.117794818 -0.122815970 19 -0.112773665 -0.117794818 20 -0.107752512 -0.112773665 21 -0.102731359 -0.107752512 22 -0.097710206 -0.102731359 23 -0.092689053 -0.097710206 24 -0.087667901 -0.092689053 25 -0.082646748 -0.087667901 26 -0.077625595 -0.082646748 27 -0.072604442 -0.077625595 28 -0.067583289 -0.072604442 29 -0.062562136 -0.067583289 30 -0.057540984 -0.062562136 31 -0.052519831 -0.057540984 32 -0.047498678 -0.052519831 33 -0.042477525 -0.047498678 34 -0.037456372 -0.042477525 35 -0.032435219 -0.037456372 36 -0.027414067 -0.032435219 37 -0.022392914 -0.027414067 38 -0.017371761 -0.022392914 39 -0.012350608 -0.017371761 40 -0.007329455 -0.012350608 41 -0.002308302 -0.007329455 42 0.002712850 -0.002308302 43 0.007734003 0.002712850 44 0.012755156 0.007734003 45 0.017776309 0.012755156 46 0.022797462 0.017776309 47 0.027818614 0.022797462 48 0.032839767 0.027818614 49 0.037860920 0.032839767 50 0.042882073 0.037860920 51 0.047903226 0.042882073 52 0.052924379 0.047903226 53 0.057945531 0.052924379 54 0.062966684 0.057945531 55 0.067987837 0.062966684 56 0.073008990 0.067987837 57 0.078030143 0.073008990 58 0.083051296 0.078030143 59 0.088072448 0.083051296 60 0.093093601 0.088072448 > 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/7zr921258725313.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/8s7rl1258725313.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/917ox1258725313.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/10h0hd1258725313.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/112zxj1258725313.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/128mpq1258725313.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/13n4691258725313.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/14e7tb1258725313.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/15obts1258725313.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/16yi7u1258725313.tab") + } > > system("convert tmp/1o8ri1258725313.ps tmp/1o8ri1258725313.png") > system("convert tmp/2rgn61258725313.ps tmp/2rgn61258725313.png") > system("convert tmp/3a5vl1258725313.ps tmp/3a5vl1258725313.png") > system("convert tmp/4upti1258725313.ps tmp/4upti1258725313.png") > system("convert tmp/5c3n31258725313.ps tmp/5c3n31258725313.png") > system("convert tmp/6wp081258725313.ps tmp/6wp081258725313.png") > system("convert tmp/7zr921258725313.ps tmp/7zr921258725313.png") > system("convert tmp/8s7rl1258725313.ps tmp/8s7rl1258725313.png") > system("convert tmp/917ox1258725313.ps tmp/917ox1258725313.png") > system("convert tmp/10h0hd1258725313.ps tmp/10h0hd1258725313.png") > > > proc.time() user system elapsed 2.430 1.575 2.878