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.9,1.9,9,1.6,9,1.7,9,2,9,2.5,9,2.4,9,2.3,9,2.3,9,2.1,9,2.4,9,2.2,9.1,2.4,9,1.9,9,2.1,9.1,2.1,9,2.1,9,2,9,2.1,9,2.2,8.9,2.2,8.9,2.6,8.9,2.5,8.9,2.3,8.8,2.2,8.8,2.4,8.7,2.3,8.7,2.2,8.5,2.5,8.5,2.5,8.4,2.5,8.2,2.4,8.2,2.3,8.1,1.7,8.1,1.6,8,1.9,7.9,1.9,7.8,1.8,7.7,1.8,7.6,1.9,7.5,1.9,7.5,1.9,7.5,1.9,7.5,1.8,7.5,1.7,7.4,2.1,7.4,2.6,7.3,3.1,7.3,3.1,7.3,3.2,7.2,3.3,7.2,3.6,7.3,3.3,7.4,3.7,7.4,4,7.5,4,7.6,3.8,7.7,3.6,7.9,3.2,8,2.1,8.2,1.6),dim=c(2,60),dimnames=list(c('werkl','infl'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('werkl','infl'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x werkl infl 1 8.9 1.9 2 9.0 1.6 3 9.0 1.7 4 9.0 2.0 5 9.0 2.5 6 9.0 2.4 7 9.0 2.3 8 9.0 2.3 9 9.0 2.1 10 9.0 2.4 11 9.0 2.2 12 9.1 2.4 13 9.0 1.9 14 9.0 2.1 15 9.1 2.1 16 9.0 2.1 17 9.0 2.0 18 9.0 2.1 19 9.0 2.2 20 8.9 2.2 21 8.9 2.6 22 8.9 2.5 23 8.9 2.3 24 8.8 2.2 25 8.8 2.4 26 8.7 2.3 27 8.7 2.2 28 8.5 2.5 29 8.5 2.5 30 8.4 2.5 31 8.2 2.4 32 8.2 2.3 33 8.1 1.7 34 8.1 1.6 35 8.0 1.9 36 7.9 1.9 37 7.8 1.8 38 7.7 1.8 39 7.6 1.9 40 7.5 1.9 41 7.5 1.9 42 7.5 1.9 43 7.5 1.8 44 7.5 1.7 45 7.4 2.1 46 7.4 2.6 47 7.3 3.1 48 7.3 3.1 49 7.3 3.2 50 7.2 3.3 51 7.2 3.6 52 7.3 3.3 53 7.4 3.7 54 7.4 4.0 55 7.5 4.0 56 7.6 3.8 57 7.7 3.6 58 7.9 3.2 59 8.0 2.1 60 8.2 1.6 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) infl 9.4012 -0.4729 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.09721 -0.55533 0.09667 0.58791 0.83385 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 9.4012 0.3192 29.449 < 2e-16 *** infl -0.4729 0.1293 -3.657 0.000552 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6246 on 58 degrees of freedom Multiple R-squared: 0.1874, Adjusted R-squared: 0.1733 F-statistic: 13.37 on 1 and 58 DF, p-value: 0.0005519 > 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,] 7.578996e-04 1.515799e-03 0.9992421004 [2,] 5.481540e-05 1.096308e-04 0.9999451846 [3,] 3.659975e-06 7.319950e-06 0.9999963400 [4,] 2.302151e-07 4.604303e-07 0.9999997698 [5,] 1.403679e-08 2.807359e-08 0.9999999860 [6,] 8.235921e-10 1.647184e-09 0.9999999992 [7,] 4.732733e-11 9.465466e-11 1.0000000000 [8,] 1.009985e-10 2.019970e-10 0.9999999999 [9,] 7.982592e-12 1.596518e-11 1.0000000000 [10,] 6.303640e-13 1.260728e-12 1.0000000000 [11,] 9.227909e-13 1.845582e-12 1.0000000000 [12,] 9.737634e-14 1.947527e-13 1.0000000000 [13,] 1.043341e-14 2.086682e-14 1.0000000000 [14,] 1.247604e-15 2.495208e-15 1.0000000000 [15,] 1.753948e-16 3.507895e-16 1.0000000000 [16,] 5.117816e-16 1.023563e-15 1.0000000000 [17,] 1.225293e-15 2.450587e-15 1.0000000000 [18,] 1.546526e-15 3.093052e-15 1.0000000000 [19,] 2.031658e-15 4.063315e-15 1.0000000000 [20,] 6.928213e-14 1.385643e-13 1.0000000000 [21,] 8.401820e-13 1.680364e-12 1.0000000000 [22,] 9.646618e-11 1.929324e-10 0.9999999999 [23,] 4.449740e-09 8.899481e-09 0.9999999956 [24,] 1.518729e-06 3.037458e-06 0.9999984813 [25,] 7.355014e-05 1.471003e-04 0.9999264499 [26,] 2.672431e-03 5.344862e-03 0.9973275692 [27,] 6.162984e-02 1.232597e-01 0.9383701603 [28,] 3.083995e-01 6.167990e-01 0.6916004977 [29,] 7.240084e-01 5.519831e-01 0.2759915706 [30,] 8.830863e-01 2.338275e-01 0.1169137324 [31,] 9.523939e-01 9.521215e-02 0.0476060756 [32,] 9.782500e-01 4.349999e-02 0.0217499967 [33,] 9.869608e-01 2.607842e-02 0.0130392096 [34,] 9.905841e-01 1.883184e-02 0.0094159216 [35,] 9.930750e-01 1.385003e-02 0.0069250140 [36,] 9.948714e-01 1.025716e-02 0.0051285812 [37,] 9.953949e-01 9.210297e-03 0.0046051484 [38,] 9.952946e-01 9.410748e-03 0.0047053738 [39,] 9.946041e-01 1.079189e-02 0.0053959461 [40,] 9.939951e-01 1.200983e-02 0.0060049136 [41,] 9.965343e-01 6.931367e-03 0.0034656835 [42,] 9.980514e-01 3.897151e-03 0.0019485756 [43,] 9.987666e-01 2.466707e-03 0.0012333533 [44,] 9.988765e-01 2.246970e-03 0.0011234851 [45,] 9.987161e-01 2.567789e-03 0.0012838945 [46,] 9.991902e-01 1.619687e-03 0.0008098437 [47,] 9.993407e-01 1.318510e-03 0.0006592548 [48,] 9.998540e-01 2.919984e-04 0.0001459992 [49,] 9.997973e-01 4.054877e-04 0.0002027438 [50,] 9.995630e-01 8.739983e-04 0.0004369992 [51,] 9.977370e-01 4.526085e-03 0.0022630425 > postscript(file="/var/www/html/rcomp/tmp/12jpk1259343554.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/2y7pk1259343554.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/3l4fq1259343554.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/4bc1s1259343554.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/5jf3q1259343554.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 = 60 Frequency = 1 1 2 3 4 5 6 0.397380852 0.355498782 0.402792805 0.544674875 0.781144993 0.733850969 7 8 9 10 11 12 0.686556946 0.686556946 0.591968899 0.733850969 0.639262922 0.833850969 13 14 15 16 17 18 0.497380852 0.591968899 0.691968899 0.591968899 0.544674875 0.591968899 19 20 21 22 23 24 0.639262922 0.539262922 0.728439016 0.681144993 0.586556946 0.439262922 25 26 27 28 29 30 0.533850969 0.386556946 0.339262922 0.281144993 0.281144993 0.181144993 31 32 33 34 35 36 -0.066149031 -0.113443054 -0.497207195 -0.544501218 -0.502619148 -0.602619148 37 38 39 40 41 42 -0.749913171 -0.849913171 -0.902619148 -1.002619148 -1.002619148 -1.002619148 43 44 45 46 47 48 -1.049913171 -1.097207195 -1.008031101 -0.771560984 -0.635090866 -0.635090866 49 50 51 52 53 54 -0.587796843 -0.640502819 -0.498620749 -0.540502819 -0.251326725 -0.109444655 55 56 57 58 59 60 -0.009444655 -0.004032702 0.001379251 0.012203157 -0.408031101 -0.444501218 > postscript(file="/var/www/html/rcomp/tmp/6v79q1259343554.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 0.397380852 NA 1 0.355498782 0.397380852 2 0.402792805 0.355498782 3 0.544674875 0.402792805 4 0.781144993 0.544674875 5 0.733850969 0.781144993 6 0.686556946 0.733850969 7 0.686556946 0.686556946 8 0.591968899 0.686556946 9 0.733850969 0.591968899 10 0.639262922 0.733850969 11 0.833850969 0.639262922 12 0.497380852 0.833850969 13 0.591968899 0.497380852 14 0.691968899 0.591968899 15 0.591968899 0.691968899 16 0.544674875 0.591968899 17 0.591968899 0.544674875 18 0.639262922 0.591968899 19 0.539262922 0.639262922 20 0.728439016 0.539262922 21 0.681144993 0.728439016 22 0.586556946 0.681144993 23 0.439262922 0.586556946 24 0.533850969 0.439262922 25 0.386556946 0.533850969 26 0.339262922 0.386556946 27 0.281144993 0.339262922 28 0.281144993 0.281144993 29 0.181144993 0.281144993 30 -0.066149031 0.181144993 31 -0.113443054 -0.066149031 32 -0.497207195 -0.113443054 33 -0.544501218 -0.497207195 34 -0.502619148 -0.544501218 35 -0.602619148 -0.502619148 36 -0.749913171 -0.602619148 37 -0.849913171 -0.749913171 38 -0.902619148 -0.849913171 39 -1.002619148 -0.902619148 40 -1.002619148 -1.002619148 41 -1.002619148 -1.002619148 42 -1.049913171 -1.002619148 43 -1.097207195 -1.049913171 44 -1.008031101 -1.097207195 45 -0.771560984 -1.008031101 46 -0.635090866 -0.771560984 47 -0.635090866 -0.635090866 48 -0.587796843 -0.635090866 49 -0.640502819 -0.587796843 50 -0.498620749 -0.640502819 51 -0.540502819 -0.498620749 52 -0.251326725 -0.540502819 53 -0.109444655 -0.251326725 54 -0.009444655 -0.109444655 55 -0.004032702 -0.009444655 56 0.001379251 -0.004032702 57 0.012203157 0.001379251 58 -0.408031101 0.012203157 59 -0.444501218 -0.408031101 60 NA -0.444501218 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.355498782 0.397380852 [2,] 0.402792805 0.355498782 [3,] 0.544674875 0.402792805 [4,] 0.781144993 0.544674875 [5,] 0.733850969 0.781144993 [6,] 0.686556946 0.733850969 [7,] 0.686556946 0.686556946 [8,] 0.591968899 0.686556946 [9,] 0.733850969 0.591968899 [10,] 0.639262922 0.733850969 [11,] 0.833850969 0.639262922 [12,] 0.497380852 0.833850969 [13,] 0.591968899 0.497380852 [14,] 0.691968899 0.591968899 [15,] 0.591968899 0.691968899 [16,] 0.544674875 0.591968899 [17,] 0.591968899 0.544674875 [18,] 0.639262922 0.591968899 [19,] 0.539262922 0.639262922 [20,] 0.728439016 0.539262922 [21,] 0.681144993 0.728439016 [22,] 0.586556946 0.681144993 [23,] 0.439262922 0.586556946 [24,] 0.533850969 0.439262922 [25,] 0.386556946 0.533850969 [26,] 0.339262922 0.386556946 [27,] 0.281144993 0.339262922 [28,] 0.281144993 0.281144993 [29,] 0.181144993 0.281144993 [30,] -0.066149031 0.181144993 [31,] -0.113443054 -0.066149031 [32,] -0.497207195 -0.113443054 [33,] -0.544501218 -0.497207195 [34,] -0.502619148 -0.544501218 [35,] -0.602619148 -0.502619148 [36,] -0.749913171 -0.602619148 [37,] -0.849913171 -0.749913171 [38,] -0.902619148 -0.849913171 [39,] -1.002619148 -0.902619148 [40,] -1.002619148 -1.002619148 [41,] -1.002619148 -1.002619148 [42,] -1.049913171 -1.002619148 [43,] -1.097207195 -1.049913171 [44,] -1.008031101 -1.097207195 [45,] -0.771560984 -1.008031101 [46,] -0.635090866 -0.771560984 [47,] -0.635090866 -0.635090866 [48,] -0.587796843 -0.635090866 [49,] -0.640502819 -0.587796843 [50,] -0.498620749 -0.640502819 [51,] -0.540502819 -0.498620749 [52,] -0.251326725 -0.540502819 [53,] -0.109444655 -0.251326725 [54,] -0.009444655 -0.109444655 [55,] -0.004032702 -0.009444655 [56,] 0.001379251 -0.004032702 [57,] 0.012203157 0.001379251 [58,] -0.408031101 0.012203157 [59,] -0.444501218 -0.408031101 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.355498782 0.397380852 2 0.402792805 0.355498782 3 0.544674875 0.402792805 4 0.781144993 0.544674875 5 0.733850969 0.781144993 6 0.686556946 0.733850969 7 0.686556946 0.686556946 8 0.591968899 0.686556946 9 0.733850969 0.591968899 10 0.639262922 0.733850969 11 0.833850969 0.639262922 12 0.497380852 0.833850969 13 0.591968899 0.497380852 14 0.691968899 0.591968899 15 0.591968899 0.691968899 16 0.544674875 0.591968899 17 0.591968899 0.544674875 18 0.639262922 0.591968899 19 0.539262922 0.639262922 20 0.728439016 0.539262922 21 0.681144993 0.728439016 22 0.586556946 0.681144993 23 0.439262922 0.586556946 24 0.533850969 0.439262922 25 0.386556946 0.533850969 26 0.339262922 0.386556946 27 0.281144993 0.339262922 28 0.281144993 0.281144993 29 0.181144993 0.281144993 30 -0.066149031 0.181144993 31 -0.113443054 -0.066149031 32 -0.497207195 -0.113443054 33 -0.544501218 -0.497207195 34 -0.502619148 -0.544501218 35 -0.602619148 -0.502619148 36 -0.749913171 -0.602619148 37 -0.849913171 -0.749913171 38 -0.902619148 -0.849913171 39 -1.002619148 -0.902619148 40 -1.002619148 -1.002619148 41 -1.002619148 -1.002619148 42 -1.049913171 -1.002619148 43 -1.097207195 -1.049913171 44 -1.008031101 -1.097207195 45 -0.771560984 -1.008031101 46 -0.635090866 -0.771560984 47 -0.635090866 -0.635090866 48 -0.587796843 -0.635090866 49 -0.640502819 -0.587796843 50 -0.498620749 -0.640502819 51 -0.540502819 -0.498620749 52 -0.251326725 -0.540502819 53 -0.109444655 -0.251326725 54 -0.009444655 -0.109444655 55 -0.004032702 -0.009444655 56 0.001379251 -0.004032702 57 0.012203157 0.001379251 58 -0.408031101 0.012203157 59 -0.444501218 -0.408031101 > 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/72z221259343554.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/8z5h01259343554.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/91dpd1259343554.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/10vvmw1259343554.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/11ciiu1259343554.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/12rftm1259343554.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/1374qd1259343554.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/146a971259343554.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/15fhcp1259343554.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/16a7d71259343555.tab") + } > > system("convert tmp/12jpk1259343554.ps tmp/12jpk1259343554.png") > system("convert tmp/2y7pk1259343554.ps tmp/2y7pk1259343554.png") > system("convert tmp/3l4fq1259343554.ps tmp/3l4fq1259343554.png") > system("convert tmp/4bc1s1259343554.ps tmp/4bc1s1259343554.png") > system("convert tmp/5jf3q1259343554.ps tmp/5jf3q1259343554.png") > system("convert tmp/6v79q1259343554.ps tmp/6v79q1259343554.png") > system("convert tmp/72z221259343554.ps tmp/72z221259343554.png") > system("convert tmp/8z5h01259343554.ps tmp/8z5h01259343554.png") > system("convert tmp/91dpd1259343554.ps tmp/91dpd1259343554.png") > system("convert tmp/10vvmw1259343554.ps tmp/10vvmw1259343554.png") > > > proc.time() user system elapsed 2.453 1.588 2.923