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,11.1,8.1,10.9,7.7,10,7.5,9.2,7.6,9.2,7.8,9.5,7.8,9.6,7.8,9.5,7.5,9.1,7.5,8.9,7.1,9,7.5,10.1,7.5,10.3,7.6,10.2,7.7,9.6,7.7,9.2,7.9,9.3,8.1,9.4,8.2,9.4,8.2,9.2,8.2,9,7.9,9,7.3,9,6.9,9.8,6.6,10,6.7,9.8,6.9,9.3,7,9,7.1,9,7.2,9.1,7.1,9.1,6.9,9.1,7,9.2,6.8,8.8,6.4,8.3,6.7,8.4,6.6,8.1,6.4,7.7,6.3,7.9,6.2,7.9,6.5,8,6.8,7.9,6.8,7.6,6.4,7.1,6.1,6.8,5.8,6.5,6.1,6.9,7.2,8.2,7.3,8.7,6.9,8.3,6.1,7.9,5.8,7.5,6.2,7.8,7.1,8.3,7.7,8.4,7.9,8.2,7.7,7.7,7.4,7.2,7.5,7.3,8,8.1),dim=c(2,60),dimnames=list(c('X','Y'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('X','Y'),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 = '2' > #'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 11.1 8.0 2 10.9 8.1 3 10.0 7.7 4 9.2 7.5 5 9.2 7.6 6 9.5 7.8 7 9.6 7.8 8 9.5 7.8 9 9.1 7.5 10 8.9 7.5 11 9.0 7.1 12 10.1 7.5 13 10.3 7.5 14 10.2 7.6 15 9.6 7.7 16 9.2 7.7 17 9.3 7.9 18 9.4 8.1 19 9.4 8.2 20 9.2 8.2 21 9.0 8.2 22 9.0 7.9 23 9.0 7.3 24 9.8 6.9 25 10.0 6.6 26 9.8 6.7 27 9.3 6.9 28 9.0 7.0 29 9.0 7.1 30 9.1 7.2 31 9.1 7.1 32 9.1 6.9 33 9.2 7.0 34 8.8 6.8 35 8.3 6.4 36 8.4 6.7 37 8.1 6.6 38 7.7 6.4 39 7.9 6.3 40 7.9 6.2 41 8.0 6.5 42 7.9 6.8 43 7.6 6.8 44 7.1 6.4 45 6.8 6.1 46 6.5 5.8 47 6.9 6.1 48 8.2 7.2 49 8.7 7.3 50 8.3 6.9 51 7.9 6.1 52 7.5 5.8 53 7.8 6.2 54 8.3 7.1 55 8.4 7.7 56 8.2 7.9 57 7.7 7.7 58 7.2 7.4 59 7.3 7.5 60 8.1 8.0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 2.102 0.926 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.75477 -0.43723 0.03974 0.37577 1.78604 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.1022 1.1401 1.844 0.0703 . X 0.9260 0.1583 5.849 2.41e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.7998 on 58 degrees of freedom Multiple R-squared: 0.371, Adjusted R-squared: 0.3602 F-statistic: 34.21 on 1 and 58 DF, p-value: 2.414e-07 > 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.067560440 0.13512088 0.932439560 [2,] 0.092338805 0.18467761 0.907661195 [3,] 0.063215831 0.12643166 0.936784169 [4,] 0.047195248 0.09439050 0.952804752 [5,] 0.021882448 0.04376490 0.978117552 [6,] 0.009203016 0.01840603 0.990796984 [7,] 0.031294352 0.06258870 0.968705648 [8,] 0.052816000 0.10563200 0.947184000 [9,] 0.101258637 0.20251727 0.898741363 [10,] 0.106952443 0.21390489 0.893047557 [11,] 0.078446965 0.15689393 0.921553035 [12,] 0.073852937 0.14770587 0.926147063 [13,] 0.085806629 0.17161326 0.914193371 [14,] 0.101284056 0.20256811 0.898715944 [15,] 0.104231425 0.20846285 0.895768575 [16,] 0.105558154 0.21111631 0.894441846 [17,] 0.108721528 0.21744306 0.891278472 [18,] 0.094734980 0.18946996 0.905265020 [19,] 0.074395911 0.14879182 0.925604089 [20,] 0.093536268 0.18707254 0.906463732 [21,] 0.170810805 0.34162161 0.829189195 [22,] 0.255608436 0.51121687 0.744391564 [23,] 0.283604818 0.56720964 0.716395182 [24,] 0.297371259 0.59474252 0.702628741 [25,] 0.307970516 0.61594103 0.692029484 [26,] 0.325049287 0.65009857 0.674950713 [27,] 0.362803254 0.72560651 0.637196746 [28,] 0.441314690 0.88262938 0.558685310 [29,] 0.577073795 0.84585241 0.422926205 [30,] 0.671523806 0.65695239 0.328476194 [31,] 0.726783860 0.54643228 0.273216140 [32,] 0.769075521 0.46184896 0.230924479 [33,] 0.789230649 0.42153870 0.210769351 [34,] 0.799928271 0.40014346 0.200071729 [35,] 0.788631515 0.42273697 0.211368485 [36,] 0.775711739 0.44857652 0.224288261 [37,] 0.764909854 0.47018029 0.235090146 [38,] 0.747797876 0.50440425 0.252202124 [39,] 0.740267541 0.51946492 0.259732459 [40,] 0.754864632 0.49027074 0.245135368 [41,] 0.785789730 0.42842054 0.214210270 [42,] 0.874909244 0.25018151 0.125090756 [43,] 0.923064997 0.15387001 0.076935003 [44,] 0.893298614 0.21340277 0.106701386 [45,] 0.926794125 0.14641175 0.073205875 [46,] 0.913977379 0.17204524 0.086022621 [47,] 0.865069366 0.26986127 0.134930634 [48,] 0.781600178 0.43679964 0.218399822 [49,] 0.675095440 0.64980912 0.324904560 [50,] 0.899808475 0.20038305 0.100191525 [51,] 0.992517013 0.01496597 0.007482987 > postscript(file="/var/www/html/rcomp/tmp/179sh1258485936.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/20uy21258485936.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/32y441258485936.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/4okjy1258485936.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/5bvjb1258485936.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 1.58961543 1.29701367 0.76742071 0.15262422 0.06002246 0.17481895 7 8 9 10 11 12 0.27481895 0.17481895 0.05262422 -0.14737578 0.32303126 1.05262422 13 14 15 16 17 18 1.25262422 1.06002246 0.36742071 -0.03257929 -0.11778281 -0.20298633 19 20 21 22 23 24 -0.29558809 -0.49558809 -0.69558809 -0.41778281 0.13782774 1.30823478 25 26 27 28 29 30 1.78604006 1.49343830 0.80823478 0.41563302 0.32303126 0.33042950 31 32 33 34 35 36 0.42303126 0.60823478 0.61563302 0.40083654 0.27124358 0.09343830 37 38 39 40 41 42 -0.11395994 -0.32875642 -0.03615466 0.05644709 -0.12135818 -0.49916346 43 44 45 46 47 48 -0.79916346 -0.92875642 -0.95095115 -0.97314587 -0.85095115 -0.56957050 49 50 51 52 53 54 -0.16217226 -0.19176522 0.14904885 0.02685413 -0.04355291 -0.37696874 55 56 57 58 59 60 -0.83257929 -1.21778281 -1.53257929 -1.75477402 -1.74737578 -1.41038457 > postscript(file="/var/www/html/rcomp/tmp/6njrg1258485936.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 1.58961543 NA 1 1.29701367 1.58961543 2 0.76742071 1.29701367 3 0.15262422 0.76742071 4 0.06002246 0.15262422 5 0.17481895 0.06002246 6 0.27481895 0.17481895 7 0.17481895 0.27481895 8 0.05262422 0.17481895 9 -0.14737578 0.05262422 10 0.32303126 -0.14737578 11 1.05262422 0.32303126 12 1.25262422 1.05262422 13 1.06002246 1.25262422 14 0.36742071 1.06002246 15 -0.03257929 0.36742071 16 -0.11778281 -0.03257929 17 -0.20298633 -0.11778281 18 -0.29558809 -0.20298633 19 -0.49558809 -0.29558809 20 -0.69558809 -0.49558809 21 -0.41778281 -0.69558809 22 0.13782774 -0.41778281 23 1.30823478 0.13782774 24 1.78604006 1.30823478 25 1.49343830 1.78604006 26 0.80823478 1.49343830 27 0.41563302 0.80823478 28 0.32303126 0.41563302 29 0.33042950 0.32303126 30 0.42303126 0.33042950 31 0.60823478 0.42303126 32 0.61563302 0.60823478 33 0.40083654 0.61563302 34 0.27124358 0.40083654 35 0.09343830 0.27124358 36 -0.11395994 0.09343830 37 -0.32875642 -0.11395994 38 -0.03615466 -0.32875642 39 0.05644709 -0.03615466 40 -0.12135818 0.05644709 41 -0.49916346 -0.12135818 42 -0.79916346 -0.49916346 43 -0.92875642 -0.79916346 44 -0.95095115 -0.92875642 45 -0.97314587 -0.95095115 46 -0.85095115 -0.97314587 47 -0.56957050 -0.85095115 48 -0.16217226 -0.56957050 49 -0.19176522 -0.16217226 50 0.14904885 -0.19176522 51 0.02685413 0.14904885 52 -0.04355291 0.02685413 53 -0.37696874 -0.04355291 54 -0.83257929 -0.37696874 55 -1.21778281 -0.83257929 56 -1.53257929 -1.21778281 57 -1.75477402 -1.53257929 58 -1.74737578 -1.75477402 59 -1.41038457 -1.74737578 60 NA -1.41038457 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.29701367 1.58961543 [2,] 0.76742071 1.29701367 [3,] 0.15262422 0.76742071 [4,] 0.06002246 0.15262422 [5,] 0.17481895 0.06002246 [6,] 0.27481895 0.17481895 [7,] 0.17481895 0.27481895 [8,] 0.05262422 0.17481895 [9,] -0.14737578 0.05262422 [10,] 0.32303126 -0.14737578 [11,] 1.05262422 0.32303126 [12,] 1.25262422 1.05262422 [13,] 1.06002246 1.25262422 [14,] 0.36742071 1.06002246 [15,] -0.03257929 0.36742071 [16,] -0.11778281 -0.03257929 [17,] -0.20298633 -0.11778281 [18,] -0.29558809 -0.20298633 [19,] -0.49558809 -0.29558809 [20,] -0.69558809 -0.49558809 [21,] -0.41778281 -0.69558809 [22,] 0.13782774 -0.41778281 [23,] 1.30823478 0.13782774 [24,] 1.78604006 1.30823478 [25,] 1.49343830 1.78604006 [26,] 0.80823478 1.49343830 [27,] 0.41563302 0.80823478 [28,] 0.32303126 0.41563302 [29,] 0.33042950 0.32303126 [30,] 0.42303126 0.33042950 [31,] 0.60823478 0.42303126 [32,] 0.61563302 0.60823478 [33,] 0.40083654 0.61563302 [34,] 0.27124358 0.40083654 [35,] 0.09343830 0.27124358 [36,] -0.11395994 0.09343830 [37,] -0.32875642 -0.11395994 [38,] -0.03615466 -0.32875642 [39,] 0.05644709 -0.03615466 [40,] -0.12135818 0.05644709 [41,] -0.49916346 -0.12135818 [42,] -0.79916346 -0.49916346 [43,] -0.92875642 -0.79916346 [44,] -0.95095115 -0.92875642 [45,] -0.97314587 -0.95095115 [46,] -0.85095115 -0.97314587 [47,] -0.56957050 -0.85095115 [48,] -0.16217226 -0.56957050 [49,] -0.19176522 -0.16217226 [50,] 0.14904885 -0.19176522 [51,] 0.02685413 0.14904885 [52,] -0.04355291 0.02685413 [53,] -0.37696874 -0.04355291 [54,] -0.83257929 -0.37696874 [55,] -1.21778281 -0.83257929 [56,] -1.53257929 -1.21778281 [57,] -1.75477402 -1.53257929 [58,] -1.74737578 -1.75477402 [59,] -1.41038457 -1.74737578 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.29701367 1.58961543 2 0.76742071 1.29701367 3 0.15262422 0.76742071 4 0.06002246 0.15262422 5 0.17481895 0.06002246 6 0.27481895 0.17481895 7 0.17481895 0.27481895 8 0.05262422 0.17481895 9 -0.14737578 0.05262422 10 0.32303126 -0.14737578 11 1.05262422 0.32303126 12 1.25262422 1.05262422 13 1.06002246 1.25262422 14 0.36742071 1.06002246 15 -0.03257929 0.36742071 16 -0.11778281 -0.03257929 17 -0.20298633 -0.11778281 18 -0.29558809 -0.20298633 19 -0.49558809 -0.29558809 20 -0.69558809 -0.49558809 21 -0.41778281 -0.69558809 22 0.13782774 -0.41778281 23 1.30823478 0.13782774 24 1.78604006 1.30823478 25 1.49343830 1.78604006 26 0.80823478 1.49343830 27 0.41563302 0.80823478 28 0.32303126 0.41563302 29 0.33042950 0.32303126 30 0.42303126 0.33042950 31 0.60823478 0.42303126 32 0.61563302 0.60823478 33 0.40083654 0.61563302 34 0.27124358 0.40083654 35 0.09343830 0.27124358 36 -0.11395994 0.09343830 37 -0.32875642 -0.11395994 38 -0.03615466 -0.32875642 39 0.05644709 -0.03615466 40 -0.12135818 0.05644709 41 -0.49916346 -0.12135818 42 -0.79916346 -0.49916346 43 -0.92875642 -0.79916346 44 -0.95095115 -0.92875642 45 -0.97314587 -0.95095115 46 -0.85095115 -0.97314587 47 -0.56957050 -0.85095115 48 -0.16217226 -0.56957050 49 -0.19176522 -0.16217226 50 0.14904885 -0.19176522 51 0.02685413 0.14904885 52 -0.04355291 0.02685413 53 -0.37696874 -0.04355291 54 -0.83257929 -0.37696874 55 -1.21778281 -0.83257929 56 -1.53257929 -1.21778281 57 -1.75477402 -1.53257929 58 -1.74737578 -1.75477402 59 -1.41038457 -1.74737578 > 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/74dz11258485936.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/8ny9e1258485936.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/9u6mn1258485936.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/10b7oh1258485936.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/110ocv1258485936.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/12a9y41258485936.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/139g5d1258485936.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/14oiau1258485936.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/15ntqz1258485936.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/16cmgw1258485936.tab") + } > > system("convert tmp/179sh1258485936.ps tmp/179sh1258485936.png") > system("convert tmp/20uy21258485936.ps tmp/20uy21258485936.png") > system("convert tmp/32y441258485936.ps tmp/32y441258485936.png") > system("convert tmp/4okjy1258485936.ps tmp/4okjy1258485936.png") > system("convert tmp/5bvjb1258485936.ps tmp/5bvjb1258485936.png") > system("convert tmp/6njrg1258485936.ps tmp/6njrg1258485936.png") > system("convert tmp/74dz11258485936.ps tmp/74dz11258485936.png") > system("convert tmp/8ny9e1258485936.ps tmp/8ny9e1258485936.png") > system("convert tmp/9u6mn1258485936.ps tmp/9u6mn1258485936.png") > system("convert tmp/10b7oh1258485936.ps tmp/10b7oh1258485936.png") > > > proc.time() user system elapsed 2.473 1.577 3.128