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(9.9,8.2,9.8,8,9.3,7.5,8.3,6.8,8,6.5,8.5,6.6,10.4,7.6,11.1,8,10.9,8.1,10,7.7,9.2,7.5,9.2,7.6,9.5,7.8,9.6,7.8,9.5,7.8,9.1,7.5,8.9,7.5,9,7.1,10.1,7.5,10.3,7.5,10.2,7.6,9.6,7.7,9.2,7.7,9.3,7.9,9.4,8.1,9.4,8.2,9.2,8.2,9,8.2,9,7.9,9,7.3,9.8,6.9,10,6.6,9.8,6.7,9.3,6.9,9,7,9,7.1,9.1,7.2,9.1,7.1,9.1,6.9,9.2,7,8.8,6.8,8.3,6.4,8.4,6.7,8.1,6.6,7.7,6.4,7.9,6.3,7.9,6.2,8,6.5,7.9,6.8,7.6,6.8,7.1,6.4,6.8,6.1,6.5,5.8,6.9,6.1,8.2,7.2,8.7,7.3,8.3,6.9,7.9,6.1,7.5,5.8,7.8,6.2),dim=c(2,60),dimnames=list(c('WLVrouw','WLMan'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('WLVrouw','WLMan'),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 WLVrouw WLMan 1 9.9 8.2 2 9.8 8.0 3 9.3 7.5 4 8.3 6.8 5 8.0 6.5 6 8.5 6.6 7 10.4 7.6 8 11.1 8.0 9 10.9 8.1 10 10.0 7.7 11 9.2 7.5 12 9.2 7.6 13 9.5 7.8 14 9.6 7.8 15 9.5 7.8 16 9.1 7.5 17 8.9 7.5 18 9.0 7.1 19 10.1 7.5 20 10.3 7.5 21 10.2 7.6 22 9.6 7.7 23 9.2 7.7 24 9.3 7.9 25 9.4 8.1 26 9.4 8.2 27 9.2 8.2 28 9.0 8.2 29 9.0 7.9 30 9.0 7.3 31 9.8 6.9 32 10.0 6.6 33 9.8 6.7 34 9.3 6.9 35 9.0 7.0 36 9.0 7.1 37 9.1 7.2 38 9.1 7.1 39 9.1 6.9 40 9.2 7.0 41 8.8 6.8 42 8.3 6.4 43 8.4 6.7 44 8.1 6.6 45 7.7 6.4 46 7.9 6.3 47 7.9 6.2 48 8.0 6.5 49 7.9 6.8 50 7.6 6.8 51 7.1 6.4 52 6.8 6.1 53 6.5 5.8 54 6.9 6.1 55 8.2 7.2 56 8.7 7.3 57 8.3 6.9 58 7.9 6.1 59 7.5 5.8 60 7.8 6.2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) WLMan 0.7573 1.1400 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.10557 -0.36001 -0.06356 0.25197 1.71849 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.7573 0.8772 0.863 0.392 WLMan 1.1400 0.1224 9.315 4.03e-13 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6296 on 58 degrees of freedom Multiple R-squared: 0.5993, Adjusted R-squared: 0.5924 F-statistic: 86.76 on 1 and 58 DF, p-value: 4.028e-13 > 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.004650758 0.009301516 0.99534924 [2,] 0.009340184 0.018680367 0.99065982 [3,] 0.227955058 0.455910115 0.77204494 [4,] 0.451528594 0.903057188 0.54847141 [5,] 0.421348307 0.842696614 0.57865169 [6,] 0.322823652 0.645647304 0.67717635 [7,] 0.265738467 0.531476934 0.73426153 [8,] 0.237202810 0.474405621 0.76279719 [9,] 0.201256647 0.402513295 0.79874335 [10,] 0.153235030 0.306470060 0.84676497 [11,] 0.120542128 0.241084256 0.87945787 [12,] 0.090515524 0.181031048 0.90948448 [13,] 0.080580947 0.161161893 0.91941905 [14,] 0.053623925 0.107247851 0.94637607 [15,] 0.069663541 0.139327082 0.93033646 [16,] 0.122690388 0.245380776 0.87730961 [17,] 0.141688378 0.283376757 0.85831162 [18,] 0.106812980 0.213625961 0.89318702 [19,] 0.096726566 0.193453132 0.90327343 [20,] 0.098757798 0.197515596 0.90124220 [21,] 0.109542621 0.219085241 0.89045738 [22,] 0.123911390 0.247822781 0.87608861 [23,] 0.161854973 0.323709947 0.83814503 [24,] 0.262598968 0.525197935 0.73740103 [25,] 0.318393635 0.636787271 0.68160636 [26,] 0.262921996 0.525843992 0.73707800 [27,] 0.368879306 0.737758612 0.63112069 [28,] 0.754791058 0.490417885 0.24520894 [29,] 0.929974517 0.140050965 0.07002548 [30,] 0.939385290 0.121229419 0.06061471 [31,] 0.922490954 0.155018092 0.07750905 [32,] 0.896870424 0.206259152 0.10312958 [33,] 0.863834887 0.272330226 0.13616511 [34,] 0.837165792 0.325668416 0.16283421 [35,] 0.853853972 0.292292057 0.14614603 [36,] 0.886803721 0.226392559 0.11319628 [37,] 0.904885857 0.190228286 0.09511414 [38,] 0.920120382 0.159759236 0.07987962 [39,] 0.916534953 0.166930094 0.08346505 [40,] 0.900934671 0.198130658 0.09906533 [41,] 0.879042386 0.241915229 0.12095761 [42,] 0.860039502 0.279920995 0.13996050 [43,] 0.857546217 0.284907565 0.14245378 [44,] 0.828250930 0.343498139 0.17174907 [45,] 0.775426438 0.449147123 0.22457356 [46,] 0.763966309 0.472067381 0.23603369 [47,] 0.781694144 0.436611712 0.21830586 [48,] 0.805517984 0.388964031 0.19448202 [49,] 0.887291866 0.225416268 0.11270813 [50,] 0.989987916 0.020024169 0.01001208 [51,] 0.995885120 0.008229759 0.00411488 > postscript(file="/var/www/html/rcomp/tmp/1pky31258722934.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/203ye1258722934.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/3szi41258722934.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/4u5cb1258722934.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/5zej91258722934.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.205574592 -0.077566832 -0.007547431 -0.209520270 -0.167508630 0.218487490 7 8 9 10 11 12 0.978448689 1.222433168 0.908429288 0.464444808 -0.107547431 -0.221551311 13 14 15 16 17 18 -0.149559072 -0.049559072 -0.149559072 -0.207547431 -0.407547431 0.148468089 19 20 21 22 23 24 0.792452569 0.992452569 0.778448689 0.064444808 -0.335555192 -0.463562952 25 26 27 28 29 30 -0.591570712 -0.705574592 -0.905574592 -1.105574592 -0.763562952 -0.079539671 31 32 33 34 35 36 1.176475850 1.718487490 1.404483610 0.676475850 0.262471970 0.148468089 37 38 39 40 41 42 0.134464209 0.248468089 0.476475850 0.462471970 0.290479730 0.246495251 43 44 45 46 47 48 0.004483610 -0.181512510 -0.353504749 -0.039500869 0.074503011 -0.167508630 49 50 51 52 53 54 -0.609520270 -0.909520270 -0.953504749 -0.911493109 -0.869481468 -0.811493109 55 56 57 58 59 60 -0.765535791 -0.379539671 -0.323524150 0.188506891 0.130518532 -0.025496989 > postscript(file="/var/www/html/rcomp/tmp/6wfl81258722934.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.205574592 NA 1 -0.077566832 -0.205574592 2 -0.007547431 -0.077566832 3 -0.209520270 -0.007547431 4 -0.167508630 -0.209520270 5 0.218487490 -0.167508630 6 0.978448689 0.218487490 7 1.222433168 0.978448689 8 0.908429288 1.222433168 9 0.464444808 0.908429288 10 -0.107547431 0.464444808 11 -0.221551311 -0.107547431 12 -0.149559072 -0.221551311 13 -0.049559072 -0.149559072 14 -0.149559072 -0.049559072 15 -0.207547431 -0.149559072 16 -0.407547431 -0.207547431 17 0.148468089 -0.407547431 18 0.792452569 0.148468089 19 0.992452569 0.792452569 20 0.778448689 0.992452569 21 0.064444808 0.778448689 22 -0.335555192 0.064444808 23 -0.463562952 -0.335555192 24 -0.591570712 -0.463562952 25 -0.705574592 -0.591570712 26 -0.905574592 -0.705574592 27 -1.105574592 -0.905574592 28 -0.763562952 -1.105574592 29 -0.079539671 -0.763562952 30 1.176475850 -0.079539671 31 1.718487490 1.176475850 32 1.404483610 1.718487490 33 0.676475850 1.404483610 34 0.262471970 0.676475850 35 0.148468089 0.262471970 36 0.134464209 0.148468089 37 0.248468089 0.134464209 38 0.476475850 0.248468089 39 0.462471970 0.476475850 40 0.290479730 0.462471970 41 0.246495251 0.290479730 42 0.004483610 0.246495251 43 -0.181512510 0.004483610 44 -0.353504749 -0.181512510 45 -0.039500869 -0.353504749 46 0.074503011 -0.039500869 47 -0.167508630 0.074503011 48 -0.609520270 -0.167508630 49 -0.909520270 -0.609520270 50 -0.953504749 -0.909520270 51 -0.911493109 -0.953504749 52 -0.869481468 -0.911493109 53 -0.811493109 -0.869481468 54 -0.765535791 -0.811493109 55 -0.379539671 -0.765535791 56 -0.323524150 -0.379539671 57 0.188506891 -0.323524150 58 0.130518532 0.188506891 59 -0.025496989 0.130518532 60 NA -0.025496989 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.077566832 -0.205574592 [2,] -0.007547431 -0.077566832 [3,] -0.209520270 -0.007547431 [4,] -0.167508630 -0.209520270 [5,] 0.218487490 -0.167508630 [6,] 0.978448689 0.218487490 [7,] 1.222433168 0.978448689 [8,] 0.908429288 1.222433168 [9,] 0.464444808 0.908429288 [10,] -0.107547431 0.464444808 [11,] -0.221551311 -0.107547431 [12,] -0.149559072 -0.221551311 [13,] -0.049559072 -0.149559072 [14,] -0.149559072 -0.049559072 [15,] -0.207547431 -0.149559072 [16,] -0.407547431 -0.207547431 [17,] 0.148468089 -0.407547431 [18,] 0.792452569 0.148468089 [19,] 0.992452569 0.792452569 [20,] 0.778448689 0.992452569 [21,] 0.064444808 0.778448689 [22,] -0.335555192 0.064444808 [23,] -0.463562952 -0.335555192 [24,] -0.591570712 -0.463562952 [25,] -0.705574592 -0.591570712 [26,] -0.905574592 -0.705574592 [27,] -1.105574592 -0.905574592 [28,] -0.763562952 -1.105574592 [29,] -0.079539671 -0.763562952 [30,] 1.176475850 -0.079539671 [31,] 1.718487490 1.176475850 [32,] 1.404483610 1.718487490 [33,] 0.676475850 1.404483610 [34,] 0.262471970 0.676475850 [35,] 0.148468089 0.262471970 [36,] 0.134464209 0.148468089 [37,] 0.248468089 0.134464209 [38,] 0.476475850 0.248468089 [39,] 0.462471970 0.476475850 [40,] 0.290479730 0.462471970 [41,] 0.246495251 0.290479730 [42,] 0.004483610 0.246495251 [43,] -0.181512510 0.004483610 [44,] -0.353504749 -0.181512510 [45,] -0.039500869 -0.353504749 [46,] 0.074503011 -0.039500869 [47,] -0.167508630 0.074503011 [48,] -0.609520270 -0.167508630 [49,] -0.909520270 -0.609520270 [50,] -0.953504749 -0.909520270 [51,] -0.911493109 -0.953504749 [52,] -0.869481468 -0.911493109 [53,] -0.811493109 -0.869481468 [54,] -0.765535791 -0.811493109 [55,] -0.379539671 -0.765535791 [56,] -0.323524150 -0.379539671 [57,] 0.188506891 -0.323524150 [58,] 0.130518532 0.188506891 [59,] -0.025496989 0.130518532 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.077566832 -0.205574592 2 -0.007547431 -0.077566832 3 -0.209520270 -0.007547431 4 -0.167508630 -0.209520270 5 0.218487490 -0.167508630 6 0.978448689 0.218487490 7 1.222433168 0.978448689 8 0.908429288 1.222433168 9 0.464444808 0.908429288 10 -0.107547431 0.464444808 11 -0.221551311 -0.107547431 12 -0.149559072 -0.221551311 13 -0.049559072 -0.149559072 14 -0.149559072 -0.049559072 15 -0.207547431 -0.149559072 16 -0.407547431 -0.207547431 17 0.148468089 -0.407547431 18 0.792452569 0.148468089 19 0.992452569 0.792452569 20 0.778448689 0.992452569 21 0.064444808 0.778448689 22 -0.335555192 0.064444808 23 -0.463562952 -0.335555192 24 -0.591570712 -0.463562952 25 -0.705574592 -0.591570712 26 -0.905574592 -0.705574592 27 -1.105574592 -0.905574592 28 -0.763562952 -1.105574592 29 -0.079539671 -0.763562952 30 1.176475850 -0.079539671 31 1.718487490 1.176475850 32 1.404483610 1.718487490 33 0.676475850 1.404483610 34 0.262471970 0.676475850 35 0.148468089 0.262471970 36 0.134464209 0.148468089 37 0.248468089 0.134464209 38 0.476475850 0.248468089 39 0.462471970 0.476475850 40 0.290479730 0.462471970 41 0.246495251 0.290479730 42 0.004483610 0.246495251 43 -0.181512510 0.004483610 44 -0.353504749 -0.181512510 45 -0.039500869 -0.353504749 46 0.074503011 -0.039500869 47 -0.167508630 0.074503011 48 -0.609520270 -0.167508630 49 -0.909520270 -0.609520270 50 -0.953504749 -0.909520270 51 -0.911493109 -0.953504749 52 -0.869481468 -0.911493109 53 -0.811493109 -0.869481468 54 -0.765535791 -0.811493109 55 -0.379539671 -0.765535791 56 -0.323524150 -0.379539671 57 0.188506891 -0.323524150 58 0.130518532 0.188506891 59 -0.025496989 0.130518532 > 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/7vdsx1258722934.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/8g7141258722934.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/9j8k81258722934.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/10fcxo1258722934.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/11smpe1258722934.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/12j9ub1258722934.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/132puv1258722934.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/1479ll1258722935.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/15654u1258722935.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/162pbl1258722935.tab") + } > > system("convert tmp/1pky31258722934.ps tmp/1pky31258722934.png") > system("convert tmp/203ye1258722934.ps tmp/203ye1258722934.png") > system("convert tmp/3szi41258722934.ps tmp/3szi41258722934.png") > system("convert tmp/4u5cb1258722934.ps tmp/4u5cb1258722934.png") > system("convert tmp/5zej91258722934.ps tmp/5zej91258722934.png") > system("convert tmp/6wfl81258722934.ps tmp/6wfl81258722934.png") > system("convert tmp/7vdsx1258722934.ps tmp/7vdsx1258722934.png") > system("convert tmp/8g7141258722934.ps tmp/8g7141258722934.png") > system("convert tmp/9j8k81258722934.ps tmp/9j8k81258722934.png") > system("convert tmp/10fcxo1258722934.ps tmp/10fcxo1258722934.png") > > > proc.time() user system elapsed 2.504 1.576 2.962