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(8.2,1.4,8.0,1.2,7.5,1.0,6.8,1.7,6.5,2.4,6.6,2.0,7.6,2.1,8.0,2.0,8.1,1.8,7.7,2.7,7.5,2.3,7.6,1.9,7.8,2.0,7.8,2.3,7.8,2.8,7.5,2.4,7.5,2.3,7.1,2.7,7.5,2.7,7.5,2.9,7.6,3.0,7.7,2.2,7.7,2.3,7.9,2.8,8.1,2.8,8.2,2.8,8.2,2.2,8.2,2.6,7.9,2.8,7.3,2.5,6.9,2.4,6.6,2.3,6.7,1.9,6.9,1.7,7.0,2.0,7.1,2.1,7.2,1.7,7.1,1.8,6.9,1.8,7.0,1.8,6.8,1.3,6.4,1.3,6.7,1.3,6.6,1.2,6.4,1.4,6.3,2.2,6.2,2.9,6.5,3.1,6.8,3.5,6.8,3.6,6.4,4.4,6.1,4.1,5.8,5.1,6.1,5.8,7.2,5.9,7.3,5.4,6.9,5.5,6.1,4.8,5.8,3.2,6.2,2.7,7.1,2.1,7.7,1.9,7.9,0.6,7.7,0.7),dim=c(2,64),dimnames=list(c('Y','X'),1:64)) > y <- array(NA,dim=c(2,64),dimnames=list(c('Y','X'),1:64)) > 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 Y X 1 8.2 1.4 2 8.0 1.2 3 7.5 1.0 4 6.8 1.7 5 6.5 2.4 6 6.6 2.0 7 7.6 2.1 8 8.0 2.0 9 8.1 1.8 10 7.7 2.7 11 7.5 2.3 12 7.6 1.9 13 7.8 2.0 14 7.8 2.3 15 7.8 2.8 16 7.5 2.4 17 7.5 2.3 18 7.1 2.7 19 7.5 2.7 20 7.5 2.9 21 7.6 3.0 22 7.7 2.2 23 7.7 2.3 24 7.9 2.8 25 8.1 2.8 26 8.2 2.8 27 8.2 2.2 28 8.2 2.6 29 7.9 2.8 30 7.3 2.5 31 6.9 2.4 32 6.6 2.3 33 6.7 1.9 34 6.9 1.7 35 7.0 2.0 36 7.1 2.1 37 7.2 1.7 38 7.1 1.8 39 6.9 1.8 40 7.0 1.8 41 6.8 1.3 42 6.4 1.3 43 6.7 1.3 44 6.6 1.2 45 6.4 1.4 46 6.3 2.2 47 6.2 2.9 48 6.5 3.1 49 6.8 3.5 50 6.8 3.6 51 6.4 4.4 52 6.1 4.1 53 5.8 5.1 54 6.1 5.8 55 7.2 5.9 56 7.3 5.4 57 6.9 5.5 58 6.1 4.8 59 5.8 3.2 60 6.2 2.7 61 7.1 2.1 62 7.7 1.9 63 7.9 0.6 64 7.7 0.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 7.637 -0.186 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.24152 -0.56592 0.00736 0.52478 1.08408 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.63677 0.18691 40.857 < 2e-16 *** X -0.18602 0.06694 -2.779 0.00721 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6294 on 62 degrees of freedom Multiple R-squared: 0.1108, Adjusted R-squared: 0.09641 F-statistic: 7.722 on 1 and 62 DF, p-value: 0.00721 > 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.46893820 0.93787640 0.5310618 [2,] 0.33924379 0.67848758 0.6607562 [3,] 0.42065431 0.84130862 0.5793457 [4,] 0.54222109 0.91555781 0.4577789 [5,] 0.57287761 0.85424479 0.4271224 [6,] 0.58584900 0.82830199 0.4141510 [7,] 0.48895681 0.97791361 0.5110432 [8,] 0.39393746 0.78787492 0.6060625 [9,] 0.33525611 0.67051223 0.6647439 [10,] 0.29510193 0.59020386 0.7048981 [11,] 0.27233063 0.54466125 0.7276694 [12,] 0.20681036 0.41362072 0.7931896 [13,] 0.15274846 0.30549691 0.8472515 [14,] 0.11669769 0.23339537 0.8833023 [15,] 0.08433046 0.16866092 0.9156695 [16,] 0.06066213 0.12132425 0.9393379 [17,] 0.04634909 0.09269819 0.9536509 [18,] 0.03446404 0.06892809 0.9655360 [19,] 0.02593985 0.05187970 0.9740601 [20,] 0.02820857 0.05641714 0.9717914 [21,] 0.04512926 0.09025853 0.9548707 [22,] 0.08727144 0.17454287 0.9127286 [23,] 0.15342540 0.30685079 0.8465746 [24,] 0.28699225 0.57398449 0.7130078 [25,] 0.37667834 0.75335669 0.6233217 [26,] 0.36499606 0.72999212 0.6350039 [27,] 0.38845988 0.77691976 0.6115401 [28,] 0.47986510 0.95973020 0.5201349 [29,] 0.51513267 0.96973465 0.4848673 [30,] 0.49033173 0.98066345 0.5096683 [31,] 0.45266290 0.90532580 0.5473371 [32,] 0.41057461 0.82114922 0.5894254 [33,] 0.36288514 0.72577027 0.6371149 [34,] 0.31729357 0.63458714 0.6827064 [35,] 0.28028803 0.56057607 0.7197120 [36,] 0.23819273 0.47638546 0.7618073 [37,] 0.20007203 0.40014406 0.7999280 [38,] 0.21889130 0.43778260 0.7811087 [39,] 0.18330022 0.36660043 0.8166998 [40,] 0.16029961 0.32059923 0.8397004 [41,] 0.17587214 0.35174429 0.8241279 [42,] 0.24049619 0.48099238 0.7595038 [43,] 0.36144107 0.72288214 0.6385589 [44,] 0.37196844 0.74393687 0.6280316 [45,] 0.32358455 0.64716911 0.6764154 [46,] 0.26919678 0.53839356 0.7308032 [47,] 0.24293982 0.48587965 0.7570602 [48,] 0.26065106 0.52130212 0.7393489 [49,] 0.30974664 0.61949328 0.6902534 [50,] 0.26192680 0.52385361 0.7380732 [51,] 0.26288398 0.52576795 0.7371160 [52,] 0.36608078 0.73216155 0.6339192 [53,] 0.65714780 0.68570440 0.3428522 [54,] 0.78094521 0.43810958 0.2190548 [55,] 0.71794415 0.56411171 0.2820559 > postscript(file="/var/www/html/rcomp/tmp/1ojds1258657857.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/2aey11258657857.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/3kji61258657857.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/4ph2o1258657857.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/5xc4a1258657857.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 = 64 Frequency = 1 1 2 3 4 5 6 0.82365280 0.58644943 0.04924606 -0.52054215 -0.69033036 -0.66473710 7 8 9 10 11 12 0.35386459 0.73526290 0.79805953 0.56547469 0.29106795 0.31666122 13 14 15 16 17 18 0.53526290 0.59106795 0.68407637 0.30966964 0.29106795 -0.03452531 19 20 21 22 23 24 0.36547469 0.40267806 0.52127974 0.47246627 0.49106795 0.78407637 25 26 27 28 29 30 0.98407637 1.08407637 0.97246627 1.04687301 0.78407637 0.12827132 31 32 33 34 35 36 -0.29033036 -0.60893205 -0.58333878 -0.42054215 -0.26473710 -0.14613541 37 38 39 40 41 42 -0.12054215 -0.20194047 -0.40194047 -0.30194047 -0.59494889 -0.99494889 43 44 45 46 47 48 -0.69494889 -0.81355057 -0.97634720 -0.92753373 -0.89732194 -0.56011857 49 50 51 52 53 54 -0.18571184 -0.16711015 -0.41829668 -0.77410173 -0.88808489 -0.45787310 55 56 57 58 59 60 0.66072858 0.66772016 0.28632184 -0.64388994 -1.24151689 -0.93452531 61 62 63 64 -0.14613541 0.41666122 0.37483933 0.19344101 > postscript(file="/var/www/html/rcomp/tmp/63o2d1258657857.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 = 64 Frequency = 1 lag(myerror, k = 1) myerror 0 0.82365280 NA 1 0.58644943 0.82365280 2 0.04924606 0.58644943 3 -0.52054215 0.04924606 4 -0.69033036 -0.52054215 5 -0.66473710 -0.69033036 6 0.35386459 -0.66473710 7 0.73526290 0.35386459 8 0.79805953 0.73526290 9 0.56547469 0.79805953 10 0.29106795 0.56547469 11 0.31666122 0.29106795 12 0.53526290 0.31666122 13 0.59106795 0.53526290 14 0.68407637 0.59106795 15 0.30966964 0.68407637 16 0.29106795 0.30966964 17 -0.03452531 0.29106795 18 0.36547469 -0.03452531 19 0.40267806 0.36547469 20 0.52127974 0.40267806 21 0.47246627 0.52127974 22 0.49106795 0.47246627 23 0.78407637 0.49106795 24 0.98407637 0.78407637 25 1.08407637 0.98407637 26 0.97246627 1.08407637 27 1.04687301 0.97246627 28 0.78407637 1.04687301 29 0.12827132 0.78407637 30 -0.29033036 0.12827132 31 -0.60893205 -0.29033036 32 -0.58333878 -0.60893205 33 -0.42054215 -0.58333878 34 -0.26473710 -0.42054215 35 -0.14613541 -0.26473710 36 -0.12054215 -0.14613541 37 -0.20194047 -0.12054215 38 -0.40194047 -0.20194047 39 -0.30194047 -0.40194047 40 -0.59494889 -0.30194047 41 -0.99494889 -0.59494889 42 -0.69494889 -0.99494889 43 -0.81355057 -0.69494889 44 -0.97634720 -0.81355057 45 -0.92753373 -0.97634720 46 -0.89732194 -0.92753373 47 -0.56011857 -0.89732194 48 -0.18571184 -0.56011857 49 -0.16711015 -0.18571184 50 -0.41829668 -0.16711015 51 -0.77410173 -0.41829668 52 -0.88808489 -0.77410173 53 -0.45787310 -0.88808489 54 0.66072858 -0.45787310 55 0.66772016 0.66072858 56 0.28632184 0.66772016 57 -0.64388994 0.28632184 58 -1.24151689 -0.64388994 59 -0.93452531 -1.24151689 60 -0.14613541 -0.93452531 61 0.41666122 -0.14613541 62 0.37483933 0.41666122 63 0.19344101 0.37483933 64 NA 0.19344101 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.58644943 0.82365280 [2,] 0.04924606 0.58644943 [3,] -0.52054215 0.04924606 [4,] -0.69033036 -0.52054215 [5,] -0.66473710 -0.69033036 [6,] 0.35386459 -0.66473710 [7,] 0.73526290 0.35386459 [8,] 0.79805953 0.73526290 [9,] 0.56547469 0.79805953 [10,] 0.29106795 0.56547469 [11,] 0.31666122 0.29106795 [12,] 0.53526290 0.31666122 [13,] 0.59106795 0.53526290 [14,] 0.68407637 0.59106795 [15,] 0.30966964 0.68407637 [16,] 0.29106795 0.30966964 [17,] -0.03452531 0.29106795 [18,] 0.36547469 -0.03452531 [19,] 0.40267806 0.36547469 [20,] 0.52127974 0.40267806 [21,] 0.47246627 0.52127974 [22,] 0.49106795 0.47246627 [23,] 0.78407637 0.49106795 [24,] 0.98407637 0.78407637 [25,] 1.08407637 0.98407637 [26,] 0.97246627 1.08407637 [27,] 1.04687301 0.97246627 [28,] 0.78407637 1.04687301 [29,] 0.12827132 0.78407637 [30,] -0.29033036 0.12827132 [31,] -0.60893205 -0.29033036 [32,] -0.58333878 -0.60893205 [33,] -0.42054215 -0.58333878 [34,] -0.26473710 -0.42054215 [35,] -0.14613541 -0.26473710 [36,] -0.12054215 -0.14613541 [37,] -0.20194047 -0.12054215 [38,] -0.40194047 -0.20194047 [39,] -0.30194047 -0.40194047 [40,] -0.59494889 -0.30194047 [41,] -0.99494889 -0.59494889 [42,] -0.69494889 -0.99494889 [43,] -0.81355057 -0.69494889 [44,] -0.97634720 -0.81355057 [45,] -0.92753373 -0.97634720 [46,] -0.89732194 -0.92753373 [47,] -0.56011857 -0.89732194 [48,] -0.18571184 -0.56011857 [49,] -0.16711015 -0.18571184 [50,] -0.41829668 -0.16711015 [51,] -0.77410173 -0.41829668 [52,] -0.88808489 -0.77410173 [53,] -0.45787310 -0.88808489 [54,] 0.66072858 -0.45787310 [55,] 0.66772016 0.66072858 [56,] 0.28632184 0.66772016 [57,] -0.64388994 0.28632184 [58,] -1.24151689 -0.64388994 [59,] -0.93452531 -1.24151689 [60,] -0.14613541 -0.93452531 [61,] 0.41666122 -0.14613541 [62,] 0.37483933 0.41666122 [63,] 0.19344101 0.37483933 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.58644943 0.82365280 2 0.04924606 0.58644943 3 -0.52054215 0.04924606 4 -0.69033036 -0.52054215 5 -0.66473710 -0.69033036 6 0.35386459 -0.66473710 7 0.73526290 0.35386459 8 0.79805953 0.73526290 9 0.56547469 0.79805953 10 0.29106795 0.56547469 11 0.31666122 0.29106795 12 0.53526290 0.31666122 13 0.59106795 0.53526290 14 0.68407637 0.59106795 15 0.30966964 0.68407637 16 0.29106795 0.30966964 17 -0.03452531 0.29106795 18 0.36547469 -0.03452531 19 0.40267806 0.36547469 20 0.52127974 0.40267806 21 0.47246627 0.52127974 22 0.49106795 0.47246627 23 0.78407637 0.49106795 24 0.98407637 0.78407637 25 1.08407637 0.98407637 26 0.97246627 1.08407637 27 1.04687301 0.97246627 28 0.78407637 1.04687301 29 0.12827132 0.78407637 30 -0.29033036 0.12827132 31 -0.60893205 -0.29033036 32 -0.58333878 -0.60893205 33 -0.42054215 -0.58333878 34 -0.26473710 -0.42054215 35 -0.14613541 -0.26473710 36 -0.12054215 -0.14613541 37 -0.20194047 -0.12054215 38 -0.40194047 -0.20194047 39 -0.30194047 -0.40194047 40 -0.59494889 -0.30194047 41 -0.99494889 -0.59494889 42 -0.69494889 -0.99494889 43 -0.81355057 -0.69494889 44 -0.97634720 -0.81355057 45 -0.92753373 -0.97634720 46 -0.89732194 -0.92753373 47 -0.56011857 -0.89732194 48 -0.18571184 -0.56011857 49 -0.16711015 -0.18571184 50 -0.41829668 -0.16711015 51 -0.77410173 -0.41829668 52 -0.88808489 -0.77410173 53 -0.45787310 -0.88808489 54 0.66072858 -0.45787310 55 0.66772016 0.66072858 56 0.28632184 0.66772016 57 -0.64388994 0.28632184 58 -1.24151689 -0.64388994 59 -0.93452531 -1.24151689 60 -0.14613541 -0.93452531 61 0.41666122 -0.14613541 62 0.37483933 0.41666122 63 0.19344101 0.37483933 > 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/7bwcj1258657857.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/8x1dv1258657857.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/9sm821258657857.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/10iugg1258657857.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/111p4h1258657857.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/12lb441258657857.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/1310bi1258657858.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/14oxmo1258657858.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/15hul81258657858.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/16b5a31258657858.tab") + } > > system("convert tmp/1ojds1258657857.ps tmp/1ojds1258657857.png") > system("convert tmp/2aey11258657857.ps tmp/2aey11258657857.png") > system("convert tmp/3kji61258657857.ps tmp/3kji61258657857.png") > system("convert tmp/4ph2o1258657857.ps tmp/4ph2o1258657857.png") > system("convert tmp/5xc4a1258657857.ps tmp/5xc4a1258657857.png") > system("convert tmp/63o2d1258657857.ps tmp/63o2d1258657857.png") > system("convert tmp/7bwcj1258657857.ps tmp/7bwcj1258657857.png") > system("convert tmp/8x1dv1258657857.ps tmp/8x1dv1258657857.png") > system("convert tmp/9sm821258657857.ps tmp/9sm821258657857.png") > system("convert tmp/10iugg1258657857.ps tmp/10iugg1258657857.png") > > > proc.time() user system elapsed 2.547 1.609 3.022