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(7.2,102.9,7.4,97.4,8.8,111.4,9.3,87.4,9.3,96.8,8.7,114.1,8.2,110.3,8.3,103.9,8.5,101.6,8.6,94.6,8.5,95.9,8.2,104.7,8.1,102.8,7.9,98.1,8.6,113.9,8.7,80.9,8.7,95.7,8.5,113.2,8.4,105.9,8.5,108.8,8.7,102.3,8.7,99,8.6,100.7,8.5,115.5,8.3,100.7,8,109.9,8.2,114.6,8.1,85.4,8.1,100.5,8,114.8,7.9,116.5,7.9,112.9,8,102,8,106,7.9,105.3,8,118.8,7.7,106.1,7.2,109.3,7.5,117.2,7.3,92.5,7,104.2,7,112.5,7,122.4,7.2,113.3,7.3,100,7.1,110.7,6.8,112.8,6.4,109.8,6.1,117.3,6.5,109.1,7.7,115.9,7.9,96,7.5,99.8,6.9,116.8,6.6,115.7,6.9,99.4,7.7,94.3,8,91,8,93.2,7.7,103.1,7.3,94.1,7.4,91.8,8.1,102.7,8.3,82.6,8.2,89.1),dim=c(2,65),dimnames=list(c('Werkl.graad','Industr.prod.'),1:65)) > y <- array(NA,dim=c(2,65),dimnames=list(c('Werkl.graad','Industr.prod.'),1:65)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal 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 Werkl.graad Industr.prod. 1 7.2 102.9 2 7.4 97.4 3 8.8 111.4 4 9.3 87.4 5 9.3 96.8 6 8.7 114.1 7 8.2 110.3 8 8.3 103.9 9 8.5 101.6 10 8.6 94.6 11 8.5 95.9 12 8.2 104.7 13 8.1 102.8 14 7.9 98.1 15 8.6 113.9 16 8.7 80.9 17 8.7 95.7 18 8.5 113.2 19 8.4 105.9 20 8.5 108.8 21 8.7 102.3 22 8.7 99.0 23 8.6 100.7 24 8.5 115.5 25 8.3 100.7 26 8.0 109.9 27 8.2 114.6 28 8.1 85.4 29 8.1 100.5 30 8.0 114.8 31 7.9 116.5 32 7.9 112.9 33 8.0 102.0 34 8.0 106.0 35 7.9 105.3 36 8.0 118.8 37 7.7 106.1 38 7.2 109.3 39 7.5 117.2 40 7.3 92.5 41 7.0 104.2 42 7.0 112.5 43 7.0 122.4 44 7.2 113.3 45 7.3 100.0 46 7.1 110.7 47 6.8 112.8 48 6.4 109.8 49 6.1 117.3 50 6.5 109.1 51 7.7 115.9 52 7.9 96.0 53 7.5 99.8 54 6.9 116.8 55 6.6 115.7 56 6.9 99.4 57 7.7 94.3 58 8.0 91.0 59 8.0 93.2 60 7.7 103.1 61 7.3 94.1 62 7.4 91.8 63 8.1 102.7 64 8.3 82.6 65 8.2 89.1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Industr.prod. 10.43984 -0.02467 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.44561 -0.54300 0.07688 0.49140 1.24858 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10.439843 0.903781 11.551 < 2e-16 *** Industr.prod. -0.024674 0.008644 -2.854 0.00583 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6645 on 63 degrees of freedom Multiple R-squared: 0.1145, Adjusted R-squared: 0.1005 F-statistic: 8.148 on 1 and 63 DF, p-value: 0.005828 > 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,] 0.9717786 0.05644287 0.02822143 [2,] 0.9632511 0.07349776 0.03674888 [3,] 0.9326284 0.13474314 0.06737157 [4,] 0.8883490 0.22330200 0.11165100 [5,] 0.8344082 0.33118368 0.16559184 [6,] 0.7682084 0.46358318 0.23179159 [7,] 0.6913335 0.61733307 0.30866654 [8,] 0.6108320 0.77833605 0.38916803 [9,] 0.5342502 0.93149963 0.46574982 [10,] 0.4927608 0.98552168 0.50723916 [11,] 0.4792912 0.95858232 0.52070884 [12,] 0.4017360 0.80347199 0.59826400 [13,] 0.3589173 0.71783465 0.64108267 [14,] 0.3363567 0.67271339 0.66364330 [15,] 0.2906839 0.58136785 0.70931608 [16,] 0.2696807 0.53936139 0.73031930 [17,] 0.2707505 0.54150110 0.72924945 [18,] 0.2692304 0.53846076 0.73076962 [19,] 0.2637185 0.52743693 0.73628154 [20,] 0.3038667 0.60773345 0.69613327 [21,] 0.2801380 0.56027606 0.71986197 [22,] 0.2699860 0.53997200 0.73001400 [23,] 0.2881177 0.57623549 0.71188226 [24,] 0.2627734 0.52554685 0.73722657 [25,] 0.2444979 0.48899577 0.75550211 [26,] 0.2614364 0.52287274 0.73856363 [27,] 0.2884706 0.57694129 0.71152936 [28,] 0.3119796 0.62395919 0.68802041 [29,] 0.3062193 0.61243867 0.69378066 [30,] 0.3195528 0.63910551 0.68044724 [31,] 0.3285542 0.65710835 0.67144583 [32,] 0.5013111 0.99737786 0.49868893 [33,] 0.5284645 0.94307100 0.47153550 [34,] 0.6071043 0.78579147 0.39289574 [35,] 0.6798274 0.64034511 0.32017256 [36,] 0.7805197 0.43896057 0.21948029 [37,] 0.8435632 0.31287351 0.15643675 [38,] 0.8562157 0.28756857 0.14378428 [39,] 0.8744118 0.25117634 0.12558817 [40,] 0.8697000 0.26059995 0.13029997 [41,] 0.8593166 0.28136689 0.14068345 [42,] 0.8413227 0.31735470 0.15867735 [43,] 0.8318885 0.33622302 0.16811151 [44,] 0.9005852 0.19882957 0.09941479 [45,] 0.9510978 0.09780432 0.04890216 [46,] 0.9771811 0.04563771 0.02281886 [47,] 0.9866174 0.02676525 0.01338262 [48,] 0.9775673 0.04486531 0.02243266 [49,] 0.9602816 0.07943690 0.03971845 [50,] 0.9341468 0.13170635 0.06585318 [51,] 0.9148810 0.17023810 0.08511905 [52,] 0.9654936 0.06901284 0.03450642 [53,] 0.9336078 0.13278445 0.06639223 [54,] 0.8714574 0.25708511 0.12854256 [55,] 0.7718360 0.45632801 0.22816401 [56,] 0.6117276 0.77654476 0.38827238 > postscript(file="/var/www/html/rcomp/tmp/177iz1258654875.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/2ra5x1258654875.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/33hhl1258654875.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/4vzal1258654875.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/5itnx1258654875.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 = 65 Frequency = 1 1 2 3 4 5 6 -0.70090923 -0.63661513 1.10881807 1.01664687 1.24858059 1.07543733 7 8 9 10 11 12 0.48167689 0.42376457 0.56701483 0.49429823 0.42637417 0.34350361 13 14 15 16 17 18 0.19662339 -0.11934347 0.97050257 0.25626717 0.62143941 0.85323091 19 20 21 22 23 24 0.57311217 0.74466619 0.78428649 0.70286295 0.64480841 0.90998065 25 26 27 28 29 30 0.34480841 0.27180737 0.58777423 -0.23270073 0.13987365 0.39270899 31 32 33 34 35 36 0.33465445 0.24582877 0.07688435 0.17557955 0.05830789 0.49140419 37 38 39 40 41 42 -0.12195307 -0.54299691 -0.04807389 -0.85751675 -0.86883329 -0.66404075 43 44 45 46 47 48 -0.41977013 -0.44430171 -0.67246325 -0.60845359 -0.85663861 -1.33066001 49 50 51 52 53 54 -1.44560651 -1.24793167 0.11985017 -0.17115845 -0.47739801 -0.65794341 55 56 57 58 59 60 -0.98508459 -1.08726753 -0.41310391 -0.19452745 -0.14024509 -0.19597447 61 62 63 64 65 -0.81803867 -0.77478841 0.19415601 -0.10178737 -0.04140767 > postscript(file="/var/www/html/rcomp/tmp/6vmmr1258654875.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 = 65 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.70090923 NA 1 -0.63661513 -0.70090923 2 1.10881807 -0.63661513 3 1.01664687 1.10881807 4 1.24858059 1.01664687 5 1.07543733 1.24858059 6 0.48167689 1.07543733 7 0.42376457 0.48167689 8 0.56701483 0.42376457 9 0.49429823 0.56701483 10 0.42637417 0.49429823 11 0.34350361 0.42637417 12 0.19662339 0.34350361 13 -0.11934347 0.19662339 14 0.97050257 -0.11934347 15 0.25626717 0.97050257 16 0.62143941 0.25626717 17 0.85323091 0.62143941 18 0.57311217 0.85323091 19 0.74466619 0.57311217 20 0.78428649 0.74466619 21 0.70286295 0.78428649 22 0.64480841 0.70286295 23 0.90998065 0.64480841 24 0.34480841 0.90998065 25 0.27180737 0.34480841 26 0.58777423 0.27180737 27 -0.23270073 0.58777423 28 0.13987365 -0.23270073 29 0.39270899 0.13987365 30 0.33465445 0.39270899 31 0.24582877 0.33465445 32 0.07688435 0.24582877 33 0.17557955 0.07688435 34 0.05830789 0.17557955 35 0.49140419 0.05830789 36 -0.12195307 0.49140419 37 -0.54299691 -0.12195307 38 -0.04807389 -0.54299691 39 -0.85751675 -0.04807389 40 -0.86883329 -0.85751675 41 -0.66404075 -0.86883329 42 -0.41977013 -0.66404075 43 -0.44430171 -0.41977013 44 -0.67246325 -0.44430171 45 -0.60845359 -0.67246325 46 -0.85663861 -0.60845359 47 -1.33066001 -0.85663861 48 -1.44560651 -1.33066001 49 -1.24793167 -1.44560651 50 0.11985017 -1.24793167 51 -0.17115845 0.11985017 52 -0.47739801 -0.17115845 53 -0.65794341 -0.47739801 54 -0.98508459 -0.65794341 55 -1.08726753 -0.98508459 56 -0.41310391 -1.08726753 57 -0.19452745 -0.41310391 58 -0.14024509 -0.19452745 59 -0.19597447 -0.14024509 60 -0.81803867 -0.19597447 61 -0.77478841 -0.81803867 62 0.19415601 -0.77478841 63 -0.10178737 0.19415601 64 -0.04140767 -0.10178737 65 NA -0.04140767 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.63661513 -0.70090923 [2,] 1.10881807 -0.63661513 [3,] 1.01664687 1.10881807 [4,] 1.24858059 1.01664687 [5,] 1.07543733 1.24858059 [6,] 0.48167689 1.07543733 [7,] 0.42376457 0.48167689 [8,] 0.56701483 0.42376457 [9,] 0.49429823 0.56701483 [10,] 0.42637417 0.49429823 [11,] 0.34350361 0.42637417 [12,] 0.19662339 0.34350361 [13,] -0.11934347 0.19662339 [14,] 0.97050257 -0.11934347 [15,] 0.25626717 0.97050257 [16,] 0.62143941 0.25626717 [17,] 0.85323091 0.62143941 [18,] 0.57311217 0.85323091 [19,] 0.74466619 0.57311217 [20,] 0.78428649 0.74466619 [21,] 0.70286295 0.78428649 [22,] 0.64480841 0.70286295 [23,] 0.90998065 0.64480841 [24,] 0.34480841 0.90998065 [25,] 0.27180737 0.34480841 [26,] 0.58777423 0.27180737 [27,] -0.23270073 0.58777423 [28,] 0.13987365 -0.23270073 [29,] 0.39270899 0.13987365 [30,] 0.33465445 0.39270899 [31,] 0.24582877 0.33465445 [32,] 0.07688435 0.24582877 [33,] 0.17557955 0.07688435 [34,] 0.05830789 0.17557955 [35,] 0.49140419 0.05830789 [36,] -0.12195307 0.49140419 [37,] -0.54299691 -0.12195307 [38,] -0.04807389 -0.54299691 [39,] -0.85751675 -0.04807389 [40,] -0.86883329 -0.85751675 [41,] -0.66404075 -0.86883329 [42,] -0.41977013 -0.66404075 [43,] -0.44430171 -0.41977013 [44,] -0.67246325 -0.44430171 [45,] -0.60845359 -0.67246325 [46,] -0.85663861 -0.60845359 [47,] -1.33066001 -0.85663861 [48,] -1.44560651 -1.33066001 [49,] -1.24793167 -1.44560651 [50,] 0.11985017 -1.24793167 [51,] -0.17115845 0.11985017 [52,] -0.47739801 -0.17115845 [53,] -0.65794341 -0.47739801 [54,] -0.98508459 -0.65794341 [55,] -1.08726753 -0.98508459 [56,] -0.41310391 -1.08726753 [57,] -0.19452745 -0.41310391 [58,] -0.14024509 -0.19452745 [59,] -0.19597447 -0.14024509 [60,] -0.81803867 -0.19597447 [61,] -0.77478841 -0.81803867 [62,] 0.19415601 -0.77478841 [63,] -0.10178737 0.19415601 [64,] -0.04140767 -0.10178737 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.63661513 -0.70090923 2 1.10881807 -0.63661513 3 1.01664687 1.10881807 4 1.24858059 1.01664687 5 1.07543733 1.24858059 6 0.48167689 1.07543733 7 0.42376457 0.48167689 8 0.56701483 0.42376457 9 0.49429823 0.56701483 10 0.42637417 0.49429823 11 0.34350361 0.42637417 12 0.19662339 0.34350361 13 -0.11934347 0.19662339 14 0.97050257 -0.11934347 15 0.25626717 0.97050257 16 0.62143941 0.25626717 17 0.85323091 0.62143941 18 0.57311217 0.85323091 19 0.74466619 0.57311217 20 0.78428649 0.74466619 21 0.70286295 0.78428649 22 0.64480841 0.70286295 23 0.90998065 0.64480841 24 0.34480841 0.90998065 25 0.27180737 0.34480841 26 0.58777423 0.27180737 27 -0.23270073 0.58777423 28 0.13987365 -0.23270073 29 0.39270899 0.13987365 30 0.33465445 0.39270899 31 0.24582877 0.33465445 32 0.07688435 0.24582877 33 0.17557955 0.07688435 34 0.05830789 0.17557955 35 0.49140419 0.05830789 36 -0.12195307 0.49140419 37 -0.54299691 -0.12195307 38 -0.04807389 -0.54299691 39 -0.85751675 -0.04807389 40 -0.86883329 -0.85751675 41 -0.66404075 -0.86883329 42 -0.41977013 -0.66404075 43 -0.44430171 -0.41977013 44 -0.67246325 -0.44430171 45 -0.60845359 -0.67246325 46 -0.85663861 -0.60845359 47 -1.33066001 -0.85663861 48 -1.44560651 -1.33066001 49 -1.24793167 -1.44560651 50 0.11985017 -1.24793167 51 -0.17115845 0.11985017 52 -0.47739801 -0.17115845 53 -0.65794341 -0.47739801 54 -0.98508459 -0.65794341 55 -1.08726753 -0.98508459 56 -0.41310391 -1.08726753 57 -0.19452745 -0.41310391 58 -0.14024509 -0.19452745 59 -0.19597447 -0.14024509 60 -0.81803867 -0.19597447 61 -0.77478841 -0.81803867 62 0.19415601 -0.77478841 63 -0.10178737 0.19415601 64 -0.04140767 -0.10178737 > 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/7pq6l1258654875.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/8frvm1258654875.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/9jnnl1258654875.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/10lx5k1258654875.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/110zpq1258654875.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/12e3np1258654875.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/138nrl1258654875.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/149oy71258654875.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/15kme21258654875.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/16bpsf1258654875.tab") + } > > system("convert tmp/177iz1258654875.ps tmp/177iz1258654875.png") > system("convert tmp/2ra5x1258654875.ps tmp/2ra5x1258654875.png") > system("convert tmp/33hhl1258654875.ps tmp/33hhl1258654875.png") > system("convert tmp/4vzal1258654875.ps tmp/4vzal1258654875.png") > system("convert tmp/5itnx1258654875.ps tmp/5itnx1258654875.png") > system("convert tmp/6vmmr1258654875.ps tmp/6vmmr1258654875.png") > system("convert tmp/7pq6l1258654875.ps tmp/7pq6l1258654875.png") > system("convert tmp/8frvm1258654875.ps tmp/8frvm1258654875.png") > system("convert tmp/9jnnl1258654875.ps tmp/9jnnl1258654875.png") > system("convert tmp/10lx5k1258654875.ps tmp/10lx5k1258654875.png") > > > proc.time() user system elapsed 2.476 1.556 2.896