R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(309365,159129,308347,157928,298427,147768,289231,137507,291975,136919,294912,136151,293488,133001,290555,125554,284736,119647,281818,114158,287854,116193,316263,152803,325412,161761,326011,160942,328282,149470,317480,139208,317539,134588,313737,130322,312276,126611,309391,122401,302950,117352,300316,112135,304035,112879,333476,148729,337698,157230,335932,157221,323931,146681,313927,136524,314485,132111,313218,125326,309664,122716,302963,116615,298989,113719,298423,110737,301631,112093,329765,143565,335083,149946,327616,149147,309119,134339,295916,122683,291413,115614,291542,116566,284678,111272,276475,104609,272566,101802,264981,94542,263290,93051,296806,124129,303598,130374,286994,123946,276427,114971,266424,105531,267153,104919,268381,104782,262522,101281,255542,94545,253158,93248,243803,84031,250741,87486,280445,115867,285257,120327),dim=c(2,61),dimnames=list(c('vrouwen','jonger_dan_25'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('vrouwen','jonger_dan_25'),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 = '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 vrouwen jonger_dan_25 1 309365 159129 2 308347 157928 3 298427 147768 4 289231 137507 5 291975 136919 6 294912 136151 7 293488 133001 8 290555 125554 9 284736 119647 10 281818 114158 11 287854 116193 12 316263 152803 13 325412 161761 14 326011 160942 15 328282 149470 16 317480 139208 17 317539 134588 18 313737 130322 19 312276 126611 20 309391 122401 21 302950 117352 22 300316 112135 23 304035 112879 24 333476 148729 25 337698 157230 26 335932 157221 27 323931 146681 28 313927 136524 29 314485 132111 30 313218 125326 31 309664 122716 32 302963 116615 33 298989 113719 34 298423 110737 35 301631 112093 36 329765 143565 37 335083 149946 38 327616 149147 39 309119 134339 40 295916 122683 41 291413 115614 42 291542 116566 43 284678 111272 44 276475 104609 45 272566 101802 46 264981 94542 47 263290 93051 48 296806 124129 49 303598 130374 50 286994 123946 51 276427 114971 52 266424 105531 53 267153 104919 54 268381 104782 55 262522 101281 56 255542 94545 57 253158 93248 58 243803 84031 59 250741 87486 60 280445 115867 61 285257 120327 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) jonger_dan_25 170903.75 1.01 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -22266.0 -8978.5 526.5 10695.5 19118.5 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.709e+05 9.386e+03 18.21 <2e-16 *** jonger_dan_25 1.010e+00 7.415e-02 13.62 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 11480 on 59 degrees of freedom Multiple R-squared: 0.7588, Adjusted R-squared: 0.7547 F-statistic: 185.6 on 1 and 59 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.0047574378 9.514876e-03 9.952426e-01 [2,] 0.0098965195 1.979304e-02 9.901035e-01 [3,] 0.0070987049 1.419741e-02 9.929013e-01 [4,] 0.0053717814 1.074356e-02 9.946282e-01 [5,] 0.0017305390 3.461078e-03 9.982695e-01 [6,] 0.0005112163 1.022433e-03 9.994888e-01 [7,] 0.0005150512 1.030102e-03 9.994849e-01 [8,] 0.0126086675 2.521734e-02 9.873913e-01 [9,] 0.0657121538 1.314243e-01 9.342878e-01 [10,] 0.1471933670 2.943867e-01 8.528066e-01 [11,] 0.4843062064 9.686124e-01 5.156938e-01 [12,] 0.6304400314 7.391199e-01 3.695600e-01 [13,] 0.7791678639 4.416643e-01 2.208321e-01 [14,] 0.8460030485 3.079939e-01 1.539970e-01 [15,] 0.8939369468 2.121261e-01 1.060631e-01 [16,] 0.9233328920 1.533342e-01 7.666711e-02 [17,] 0.9289335356 1.421329e-01 7.106646e-02 [18,] 0.9459037191 1.081926e-01 5.409628e-02 [19,] 0.9735701187 5.285976e-02 2.642988e-02 [20,] 0.9846219217 3.075616e-02 1.537808e-02 [21,] 0.9884890597 2.302188e-02 1.151094e-02 [22,] 0.9895241456 2.095171e-02 1.047585e-02 [23,] 0.9868407569 2.631849e-02 1.315924e-02 [24,] 0.9804845542 3.903089e-02 1.951545e-02 [25,] 0.9740065094 5.198698e-02 2.599349e-02 [26,] 0.9782519392 4.349612e-02 2.174806e-02 [27,] 0.9814198424 3.716032e-02 1.858016e-02 [28,] 0.9861720925 2.765582e-02 1.382791e-02 [29,] 0.9906264513 1.874710e-02 9.373549e-03 [30,] 0.9975227499 4.954500e-03 2.477250e-03 [31,] 0.9999048787 1.902426e-04 9.512131e-05 [32,] 0.9999473622 1.052755e-04 5.263775e-05 [33,] 0.9999639707 7.205851e-05 3.602926e-05 [34,] 0.9999271637 1.456726e-04 7.283629e-05 [35,] 0.9998376751 3.246497e-04 1.623249e-04 [36,] 0.9996981416 6.037168e-04 3.018584e-04 [37,] 0.9997243168 5.513664e-04 2.756832e-04 [38,] 0.9997410279 5.179441e-04 2.589721e-04 [39,] 0.9997667435 4.665131e-04 2.332565e-04 [40,] 0.9998005121 3.989758e-04 1.994879e-04 [41,] 0.9998250728 3.498545e-04 1.749272e-04 [42,] 0.9999165595 1.668810e-04 8.344051e-05 [43,] 0.9999883888 2.322249e-05 1.161124e-05 [44,] 0.9999942387 1.152266e-05 5.761329e-06 [45,] 0.9999999535 9.301827e-08 4.650914e-08 [46,] 0.9999997247 5.505494e-07 2.752747e-07 [47,] 0.9999992827 1.434599e-06 7.172994e-07 [48,] 0.9999978834 4.233114e-06 2.116557e-06 [49,] 0.9999841812 3.163768e-05 1.581884e-05 [50,] 0.9998887200 2.225600e-04 1.112800e-04 [51,] 0.9993393220 1.321356e-03 6.606780e-04 [52,] 0.9953839104 9.232179e-03 4.616090e-03 > postscript(file="/var/www/html/rcomp/tmp/1ulpv1227714922.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/2ryi71227714922.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/3xq9m1227714922.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/4lbqj1227714922.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/5fs6q1227714922.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 -22266.0132 -22070.9506 -21728.9055 -20560.8459 -17222.9402 -13510.2265 7 8 9 10 11 12 -11752.5885 -7163.7922 -7016.4634 -4390.3330 -409.7721 -8978.4761 13 14 15 16 17 18 -8877.4485 -7451.2226 6407.0000 5970.0696 10695.4720 11202.3189 19 20 21 22 23 24 13489.5915 14856.8759 13515.5871 16150.9857 19118.5131 12349.4424 25 26 27 28 29 30 7985.0600 6228.1504 4873.0122 5128.0272 10143.3505 15729.4978 31 32 33 34 35 36 14811.7121 14272.9894 13224.0763 15670.0269 17508.4075 13854.3087 37 38 39 40 41 42 12727.2191 6067.2441 2526.9729 1097.0436 3734.0433 2901.4816 43 44 45 46 47 48 1384.6535 -88.4246 -1162.2316 -1414.3135 -1599.3382 526.5202 49 50 51 52 53 54 1010.7966 -9100.6418 -10602.4986 -11070.6850 -9723.5382 -8357.1622 55 56 57 58 59 60 -10679.9988 -10856.3437 -11930.3168 -11975.7430 -8527.4444 -7489.4978 61 -7182.2932 > postscript(file="/var/www/html/rcomp/tmp/68ub31227714922.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 -22266.0132 NA 1 -22070.9506 -22266.0132 2 -21728.9055 -22070.9506 3 -20560.8459 -21728.9055 4 -17222.9402 -20560.8459 5 -13510.2265 -17222.9402 6 -11752.5885 -13510.2265 7 -7163.7922 -11752.5885 8 -7016.4634 -7163.7922 9 -4390.3330 -7016.4634 10 -409.7721 -4390.3330 11 -8978.4761 -409.7721 12 -8877.4485 -8978.4761 13 -7451.2226 -8877.4485 14 6407.0000 -7451.2226 15 5970.0696 6407.0000 16 10695.4720 5970.0696 17 11202.3189 10695.4720 18 13489.5915 11202.3189 19 14856.8759 13489.5915 20 13515.5871 14856.8759 21 16150.9857 13515.5871 22 19118.5131 16150.9857 23 12349.4424 19118.5131 24 7985.0600 12349.4424 25 6228.1504 7985.0600 26 4873.0122 6228.1504 27 5128.0272 4873.0122 28 10143.3505 5128.0272 29 15729.4978 10143.3505 30 14811.7121 15729.4978 31 14272.9894 14811.7121 32 13224.0763 14272.9894 33 15670.0269 13224.0763 34 17508.4075 15670.0269 35 13854.3087 17508.4075 36 12727.2191 13854.3087 37 6067.2441 12727.2191 38 2526.9729 6067.2441 39 1097.0436 2526.9729 40 3734.0433 1097.0436 41 2901.4816 3734.0433 42 1384.6535 2901.4816 43 -88.4246 1384.6535 44 -1162.2316 -88.4246 45 -1414.3135 -1162.2316 46 -1599.3382 -1414.3135 47 526.5202 -1599.3382 48 1010.7966 526.5202 49 -9100.6418 1010.7966 50 -10602.4986 -9100.6418 51 -11070.6850 -10602.4986 52 -9723.5382 -11070.6850 53 -8357.1622 -9723.5382 54 -10679.9988 -8357.1622 55 -10856.3437 -10679.9988 56 -11930.3168 -10856.3437 57 -11975.7430 -11930.3168 58 -8527.4444 -11975.7430 59 -7489.4978 -8527.4444 60 -7182.2932 -7489.4978 61 NA -7182.2932 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -22070.9506 -22266.0132 [2,] -21728.9055 -22070.9506 [3,] -20560.8459 -21728.9055 [4,] -17222.9402 -20560.8459 [5,] -13510.2265 -17222.9402 [6,] -11752.5885 -13510.2265 [7,] -7163.7922 -11752.5885 [8,] -7016.4634 -7163.7922 [9,] -4390.3330 -7016.4634 [10,] -409.7721 -4390.3330 [11,] -8978.4761 -409.7721 [12,] -8877.4485 -8978.4761 [13,] -7451.2226 -8877.4485 [14,] 6407.0000 -7451.2226 [15,] 5970.0696 6407.0000 [16,] 10695.4720 5970.0696 [17,] 11202.3189 10695.4720 [18,] 13489.5915 11202.3189 [19,] 14856.8759 13489.5915 [20,] 13515.5871 14856.8759 [21,] 16150.9857 13515.5871 [22,] 19118.5131 16150.9857 [23,] 12349.4424 19118.5131 [24,] 7985.0600 12349.4424 [25,] 6228.1504 7985.0600 [26,] 4873.0122 6228.1504 [27,] 5128.0272 4873.0122 [28,] 10143.3505 5128.0272 [29,] 15729.4978 10143.3505 [30,] 14811.7121 15729.4978 [31,] 14272.9894 14811.7121 [32,] 13224.0763 14272.9894 [33,] 15670.0269 13224.0763 [34,] 17508.4075 15670.0269 [35,] 13854.3087 17508.4075 [36,] 12727.2191 13854.3087 [37,] 6067.2441 12727.2191 [38,] 2526.9729 6067.2441 [39,] 1097.0436 2526.9729 [40,] 3734.0433 1097.0436 [41,] 2901.4816 3734.0433 [42,] 1384.6535 2901.4816 [43,] -88.4246 1384.6535 [44,] -1162.2316 -88.4246 [45,] -1414.3135 -1162.2316 [46,] -1599.3382 -1414.3135 [47,] 526.5202 -1599.3382 [48,] 1010.7966 526.5202 [49,] -9100.6418 1010.7966 [50,] -10602.4986 -9100.6418 [51,] -11070.6850 -10602.4986 [52,] -9723.5382 -11070.6850 [53,] -8357.1622 -9723.5382 [54,] -10679.9988 -8357.1622 [55,] -10856.3437 -10679.9988 [56,] -11930.3168 -10856.3437 [57,] -11975.7430 -11930.3168 [58,] -8527.4444 -11975.7430 [59,] -7489.4978 -8527.4444 [60,] -7182.2932 -7489.4978 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -22070.9506 -22266.0132 2 -21728.9055 -22070.9506 3 -20560.8459 -21728.9055 4 -17222.9402 -20560.8459 5 -13510.2265 -17222.9402 6 -11752.5885 -13510.2265 7 -7163.7922 -11752.5885 8 -7016.4634 -7163.7922 9 -4390.3330 -7016.4634 10 -409.7721 -4390.3330 11 -8978.4761 -409.7721 12 -8877.4485 -8978.4761 13 -7451.2226 -8877.4485 14 6407.0000 -7451.2226 15 5970.0696 6407.0000 16 10695.4720 5970.0696 17 11202.3189 10695.4720 18 13489.5915 11202.3189 19 14856.8759 13489.5915 20 13515.5871 14856.8759 21 16150.9857 13515.5871 22 19118.5131 16150.9857 23 12349.4424 19118.5131 24 7985.0600 12349.4424 25 6228.1504 7985.0600 26 4873.0122 6228.1504 27 5128.0272 4873.0122 28 10143.3505 5128.0272 29 15729.4978 10143.3505 30 14811.7121 15729.4978 31 14272.9894 14811.7121 32 13224.0763 14272.9894 33 15670.0269 13224.0763 34 17508.4075 15670.0269 35 13854.3087 17508.4075 36 12727.2191 13854.3087 37 6067.2441 12727.2191 38 2526.9729 6067.2441 39 1097.0436 2526.9729 40 3734.0433 1097.0436 41 2901.4816 3734.0433 42 1384.6535 2901.4816 43 -88.4246 1384.6535 44 -1162.2316 -88.4246 45 -1414.3135 -1162.2316 46 -1599.3382 -1414.3135 47 526.5202 -1599.3382 48 1010.7966 526.5202 49 -9100.6418 1010.7966 50 -10602.4986 -9100.6418 51 -11070.6850 -10602.4986 52 -9723.5382 -11070.6850 53 -8357.1622 -9723.5382 54 -10679.9988 -8357.1622 55 -10856.3437 -10679.9988 56 -11930.3168 -10856.3437 57 -11975.7430 -11930.3168 58 -8527.4444 -11975.7430 59 -7489.4978 -8527.4444 60 -7182.2932 -7489.4978 > 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/71yhk1227714922.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/8a9ao1227714922.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/988l91227714922.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/10dqg81227714922.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/11ixt61227714923.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/12ns761227714923.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/1358pb1227714923.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/1440xv1227714923.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/154aln1227714923.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/16z2011227714923.tab") + } > > system("convert tmp/1ulpv1227714922.ps tmp/1ulpv1227714922.png") > system("convert tmp/2ryi71227714922.ps tmp/2ryi71227714922.png") > system("convert tmp/3xq9m1227714922.ps tmp/3xq9m1227714922.png") > system("convert tmp/4lbqj1227714922.ps tmp/4lbqj1227714922.png") > system("convert tmp/5fs6q1227714922.ps tmp/5fs6q1227714922.png") > system("convert tmp/68ub31227714922.ps tmp/68ub31227714922.png") > system("convert tmp/71yhk1227714922.ps tmp/71yhk1227714922.png") > system("convert tmp/8a9ao1227714922.ps tmp/8a9ao1227714922.png") > system("convert tmp/988l91227714922.ps tmp/988l91227714922.png") > system("convert tmp/10dqg81227714922.ps tmp/10dqg81227714922.png") > > > proc.time() user system elapsed 2.467 1.566 4.859