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(6802.96,0,7132.68,0,7073.29,0,7264.5,0,7105.33,0,7218.71,0,7225.72,0,7354.25,0,7745.46,0,8070.26,0,8366.33,0,8667.51,0,8854.34,0,9218.1,0,9332.9,0,9358.31,0,9248.66,0,9401.2,0,9652.04,0,9957.38,0,10110.63,0,10169.26,0,10343.78,0,10750.21,0,11337.5,0,11786.96,0,12083.04,0,12007.74,0,11745.93,0,11051.51,0,11445.9,0,11924.88,0,12247.63,0,12690.91,0,12910.7,0,13202.12,0,13654.67,0,13862.82,0,13523.93,0,14211.17,0,14510.35,0,14289.23,0,14111.82,0,13086.59,0,13351.54,0,13747.69,0,12855.61,0,12926.93,0,12121.95,1,11731.65,1,11639.51,1,12163.78,1,12029.53,1,11234.18,1,9852.13,1,9709.04,1,9332.75,1,7108.6,1,6691.49,1,6143.05,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 Y X 1 6802.96 0 2 7132.68 0 3 7073.29 0 4 7264.50 0 5 7105.33 0 6 7218.71 0 7 7225.72 0 8 7354.25 0 9 7745.46 0 10 8070.26 0 11 8366.33 0 12 8667.51 0 13 8854.34 0 14 9218.10 0 15 9332.90 0 16 9358.31 0 17 9248.66 0 18 9401.20 0 19 9652.04 0 20 9957.38 0 21 10110.63 0 22 10169.26 0 23 10343.78 0 24 10750.21 0 25 11337.50 0 26 11786.96 0 27 12083.04 0 28 12007.74 0 29 11745.93 0 30 11051.51 0 31 11445.90 0 32 11924.88 0 33 12247.63 0 34 12690.91 0 35 12910.70 0 36 13202.12 0 37 13654.67 0 38 13862.82 0 39 13523.93 0 40 14211.17 0 41 14510.35 0 42 14289.23 0 43 14111.82 0 44 13086.59 0 45 13351.54 0 46 13747.69 0 47 12855.61 0 48 12926.93 0 49 12121.95 1 50 11731.65 1 51 11639.51 1 52 12163.78 1 53 12029.53 1 54 11234.18 1 55 9852.13 1 56 9709.04 1 57 9332.75 1 58 7108.60 1 59 6691.49 1 60 6143.05 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 10729.0 -749.2 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -3926.0 -1921.3 171.9 2130.5 3781.4 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10729.0 345.7 31.033 <2e-16 *** X -749.2 773.1 -0.969 0.337 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2395 on 58 degrees of freedom Multiple R-squared: 0.01593, Adjusted R-squared: -0.001033 F-statistic: 0.9391 on 1 and 58 DF, p-value: 0.3365 > 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,] 9.605878e-04 1.921176e-03 0.9990394 [2,] 1.018647e-04 2.037293e-04 0.9998981 [3,] 1.092688e-05 2.185377e-05 0.9999891 [4,] 2.275200e-06 4.550400e-06 0.9999977 [5,] 6.467740e-06 1.293548e-05 0.9999935 [6,] 2.562782e-05 5.125563e-05 0.9999744 [7,] 8.901428e-05 1.780286e-04 0.9999110 [8,] 2.892208e-04 5.784415e-04 0.9997108 [9,] 6.964144e-04 1.392829e-03 0.9993036 [10,] 1.973280e-03 3.946561e-03 0.9980267 [11,] 4.087999e-03 8.175999e-03 0.9959120 [12,] 6.669988e-03 1.333998e-02 0.9933300 [13,] 8.866396e-03 1.773279e-02 0.9911336 [14,] 1.257179e-02 2.514357e-02 0.9874282 [15,] 1.976675e-02 3.953350e-02 0.9802333 [16,] 3.390332e-02 6.780665e-02 0.9660967 [17,] 5.580623e-02 1.116125e-01 0.9441938 [18,] 8.549976e-02 1.709995e-01 0.9145002 [19,] 1.283810e-01 2.567619e-01 0.8716190 [20,] 1.958154e-01 3.916308e-01 0.8041846 [21,] 3.011101e-01 6.022203e-01 0.6988899 [22,] 4.277299e-01 8.554598e-01 0.5722701 [23,] 5.458295e-01 9.083410e-01 0.4541705 [24,] 6.226777e-01 7.546446e-01 0.3773223 [25,] 6.665390e-01 6.669219e-01 0.3334610 [26,] 7.003546e-01 5.992908e-01 0.2996454 [27,] 7.323835e-01 5.352329e-01 0.2676165 [28,] 7.616954e-01 4.766093e-01 0.2383046 [29,] 7.867369e-01 4.265262e-01 0.2132631 [30,] 8.091648e-01 3.816704e-01 0.1908352 [31,] 8.250144e-01 3.499712e-01 0.1749856 [32,] 8.368378e-01 3.263244e-01 0.1631622 [33,] 8.498209e-01 3.003581e-01 0.1501791 [34,] 8.581271e-01 2.837458e-01 0.1418729 [35,] 8.499507e-01 3.000987e-01 0.1500493 [36,] 8.528645e-01 2.942711e-01 0.1471355 [37,] 8.591415e-01 2.817170e-01 0.1408585 [38,] 8.521400e-01 2.957201e-01 0.1478600 [39,] 8.352926e-01 3.294147e-01 0.1647074 [40,] 7.899138e-01 4.201725e-01 0.2100862 [41,] 7.385331e-01 5.229338e-01 0.2614669 [42,] 6.897000e-01 6.206000e-01 0.3103000 [43,] 6.123282e-01 7.753435e-01 0.3876718 [44,] 5.272397e-01 9.455207e-01 0.4727603 [45,] 4.960083e-01 9.920166e-01 0.5039917 [46,] 4.515285e-01 9.030570e-01 0.5484715 [47,] 4.135084e-01 8.270167e-01 0.5864916 [48,] 4.503205e-01 9.006410e-01 0.5496795 [49,] 5.450245e-01 9.099511e-01 0.4549755 [50,] 6.275814e-01 7.448372e-01 0.3724186 [51,] 5.829922e-01 8.340156e-01 0.4170078 > postscript(file="/var/www/html/rcomp/tmp/1uh3d1258666120.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/2ysay1258666120.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/3dl0t1258666120.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/4h6wp1258666120.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/5olnl1258666120.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 -3926.01875 -3596.29875 -3655.68875 -3464.47875 -3623.64875 -3510.26875 7 8 9 10 11 12 -3503.25875 -3374.72875 -2983.51875 -2658.71875 -2362.64875 -2061.46875 13 14 15 16 17 18 -1874.63875 -1510.87875 -1396.07875 -1370.66875 -1480.31875 -1327.77875 19 20 21 22 23 24 -1076.93875 -771.59875 -618.34875 -559.71875 -385.19875 21.23125 25 26 27 28 29 30 608.52125 1057.98125 1354.06125 1278.76125 1016.95125 322.53125 31 32 33 34 35 36 716.92125 1195.90125 1518.65125 1961.93125 2181.72125 2473.14125 37 38 39 40 41 42 2925.69125 3133.84125 2794.95125 3482.19125 3781.37125 3560.25125 43 44 45 46 47 48 3382.84125 2357.61125 2622.56125 3018.71125 2126.63125 2197.95125 49 50 51 52 53 54 2142.14500 1751.84500 1659.70500 2183.97500 2049.72500 1254.37500 55 56 57 58 59 60 -127.67500 -270.76500 -647.05500 -2871.20500 -3288.31500 -3836.75500 > postscript(file="/var/www/html/rcomp/tmp/6lpp91258666120.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 -3926.01875 NA 1 -3596.29875 -3926.01875 2 -3655.68875 -3596.29875 3 -3464.47875 -3655.68875 4 -3623.64875 -3464.47875 5 -3510.26875 -3623.64875 6 -3503.25875 -3510.26875 7 -3374.72875 -3503.25875 8 -2983.51875 -3374.72875 9 -2658.71875 -2983.51875 10 -2362.64875 -2658.71875 11 -2061.46875 -2362.64875 12 -1874.63875 -2061.46875 13 -1510.87875 -1874.63875 14 -1396.07875 -1510.87875 15 -1370.66875 -1396.07875 16 -1480.31875 -1370.66875 17 -1327.77875 -1480.31875 18 -1076.93875 -1327.77875 19 -771.59875 -1076.93875 20 -618.34875 -771.59875 21 -559.71875 -618.34875 22 -385.19875 -559.71875 23 21.23125 -385.19875 24 608.52125 21.23125 25 1057.98125 608.52125 26 1354.06125 1057.98125 27 1278.76125 1354.06125 28 1016.95125 1278.76125 29 322.53125 1016.95125 30 716.92125 322.53125 31 1195.90125 716.92125 32 1518.65125 1195.90125 33 1961.93125 1518.65125 34 2181.72125 1961.93125 35 2473.14125 2181.72125 36 2925.69125 2473.14125 37 3133.84125 2925.69125 38 2794.95125 3133.84125 39 3482.19125 2794.95125 40 3781.37125 3482.19125 41 3560.25125 3781.37125 42 3382.84125 3560.25125 43 2357.61125 3382.84125 44 2622.56125 2357.61125 45 3018.71125 2622.56125 46 2126.63125 3018.71125 47 2197.95125 2126.63125 48 2142.14500 2197.95125 49 1751.84500 2142.14500 50 1659.70500 1751.84500 51 2183.97500 1659.70500 52 2049.72500 2183.97500 53 1254.37500 2049.72500 54 -127.67500 1254.37500 55 -270.76500 -127.67500 56 -647.05500 -270.76500 57 -2871.20500 -647.05500 58 -3288.31500 -2871.20500 59 -3836.75500 -3288.31500 60 NA -3836.75500 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3596.29875 -3926.01875 [2,] -3655.68875 -3596.29875 [3,] -3464.47875 -3655.68875 [4,] -3623.64875 -3464.47875 [5,] -3510.26875 -3623.64875 [6,] -3503.25875 -3510.26875 [7,] -3374.72875 -3503.25875 [8,] -2983.51875 -3374.72875 [9,] -2658.71875 -2983.51875 [10,] -2362.64875 -2658.71875 [11,] -2061.46875 -2362.64875 [12,] -1874.63875 -2061.46875 [13,] -1510.87875 -1874.63875 [14,] -1396.07875 -1510.87875 [15,] -1370.66875 -1396.07875 [16,] -1480.31875 -1370.66875 [17,] -1327.77875 -1480.31875 [18,] -1076.93875 -1327.77875 [19,] -771.59875 -1076.93875 [20,] -618.34875 -771.59875 [21,] -559.71875 -618.34875 [22,] -385.19875 -559.71875 [23,] 21.23125 -385.19875 [24,] 608.52125 21.23125 [25,] 1057.98125 608.52125 [26,] 1354.06125 1057.98125 [27,] 1278.76125 1354.06125 [28,] 1016.95125 1278.76125 [29,] 322.53125 1016.95125 [30,] 716.92125 322.53125 [31,] 1195.90125 716.92125 [32,] 1518.65125 1195.90125 [33,] 1961.93125 1518.65125 [34,] 2181.72125 1961.93125 [35,] 2473.14125 2181.72125 [36,] 2925.69125 2473.14125 [37,] 3133.84125 2925.69125 [38,] 2794.95125 3133.84125 [39,] 3482.19125 2794.95125 [40,] 3781.37125 3482.19125 [41,] 3560.25125 3781.37125 [42,] 3382.84125 3560.25125 [43,] 2357.61125 3382.84125 [44,] 2622.56125 2357.61125 [45,] 3018.71125 2622.56125 [46,] 2126.63125 3018.71125 [47,] 2197.95125 2126.63125 [48,] 2142.14500 2197.95125 [49,] 1751.84500 2142.14500 [50,] 1659.70500 1751.84500 [51,] 2183.97500 1659.70500 [52,] 2049.72500 2183.97500 [53,] 1254.37500 2049.72500 [54,] -127.67500 1254.37500 [55,] -270.76500 -127.67500 [56,] -647.05500 -270.76500 [57,] -2871.20500 -647.05500 [58,] -3288.31500 -2871.20500 [59,] -3836.75500 -3288.31500 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3596.29875 -3926.01875 2 -3655.68875 -3596.29875 3 -3464.47875 -3655.68875 4 -3623.64875 -3464.47875 5 -3510.26875 -3623.64875 6 -3503.25875 -3510.26875 7 -3374.72875 -3503.25875 8 -2983.51875 -3374.72875 9 -2658.71875 -2983.51875 10 -2362.64875 -2658.71875 11 -2061.46875 -2362.64875 12 -1874.63875 -2061.46875 13 -1510.87875 -1874.63875 14 -1396.07875 -1510.87875 15 -1370.66875 -1396.07875 16 -1480.31875 -1370.66875 17 -1327.77875 -1480.31875 18 -1076.93875 -1327.77875 19 -771.59875 -1076.93875 20 -618.34875 -771.59875 21 -559.71875 -618.34875 22 -385.19875 -559.71875 23 21.23125 -385.19875 24 608.52125 21.23125 25 1057.98125 608.52125 26 1354.06125 1057.98125 27 1278.76125 1354.06125 28 1016.95125 1278.76125 29 322.53125 1016.95125 30 716.92125 322.53125 31 1195.90125 716.92125 32 1518.65125 1195.90125 33 1961.93125 1518.65125 34 2181.72125 1961.93125 35 2473.14125 2181.72125 36 2925.69125 2473.14125 37 3133.84125 2925.69125 38 2794.95125 3133.84125 39 3482.19125 2794.95125 40 3781.37125 3482.19125 41 3560.25125 3781.37125 42 3382.84125 3560.25125 43 2357.61125 3382.84125 44 2622.56125 2357.61125 45 3018.71125 2622.56125 46 2126.63125 3018.71125 47 2197.95125 2126.63125 48 2142.14500 2197.95125 49 1751.84500 2142.14500 50 1659.70500 1751.84500 51 2183.97500 1659.70500 52 2049.72500 2183.97500 53 1254.37500 2049.72500 54 -127.67500 1254.37500 55 -270.76500 -127.67500 56 -647.05500 -270.76500 57 -2871.20500 -647.05500 58 -3288.31500 -2871.20500 59 -3836.75500 -3288.31500 > 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/7nqon1258666120.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/812a91258666120.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/9roys1258666120.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/10eqk41258666120.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/11ex8w1258666120.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/12vobf1258666120.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/13i0ky1258666120.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/14tmma1258666120.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/15bge91258666120.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/16lxc01258666120.tab") + } > > system("convert tmp/1uh3d1258666120.ps tmp/1uh3d1258666120.png") > system("convert tmp/2ysay1258666120.ps tmp/2ysay1258666120.png") > system("convert tmp/3dl0t1258666120.ps tmp/3dl0t1258666120.png") > system("convert tmp/4h6wp1258666120.ps tmp/4h6wp1258666120.png") > system("convert tmp/5olnl1258666120.ps tmp/5olnl1258666120.png") > system("convert tmp/6lpp91258666120.ps tmp/6lpp91258666120.png") > system("convert tmp/7nqon1258666120.ps tmp/7nqon1258666120.png") > system("convert tmp/812a91258666120.ps tmp/812a91258666120.png") > system("convert tmp/9roys1258666120.ps tmp/9roys1258666120.png") > system("convert tmp/10eqk41258666120.ps tmp/10eqk41258666120.png") > > > proc.time() user system elapsed 2.532 1.615 3.240