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(2120.88,0,2174.56,0,2196.72,0,2350.44,0,2440.25,0,2408.64,0,2472.81,0,2407.6,0,2454.62,0,2448.05,0,2497.84,0,2645.64,0,2756.76,0,2849.27,0,2921.44,0,2981.85,0,3080.58,0,3106.22,0,3119.31,0,3061.26,0,3097.31,0,3161.69,0,3257.16,0,3277.01,0,3295.32,0,3363.99,0,3494.17,0,3667.03,0,3813.06,0,3917.96,0,3895.51,0,3801.06,0,3570.12,0,3701.61,0,3862.27,0,3970.1,0,4138.52,0,4199.75,0,4290.89,0,4443.91,0,4502.64,1,4356.98,1,4591.27,1,4696.96,1,4621.4,1,4562.84,1,4202.52,1,4296.49,1,4435.23,1,4105.18,1,4116.68,1,3844.49,1,3720.98,1,3674.4,1,3857.62,1,3801.06,1,3504.37,1,3032.6,1,3047.03,1,2962.34,1,2197.82,1),dim=c(2,61),dimnames=list(c('Bel20','dummy'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Bel20','dummy'),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 = '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 Bel20 dummy t 1 2120.88 0 1 2 2174.56 0 2 3 2196.72 0 3 4 2350.44 0 4 5 2440.25 0 5 6 2408.64 0 6 7 2472.81 0 7 8 2407.60 0 8 9 2454.62 0 9 10 2448.05 0 10 11 2497.84 0 11 12 2645.64 0 12 13 2756.76 0 13 14 2849.27 0 14 15 2921.44 0 15 16 2981.85 0 16 17 3080.58 0 17 18 3106.22 0 18 19 3119.31 0 19 20 3061.26 0 20 21 3097.31 0 21 22 3161.69 0 22 23 3257.16 0 23 24 3277.01 0 24 25 3295.32 0 25 26 3363.99 0 26 27 3494.17 0 27 28 3667.03 0 28 29 3813.06 0 29 30 3917.96 0 30 31 3895.51 0 31 32 3801.06 0 32 33 3570.12 0 33 34 3701.61 0 34 35 3862.27 0 35 36 3970.10 0 36 37 4138.52 0 37 38 4199.75 0 38 39 4290.89 0 39 40 4443.91 0 40 41 4502.64 1 41 42 4356.98 1 42 43 4591.27 1 43 44 4696.96 1 44 45 4621.40 1 45 46 4562.84 1 46 47 4202.52 1 47 48 4296.49 1 48 49 4435.23 1 49 50 4105.18 1 50 51 4116.68 1 51 52 3844.49 1 52 53 3720.98 1 53 54 3674.40 1 54 55 3857.62 1 55 56 3801.06 1 56 57 3504.37 1 57 58 3032.60 1 58 59 3047.03 1 59 60 2962.34 1 60 61 2197.82 1 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) dummy t 2428.57 -356.71 36.06 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2073.79 -236.30 -23.70 338.71 1038.39 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2428.572 169.076 14.364 < 2e-16 *** dummy -356.705 261.801 -1.363 0.178 t 36.061 7.065 5.104 3.85e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 551.8 on 58 degrees of freedom Multiple R-squared: 0.4681, Adjusted R-squared: 0.4497 F-statistic: 25.52 on 2 and 58 DF, p-value: 1.122e-08 > 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,] 1.233050e-03 2.466100e-03 0.9987669 [2,] 1.253330e-04 2.506659e-04 0.9998747 [3,] 8.153314e-05 1.630663e-04 0.9999185 [4,] 1.654927e-05 3.309854e-05 0.9999835 [5,] 4.414015e-06 8.828029e-06 0.9999956 [6,] 7.402823e-07 1.480565e-06 0.9999993 [7,] 1.404170e-07 2.808340e-07 0.9999999 [8,] 5.569476e-08 1.113895e-07 0.9999999 [9,] 2.808437e-08 5.616874e-08 1.0000000 [10,] 1.181256e-08 2.362512e-08 1.0000000 [11,] 3.897874e-09 7.795748e-09 1.0000000 [12,] 1.715903e-09 3.431805e-09 1.0000000 [13,] 4.330664e-10 8.661327e-10 1.0000000 [14,] 8.835842e-11 1.767168e-10 1.0000000 [15,] 3.869265e-11 7.738529e-11 1.0000000 [16,] 1.973041e-11 3.946082e-11 1.0000000 [17,] 8.678065e-12 1.735613e-11 1.0000000 [18,] 3.095607e-12 6.191213e-12 1.0000000 [19,] 1.577623e-12 3.155246e-12 1.0000000 [20,] 1.384869e-12 2.769739e-12 1.0000000 [21,] 1.291875e-12 2.583750e-12 1.0000000 [22,] 1.247227e-12 2.494454e-12 1.0000000 [23,] 4.438515e-12 8.877031e-12 1.0000000 [24,] 4.643529e-11 9.287059e-11 1.0000000 [25,] 3.558567e-10 7.117133e-10 1.0000000 [26,] 4.158186e-10 8.316373e-10 1.0000000 [27,] 3.425128e-10 6.850257e-10 1.0000000 [28,] 3.749804e-08 7.499608e-08 1.0000000 [29,] 4.178364e-07 8.356728e-07 0.9999996 [30,] 1.090375e-06 2.180751e-06 0.9999989 [31,] 1.837574e-06 3.675148e-06 0.9999982 [32,] 1.964843e-06 3.929686e-06 0.9999980 [33,] 1.648335e-06 3.296670e-06 0.9999984 [34,] 1.245096e-06 2.490192e-06 0.9999988 [35,] 1.439644e-06 2.879287e-06 0.9999986 [36,] 2.627054e-06 5.254109e-06 0.9999974 [37,] 4.171749e-05 8.343498e-05 0.9999583 [38,] 5.897933e-05 1.179587e-04 0.9999410 [39,] 3.737826e-05 7.475653e-05 0.9999626 [40,] 1.964837e-05 3.929675e-05 0.9999804 [41,] 1.325966e-05 2.651931e-05 0.9999867 [42,] 1.494090e-03 2.988180e-03 0.9985059 [43,] 5.501290e-03 1.100258e-02 0.9944987 [44,] 4.722443e-03 9.444887e-03 0.9952776 [45,] 2.368029e-02 4.736058e-02 0.9763197 [46,] 4.125649e-02 8.251297e-02 0.9587435 [47,] 1.455172e-01 2.910345e-01 0.8544828 [48,] 3.790996e-01 7.581992e-01 0.6209004 [49,] 6.834750e-01 6.330499e-01 0.3165250 [50,] 6.097893e-01 7.804214e-01 0.3902107 > postscript(file="/var/www/html/freestat/rcomp/tmp/1c9uh1227826115.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/freestat/rcomp/tmp/2jcnl1227826115.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/freestat/rcomp/tmp/3lhdt1227826115.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/freestat/rcomp/tmp/4ze0q1227826115.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/freestat/rcomp/tmp/5hjxl1227826115.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 -343.7533828 -326.1347221 -340.0360615 -222.3774008 -168.6287402 6 7 8 9 10 -236.3000795 -208.1914189 -309.4627582 -298.5040975 -341.1354369 11 12 13 14 15 -327.4067762 -215.6681156 -140.6094549 -84.1607943 -48.0521336 16 17 18 19 20 -23.7034730 38.9651877 28.5438484 5.5725090 -88.5388303 21 22 23 24 25 -88.5501697 -60.2315090 -0.8228484 -17.0341877 -34.7855270 26 27 28 29 30 -2.1768664 91.9417943 228.7404549 338.7091156 407.5477762 31 32 33 34 35 349.0364369 218.5250975 -48.4762418 46.9524189 171.5510795 36 37 38 39 40 243.3197402 375.6784008 400.8470615 455.9257221 572.8843828 41 42 43 44 45 952.2581553 770.5368160 968.7654767 1038.3941373 926.7727980 46 47 48 49 50 832.1514586 435.7701193 493.6787799 596.3574406 230.2461012 51 52 53 54 55 205.6847619 -102.5665774 -262.1379168 -344.7792561 -197.6205955 56 57 58 59 60 -290.2419348 -622.9932742 -1130.8246135 -1152.4559528 -1273.2072922 61 -2073.7886315 > postscript(file="/var/www/html/freestat/rcomp/tmp/6wojb1227826115.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 -343.7533828 NA 1 -326.1347221 -343.7533828 2 -340.0360615 -326.1347221 3 -222.3774008 -340.0360615 4 -168.6287402 -222.3774008 5 -236.3000795 -168.6287402 6 -208.1914189 -236.3000795 7 -309.4627582 -208.1914189 8 -298.5040975 -309.4627582 9 -341.1354369 -298.5040975 10 -327.4067762 -341.1354369 11 -215.6681156 -327.4067762 12 -140.6094549 -215.6681156 13 -84.1607943 -140.6094549 14 -48.0521336 -84.1607943 15 -23.7034730 -48.0521336 16 38.9651877 -23.7034730 17 28.5438484 38.9651877 18 5.5725090 28.5438484 19 -88.5388303 5.5725090 20 -88.5501697 -88.5388303 21 -60.2315090 -88.5501697 22 -0.8228484 -60.2315090 23 -17.0341877 -0.8228484 24 -34.7855270 -17.0341877 25 -2.1768664 -34.7855270 26 91.9417943 -2.1768664 27 228.7404549 91.9417943 28 338.7091156 228.7404549 29 407.5477762 338.7091156 30 349.0364369 407.5477762 31 218.5250975 349.0364369 32 -48.4762418 218.5250975 33 46.9524189 -48.4762418 34 171.5510795 46.9524189 35 243.3197402 171.5510795 36 375.6784008 243.3197402 37 400.8470615 375.6784008 38 455.9257221 400.8470615 39 572.8843828 455.9257221 40 952.2581553 572.8843828 41 770.5368160 952.2581553 42 968.7654767 770.5368160 43 1038.3941373 968.7654767 44 926.7727980 1038.3941373 45 832.1514586 926.7727980 46 435.7701193 832.1514586 47 493.6787799 435.7701193 48 596.3574406 493.6787799 49 230.2461012 596.3574406 50 205.6847619 230.2461012 51 -102.5665774 205.6847619 52 -262.1379168 -102.5665774 53 -344.7792561 -262.1379168 54 -197.6205955 -344.7792561 55 -290.2419348 -197.6205955 56 -622.9932742 -290.2419348 57 -1130.8246135 -622.9932742 58 -1152.4559528 -1130.8246135 59 -1273.2072922 -1152.4559528 60 -2073.7886315 -1273.2072922 61 NA -2073.7886315 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -326.1347221 -343.7533828 [2,] -340.0360615 -326.1347221 [3,] -222.3774008 -340.0360615 [4,] -168.6287402 -222.3774008 [5,] -236.3000795 -168.6287402 [6,] -208.1914189 -236.3000795 [7,] -309.4627582 -208.1914189 [8,] -298.5040975 -309.4627582 [9,] -341.1354369 -298.5040975 [10,] -327.4067762 -341.1354369 [11,] -215.6681156 -327.4067762 [12,] -140.6094549 -215.6681156 [13,] -84.1607943 -140.6094549 [14,] -48.0521336 -84.1607943 [15,] -23.7034730 -48.0521336 [16,] 38.9651877 -23.7034730 [17,] 28.5438484 38.9651877 [18,] 5.5725090 28.5438484 [19,] -88.5388303 5.5725090 [20,] -88.5501697 -88.5388303 [21,] -60.2315090 -88.5501697 [22,] -0.8228484 -60.2315090 [23,] -17.0341877 -0.8228484 [24,] -34.7855270 -17.0341877 [25,] -2.1768664 -34.7855270 [26,] 91.9417943 -2.1768664 [27,] 228.7404549 91.9417943 [28,] 338.7091156 228.7404549 [29,] 407.5477762 338.7091156 [30,] 349.0364369 407.5477762 [31,] 218.5250975 349.0364369 [32,] -48.4762418 218.5250975 [33,] 46.9524189 -48.4762418 [34,] 171.5510795 46.9524189 [35,] 243.3197402 171.5510795 [36,] 375.6784008 243.3197402 [37,] 400.8470615 375.6784008 [38,] 455.9257221 400.8470615 [39,] 572.8843828 455.9257221 [40,] 952.2581553 572.8843828 [41,] 770.5368160 952.2581553 [42,] 968.7654767 770.5368160 [43,] 1038.3941373 968.7654767 [44,] 926.7727980 1038.3941373 [45,] 832.1514586 926.7727980 [46,] 435.7701193 832.1514586 [47,] 493.6787799 435.7701193 [48,] 596.3574406 493.6787799 [49,] 230.2461012 596.3574406 [50,] 205.6847619 230.2461012 [51,] -102.5665774 205.6847619 [52,] -262.1379168 -102.5665774 [53,] -344.7792561 -262.1379168 [54,] -197.6205955 -344.7792561 [55,] -290.2419348 -197.6205955 [56,] -622.9932742 -290.2419348 [57,] -1130.8246135 -622.9932742 [58,] -1152.4559528 -1130.8246135 [59,] -1273.2072922 -1152.4559528 [60,] -2073.7886315 -1273.2072922 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -326.1347221 -343.7533828 2 -340.0360615 -326.1347221 3 -222.3774008 -340.0360615 4 -168.6287402 -222.3774008 5 -236.3000795 -168.6287402 6 -208.1914189 -236.3000795 7 -309.4627582 -208.1914189 8 -298.5040975 -309.4627582 9 -341.1354369 -298.5040975 10 -327.4067762 -341.1354369 11 -215.6681156 -327.4067762 12 -140.6094549 -215.6681156 13 -84.1607943 -140.6094549 14 -48.0521336 -84.1607943 15 -23.7034730 -48.0521336 16 38.9651877 -23.7034730 17 28.5438484 38.9651877 18 5.5725090 28.5438484 19 -88.5388303 5.5725090 20 -88.5501697 -88.5388303 21 -60.2315090 -88.5501697 22 -0.8228484 -60.2315090 23 -17.0341877 -0.8228484 24 -34.7855270 -17.0341877 25 -2.1768664 -34.7855270 26 91.9417943 -2.1768664 27 228.7404549 91.9417943 28 338.7091156 228.7404549 29 407.5477762 338.7091156 30 349.0364369 407.5477762 31 218.5250975 349.0364369 32 -48.4762418 218.5250975 33 46.9524189 -48.4762418 34 171.5510795 46.9524189 35 243.3197402 171.5510795 36 375.6784008 243.3197402 37 400.8470615 375.6784008 38 455.9257221 400.8470615 39 572.8843828 455.9257221 40 952.2581553 572.8843828 41 770.5368160 952.2581553 42 968.7654767 770.5368160 43 1038.3941373 968.7654767 44 926.7727980 1038.3941373 45 832.1514586 926.7727980 46 435.7701193 832.1514586 47 493.6787799 435.7701193 48 596.3574406 493.6787799 49 230.2461012 596.3574406 50 205.6847619 230.2461012 51 -102.5665774 205.6847619 52 -262.1379168 -102.5665774 53 -344.7792561 -262.1379168 54 -197.6205955 -344.7792561 55 -290.2419348 -197.6205955 56 -622.9932742 -290.2419348 57 -1130.8246135 -622.9932742 58 -1152.4559528 -1130.8246135 59 -1273.2072922 -1152.4559528 60 -2073.7886315 -1273.2072922 > 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/freestat/rcomp/tmp/7suhc1227826115.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/freestat/rcomp/tmp/8tpb21227826115.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/freestat/rcomp/tmp/96dbi1227826115.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/freestat/rcomp/tmp/10e5d31227826115.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11fqu21227826115.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/freestat/rcomp/tmp/12yope1227826115.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/freestat/rcomp/tmp/13w2pw1227826115.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/freestat/rcomp/tmp/14g4751227826115.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/freestat/rcomp/tmp/15msi21227826115.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/freestat/rcomp/tmp/16qu8v1227826115.tab") + } > > system("convert tmp/1c9uh1227826115.ps tmp/1c9uh1227826115.png") > system("convert tmp/2jcnl1227826115.ps tmp/2jcnl1227826115.png") > system("convert tmp/3lhdt1227826115.ps tmp/3lhdt1227826115.png") > system("convert tmp/4ze0q1227826115.ps tmp/4ze0q1227826115.png") > system("convert tmp/5hjxl1227826115.ps tmp/5hjxl1227826115.png") > system("convert tmp/6wojb1227826115.ps tmp/6wojb1227826115.png") > system("convert tmp/7suhc1227826115.ps tmp/7suhc1227826115.png") > system("convert tmp/8tpb21227826115.ps tmp/8tpb21227826115.png") > system("convert tmp/96dbi1227826115.ps tmp/96dbi1227826115.png") > system("convert tmp/10e5d31227826115.ps tmp/10e5d31227826115.png") > > > proc.time() user system elapsed 3.692 2.504 4.016