R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(20995,17382,9367,31124,26551,30651,25859,25100,25778,20418,18688,20424,24776,19814,12738,31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971,20036,22485,18730,14538,27561,25985,34670,32066,27186,29586,21359,21553,19573,24256,22380,16167,27297,28287,33474,28229,28785,25597,18130,20198,22849,23118),dim=c(1,61),dimnames=list(c('Inschrijvingen'),1:61)) > y <- array(NA,dim=c(1,61),dimnames=list(c('Inschrijvingen'),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 = 'Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '1' > library(lattice) > library(lmtest) Loading required package: zoo > 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 Inschrijvingen M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 20995 1 0 0 0 0 0 0 0 0 0 0 1 2 17382 0 1 0 0 0 0 0 0 0 0 0 2 3 9367 0 0 1 0 0 0 0 0 0 0 0 3 4 31124 0 0 0 1 0 0 0 0 0 0 0 4 5 26551 0 0 0 0 1 0 0 0 0 0 0 5 6 30651 0 0 0 0 0 1 0 0 0 0 0 6 7 25859 0 0 0 0 0 0 1 0 0 0 0 7 8 25100 0 0 0 0 0 0 0 1 0 0 0 8 9 25778 0 0 0 0 0 0 0 0 1 0 0 9 10 20418 0 0 0 0 0 0 0 0 0 1 0 10 11 18688 0 0 0 0 0 0 0 0 0 0 1 11 12 20424 0 0 0 0 0 0 0 0 0 0 0 12 13 24776 1 0 0 0 0 0 0 0 0 0 0 13 14 19814 0 1 0 0 0 0 0 0 0 0 0 14 15 12738 0 0 1 0 0 0 0 0 0 0 0 15 16 31566 0 0 0 1 0 0 0 0 0 0 0 16 17 30111 0 0 0 0 1 0 0 0 0 0 0 17 18 30019 0 0 0 0 0 1 0 0 0 0 0 18 19 31934 0 0 0 0 0 0 1 0 0 0 0 19 20 25826 0 0 0 0 0 0 0 1 0 0 0 20 21 26835 0 0 0 0 0 0 0 0 1 0 0 21 22 20205 0 0 0 0 0 0 0 0 0 1 0 22 23 17789 0 0 0 0 0 0 0 0 0 0 1 23 24 20520 0 0 0 0 0 0 0 0 0 0 0 24 25 22518 1 0 0 0 0 0 0 0 0 0 0 25 26 15572 0 1 0 0 0 0 0 0 0 0 0 26 27 11509 0 0 1 0 0 0 0 0 0 0 0 27 28 25447 0 0 0 1 0 0 0 0 0 0 0 28 29 24090 0 0 0 0 1 0 0 0 0 0 0 29 30 27786 0 0 0 0 0 1 0 0 0 0 0 30 31 26195 0 0 0 0 0 0 1 0 0 0 0 31 32 20516 0 0 0 0 0 0 0 1 0 0 0 32 33 22759 0 0 0 0 0 0 0 0 1 0 0 33 34 19028 0 0 0 0 0 0 0 0 0 1 0 34 35 16971 0 0 0 0 0 0 0 0 0 0 1 35 36 20036 0 0 0 0 0 0 0 0 0 0 0 36 37 22485 1 0 0 0 0 0 0 0 0 0 0 37 38 18730 0 1 0 0 0 0 0 0 0 0 0 38 39 14538 0 0 1 0 0 0 0 0 0 0 0 39 40 27561 0 0 0 1 0 0 0 0 0 0 0 40 41 25985 0 0 0 0 1 0 0 0 0 0 0 41 42 34670 0 0 0 0 0 1 0 0 0 0 0 42 43 32066 0 0 0 0 0 0 1 0 0 0 0 43 44 27186 0 0 0 0 0 0 0 1 0 0 0 44 45 29586 0 0 0 0 0 0 0 0 1 0 0 45 46 21359 0 0 0 0 0 0 0 0 0 1 0 46 47 21553 0 0 0 0 0 0 0 0 0 0 1 47 48 19573 0 0 0 0 0 0 0 0 0 0 0 48 49 24256 1 0 0 0 0 0 0 0 0 0 0 49 50 22380 0 1 0 0 0 0 0 0 0 0 0 50 51 16167 0 0 1 0 0 0 0 0 0 0 0 51 52 27297 0 0 0 1 0 0 0 0 0 0 0 52 53 28287 0 0 0 0 1 0 0 0 0 0 0 53 54 33474 0 0 0 0 0 1 0 0 0 0 0 54 55 28229 0 0 0 0 0 0 1 0 0 0 0 55 56 28785 0 0 0 0 0 0 0 1 0 0 0 56 57 25597 0 0 0 0 0 0 0 0 1 0 0 57 58 18130 0 0 0 0 0 0 0 0 0 1 0 58 59 20198 0 0 0 0 0 0 0 0 0 0 1 59 60 22849 0 0 0 0 0 0 0 0 0 0 0 60 61 23118 1 0 0 0 0 0 0 0 0 0 0 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) M1 M2 M3 M4 M5 19502.45 2507.87 -1577.59 -7522.11 8180.37 6553.45 M6 M7 M8 M9 M10 M11 10835.93 8339.80 4933.08 5528.76 -786.96 -1607.88 t 32.72 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4966.6 -1412.5 266.9 1368.7 3498.9 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 19502.45 1184.03 16.471 < 2e-16 *** M1 2507.87 1380.85 1.816 0.075591 . M2 -1577.59 1449.35 -1.088 0.281818 M3 -7522.11 1447.50 -5.197 4.11e-06 *** M4 8180.37 1445.84 5.658 8.32e-07 *** M5 6553.45 1444.38 4.537 3.82e-05 *** M6 10835.93 1443.11 7.509 1.23e-09 *** M7 8339.80 1442.03 5.783 5.36e-07 *** M8 4933.08 1441.15 3.423 0.001276 ** M9 5528.76 1440.46 3.838 0.000362 *** M10 -786.96 1439.98 -0.547 0.587248 M11 -1607.88 1439.68 -1.117 0.269626 t 32.72 16.80 1.948 0.057294 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2276 on 48 degrees of freedom Multiple R-squared: 0.8654, Adjusted R-squared: 0.8318 F-statistic: 25.72 on 12 and 48 DF, p-value: < 2.2e-16 > 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.10369082 0.2073816 0.8963092 [2,] 0.05738181 0.1147636 0.9426182 [3,] 0.10744509 0.2148902 0.8925549 [4,] 0.22186395 0.4437279 0.7781360 [5,] 0.18108621 0.3621724 0.8189138 [6,] 0.14211300 0.2842260 0.8578870 [7,] 0.15006759 0.3001352 0.8499324 [8,] 0.15234192 0.3046838 0.8476581 [9,] 0.12888181 0.2577636 0.8711182 [10,] 0.14760501 0.2952100 0.8523950 [11,] 0.29405129 0.5881026 0.7059487 [12,] 0.22325722 0.4465144 0.7767428 [13,] 0.48782379 0.9756476 0.5121762 [14,] 0.51198271 0.9760346 0.4880173 [15,] 0.54266242 0.9146752 0.4573376 [16,] 0.49808437 0.9961687 0.5019156 [17,] 0.74770492 0.5045902 0.2522951 [18,] 0.80452452 0.3909510 0.1954755 [19,] 0.72764519 0.5447096 0.2723548 [20,] 0.75358455 0.4928309 0.2464154 [21,] 0.68075835 0.6384833 0.3192416 [22,] 0.61205854 0.7758829 0.3879415 [23,] 0.69389302 0.6122140 0.3061070 [24,] 0.72011434 0.5597713 0.2798857 [25,] 0.61934014 0.7613197 0.3806599 [26,] 0.63085464 0.7382907 0.3691454 [27,] 0.61271945 0.7745611 0.3872806 [28,] 0.62182085 0.7563583 0.3781792 [29,] 0.58920902 0.8215820 0.4107910 [30,] 0.58904764 0.8219047 0.4109524 > postscript(file="/var/wessaorg/rcomp/tmp/1dytc1322500159.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2ubfe1322500159.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3cbl11322500159.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/434n71322500159.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/5u8qe1322500159.ps",horizontal=F,onefile=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 7 -1048.0392 -608.2980 -2711.4980 3310.3020 331.5020 116.3020 -2212.2980 8 9 10 11 12 13 14 402.7020 452.3020 1375.3020 433.5020 528.9020 2340.3098 1431.0510 15 16 17 18 19 20 21 266.8510 3359.6510 3498.8510 -908.3490 3470.0510 736.0510 1116.6510 22 23 24 25 26 27 28 769.6510 -858.1490 232.2510 -310.3412 -3203.6000 -1354.8000 -3152.0000 29 30 31 32 33 34 35 -2914.8000 -3534.0000 -2661.6000 -4966.6000 -3352.0000 -800.0000 -2068.8000 36 37 38 39 40 41 42 -644.4000 -735.9922 -438.2510 1281.5490 -1430.6510 -1412.4510 2957.3490 43 44 45 46 47 48 49 2816.7490 1310.7490 3082.3490 1138.3490 2120.5490 -1500.0510 642.3569 50 51 52 53 54 55 56 2819.0980 2517.8980 -2087.3020 496.8980 1368.6980 -1412.9020 2517.0980 57 58 59 60 61 -1299.3020 -2483.3020 372.8980 1383.2980 -888.2941 > postscript(file="/var/wessaorg/rcomp/tmp/6nrjt1322500159.ps",horizontal=F,onefile=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 -1048.0392 NA 1 -608.2980 -1048.0392 2 -2711.4980 -608.2980 3 3310.3020 -2711.4980 4 331.5020 3310.3020 5 116.3020 331.5020 6 -2212.2980 116.3020 7 402.7020 -2212.2980 8 452.3020 402.7020 9 1375.3020 452.3020 10 433.5020 1375.3020 11 528.9020 433.5020 12 2340.3098 528.9020 13 1431.0510 2340.3098 14 266.8510 1431.0510 15 3359.6510 266.8510 16 3498.8510 3359.6510 17 -908.3490 3498.8510 18 3470.0510 -908.3490 19 736.0510 3470.0510 20 1116.6510 736.0510 21 769.6510 1116.6510 22 -858.1490 769.6510 23 232.2510 -858.1490 24 -310.3412 232.2510 25 -3203.6000 -310.3412 26 -1354.8000 -3203.6000 27 -3152.0000 -1354.8000 28 -2914.8000 -3152.0000 29 -3534.0000 -2914.8000 30 -2661.6000 -3534.0000 31 -4966.6000 -2661.6000 32 -3352.0000 -4966.6000 33 -800.0000 -3352.0000 34 -2068.8000 -800.0000 35 -644.4000 -2068.8000 36 -735.9922 -644.4000 37 -438.2510 -735.9922 38 1281.5490 -438.2510 39 -1430.6510 1281.5490 40 -1412.4510 -1430.6510 41 2957.3490 -1412.4510 42 2816.7490 2957.3490 43 1310.7490 2816.7490 44 3082.3490 1310.7490 45 1138.3490 3082.3490 46 2120.5490 1138.3490 47 -1500.0510 2120.5490 48 642.3569 -1500.0510 49 2819.0980 642.3569 50 2517.8980 2819.0980 51 -2087.3020 2517.8980 52 496.8980 -2087.3020 53 1368.6980 496.8980 54 -1412.9020 1368.6980 55 2517.0980 -1412.9020 56 -1299.3020 2517.0980 57 -2483.3020 -1299.3020 58 372.8980 -2483.3020 59 1383.2980 372.8980 60 -888.2941 1383.2980 61 NA -888.2941 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -608.2980 -1048.0392 [2,] -2711.4980 -608.2980 [3,] 3310.3020 -2711.4980 [4,] 331.5020 3310.3020 [5,] 116.3020 331.5020 [6,] -2212.2980 116.3020 [7,] 402.7020 -2212.2980 [8,] 452.3020 402.7020 [9,] 1375.3020 452.3020 [10,] 433.5020 1375.3020 [11,] 528.9020 433.5020 [12,] 2340.3098 528.9020 [13,] 1431.0510 2340.3098 [14,] 266.8510 1431.0510 [15,] 3359.6510 266.8510 [16,] 3498.8510 3359.6510 [17,] -908.3490 3498.8510 [18,] 3470.0510 -908.3490 [19,] 736.0510 3470.0510 [20,] 1116.6510 736.0510 [21,] 769.6510 1116.6510 [22,] -858.1490 769.6510 [23,] 232.2510 -858.1490 [24,] -310.3412 232.2510 [25,] -3203.6000 -310.3412 [26,] -1354.8000 -3203.6000 [27,] -3152.0000 -1354.8000 [28,] -2914.8000 -3152.0000 [29,] -3534.0000 -2914.8000 [30,] -2661.6000 -3534.0000 [31,] -4966.6000 -2661.6000 [32,] -3352.0000 -4966.6000 [33,] -800.0000 -3352.0000 [34,] -2068.8000 -800.0000 [35,] -644.4000 -2068.8000 [36,] -735.9922 -644.4000 [37,] -438.2510 -735.9922 [38,] 1281.5490 -438.2510 [39,] -1430.6510 1281.5490 [40,] -1412.4510 -1430.6510 [41,] 2957.3490 -1412.4510 [42,] 2816.7490 2957.3490 [43,] 1310.7490 2816.7490 [44,] 3082.3490 1310.7490 [45,] 1138.3490 3082.3490 [46,] 2120.5490 1138.3490 [47,] -1500.0510 2120.5490 [48,] 642.3569 -1500.0510 [49,] 2819.0980 642.3569 [50,] 2517.8980 2819.0980 [51,] -2087.3020 2517.8980 [52,] 496.8980 -2087.3020 [53,] 1368.6980 496.8980 [54,] -1412.9020 1368.6980 [55,] 2517.0980 -1412.9020 [56,] -1299.3020 2517.0980 [57,] -2483.3020 -1299.3020 [58,] 372.8980 -2483.3020 [59,] 1383.2980 372.8980 [60,] -888.2941 1383.2980 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -608.2980 -1048.0392 2 -2711.4980 -608.2980 3 3310.3020 -2711.4980 4 331.5020 3310.3020 5 116.3020 331.5020 6 -2212.2980 116.3020 7 402.7020 -2212.2980 8 452.3020 402.7020 9 1375.3020 452.3020 10 433.5020 1375.3020 11 528.9020 433.5020 12 2340.3098 528.9020 13 1431.0510 2340.3098 14 266.8510 1431.0510 15 3359.6510 266.8510 16 3498.8510 3359.6510 17 -908.3490 3498.8510 18 3470.0510 -908.3490 19 736.0510 3470.0510 20 1116.6510 736.0510 21 769.6510 1116.6510 22 -858.1490 769.6510 23 232.2510 -858.1490 24 -310.3412 232.2510 25 -3203.6000 -310.3412 26 -1354.8000 -3203.6000 27 -3152.0000 -1354.8000 28 -2914.8000 -3152.0000 29 -3534.0000 -2914.8000 30 -2661.6000 -3534.0000 31 -4966.6000 -2661.6000 32 -3352.0000 -4966.6000 33 -800.0000 -3352.0000 34 -2068.8000 -800.0000 35 -644.4000 -2068.8000 36 -735.9922 -644.4000 37 -438.2510 -735.9922 38 1281.5490 -438.2510 39 -1430.6510 1281.5490 40 -1412.4510 -1430.6510 41 2957.3490 -1412.4510 42 2816.7490 2957.3490 43 1310.7490 2816.7490 44 3082.3490 1310.7490 45 1138.3490 3082.3490 46 2120.5490 1138.3490 47 -1500.0510 2120.5490 48 642.3569 -1500.0510 49 2819.0980 642.3569 50 2517.8980 2819.0980 51 -2087.3020 2517.8980 52 496.8980 -2087.3020 53 1368.6980 496.8980 54 -1412.9020 1368.6980 55 2517.0980 -1412.9020 56 -1299.3020 2517.0980 57 -2483.3020 -1299.3020 58 372.8980 -2483.3020 59 1383.2980 372.8980 60 -888.2941 1383.2980 > 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/wessaorg/rcomp/tmp/78wq71322500159.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/8a3bo1322500159.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/9240x1322500159.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/10fgcs1322500159.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11rxtu1322500159.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/wessaorg/rcomp/tmp/122h2w1322500159.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/wessaorg/rcomp/tmp/13psad1322500159.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/wessaorg/rcomp/tmp/14kt7s1322500159.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/wessaorg/rcomp/tmp/15qy011322500159.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/wessaorg/rcomp/tmp/162bp41322500159.tab") + } > > try(system("convert tmp/1dytc1322500159.ps tmp/1dytc1322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/2ubfe1322500159.ps tmp/2ubfe1322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/3cbl11322500159.ps tmp/3cbl11322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/434n71322500159.ps tmp/434n71322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/5u8qe1322500159.ps tmp/5u8qe1322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/6nrjt1322500159.ps tmp/6nrjt1322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/78wq71322500159.ps tmp/78wq71322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/8a3bo1322500159.ps tmp/8a3bo1322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/9240x1322500159.ps tmp/9240x1322500159.png",intern=TRUE)) character(0) > try(system("convert tmp/10fgcs1322500159.ps tmp/10fgcs1322500159.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.231 0.517 3.789