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(296.95,17.20,296.84,17.20,287.54,17.20,287.81,17.20,283.99,20.63,275.79,20.63,269.52,20.63,278.35,20.63,283.43,19.32,289.46,19.32,282.30,19.32,293.55,19.32,304.78,12.99,300.99,12.99,315.29,12.99,316.21,12.99,331.79,18.13,329.38,18.13,317.27,18.13,317.98,18.13,340.28,28.37,339.21,28.37,336.71,28.37,340.11,28.37,347.72,24.35,328.68,24.35,303.05,24.35,299.83,24.35,320.04,24.99,317.94,24.99,303.31,24.99,308.85,24.99,319.19,28.84,314.52,28.84,312.39,28.84,315.77,28.84,320.23,37.88,309.45,37.88,296.54,37.88,297.28,37.88,301.39,54.04,306.68,54.04,305.91,54.04,314.76,54.04,323.34,64.93,341.58,64.93,330.12,64.93,318.16,64.93,317.84,71.81,325.39,71.81,327.56,71.81,329.77,71.81,333.29,99.75,346.10,99.75,358.00,99.75,344.82,99.75,313.30,61.25,301.26,61.25,306.38,61.25,319.31,61.25),dim=c(2,60),dimnames=list(c('Gemiddelde_prijs_vliegticket_in$','Gemiddelde_olieprijs_in$'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Gemiddelde_prijs_vliegticket_in$','Gemiddelde_olieprijs_in$'),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 = 'Linear Trend' > par2 = 'Include Quarterly 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 Gemiddelde_prijs_vliegticket_in$ Gemiddelde_olieprijs_in$ Q1 Q2 Q3 t 1 296.95 17.20 1 0 0 1 2 296.84 17.20 0 1 0 2 3 287.54 17.20 0 0 1 3 4 287.81 17.20 0 0 0 4 5 283.99 20.63 1 0 0 5 6 275.79 20.63 0 1 0 6 7 269.52 20.63 0 0 1 7 8 278.35 20.63 0 0 0 8 9 283.43 19.32 1 0 0 9 10 289.46 19.32 0 1 0 10 11 282.30 19.32 0 0 1 11 12 293.55 19.32 0 0 0 12 13 304.78 12.99 1 0 0 13 14 300.99 12.99 0 1 0 14 15 315.29 12.99 0 0 1 15 16 316.21 12.99 0 0 0 16 17 331.79 18.13 1 0 0 17 18 329.38 18.13 0 1 0 18 19 317.27 18.13 0 0 1 19 20 317.98 18.13 0 0 0 20 21 340.28 28.37 1 0 0 21 22 339.21 28.37 0 1 0 22 23 336.71 28.37 0 0 1 23 24 340.11 28.37 0 0 0 24 25 347.72 24.35 1 0 0 25 26 328.68 24.35 0 1 0 26 27 303.05 24.35 0 0 1 27 28 299.83 24.35 0 0 0 28 29 320.04 24.99 1 0 0 29 30 317.94 24.99 0 1 0 30 31 303.31 24.99 0 0 1 31 32 308.85 24.99 0 0 0 32 33 319.19 28.84 1 0 0 33 34 314.52 28.84 0 1 0 34 35 312.39 28.84 0 0 1 35 36 315.77 28.84 0 0 0 36 37 320.23 37.88 1 0 0 37 38 309.45 37.88 0 1 0 38 39 296.54 37.88 0 0 1 39 40 297.28 37.88 0 0 0 40 41 301.39 54.04 1 0 0 41 42 306.68 54.04 0 1 0 42 43 305.91 54.04 0 0 1 43 44 314.76 54.04 0 0 0 44 45 323.34 64.93 1 0 0 45 46 341.58 64.93 0 1 0 46 47 330.12 64.93 0 0 1 47 48 318.16 64.93 0 0 0 48 49 317.84 71.81 1 0 0 49 50 325.39 71.81 0 1 0 50 51 327.56 71.81 0 0 1 51 52 329.77 71.81 0 0 0 52 53 333.29 99.75 1 0 0 53 54 346.10 99.75 0 1 0 54 55 358.00 99.75 0 0 1 55 56 344.82 99.75 0 0 0 56 57 313.30 61.25 1 0 0 57 58 301.26 61.25 0 1 0 58 59 306.38 61.25 0 0 1 59 60 319.31 61.25 0 0 0 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `Gemiddelde_olieprijs_in$` 292.8217 0.1570 Q1 Q2 4.9071 3.5409 Q3 t -1.6312 0.4135 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -28.701 -11.454 -2.986 12.107 35.831 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 292.8217 6.0181 48.657 <2e-16 *** `Gemiddelde_olieprijs_in$` 0.1570 0.1801 0.872 0.387 Q1 4.9071 6.2915 0.780 0.439 Q2 3.5409 6.2653 0.565 0.574 Q3 -1.6312 6.2495 -0.261 0.795 t 0.4135 0.2566 1.611 0.113 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 17.1 on 54 degrees of freedom Multiple R-squared: 0.3114, Adjusted R-squared: 0.2477 F-statistic: 4.884 on 5 and 54 DF, p-value: 0.000929 > 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.01998978 0.039979562 0.980010219 [2,] 0.01623481 0.032469624 0.983765188 [3,] 0.01004845 0.020096906 0.989951547 [4,] 0.01663012 0.033260234 0.983369883 [5,] 0.02753437 0.055068742 0.972465629 [6,] 0.02503592 0.050071845 0.974964077 [7,] 0.05986749 0.119734986 0.940132507 [8,] 0.04071018 0.081420362 0.959289819 [9,] 0.51135430 0.977291392 0.488645696 [10,] 0.66394338 0.672113243 0.336056621 [11,] 0.62113162 0.757736757 0.378868379 [12,] 0.54716480 0.905670391 0.452835196 [13,] 0.67331743 0.653365134 0.326682567 [14,] 0.65755011 0.684899785 0.342449892 [15,] 0.63709943 0.725801132 0.362900566 [16,] 0.62866408 0.742671846 0.371335923 [17,] 0.79272256 0.414554880 0.207277440 [18,] 0.82979952 0.340400955 0.170200478 [19,] 0.93361326 0.132773485 0.066386742 [20,] 0.98094231 0.038115382 0.019057691 [21,] 0.98759295 0.024814099 0.012407050 [22,] 0.98800162 0.023996766 0.011998383 [23,] 0.98856092 0.022878169 0.011439085 [24,] 0.98602359 0.027952817 0.013976409 [25,] 0.99040240 0.019195204 0.009597602 [26,] 0.98964110 0.020717798 0.010358899 [27,] 0.98698029 0.026039417 0.013019708 [28,] 0.98829967 0.023400654 0.011700327 [29,] 0.99667777 0.006644453 0.003322226 [30,] 0.99592990 0.008140207 0.004070103 [31,] 0.99389125 0.012217501 0.006108750 [32,] 0.99068689 0.018626215 0.009313107 [33,] 0.98557375 0.028852499 0.014426250 [34,] 0.98122093 0.037558147 0.018779074 [35,] 0.98616609 0.027667815 0.013833908 [36,] 0.97899014 0.042019718 0.021009859 [37,] 0.96215715 0.075685699 0.037842850 [38,] 0.98980764 0.020384724 0.010192362 [39,] 0.98184119 0.036317628 0.018158814 [40,] 0.96648655 0.067026898 0.033513449 [41,] 0.92678889 0.146422215 0.073211107 [42,] 0.85372241 0.292555177 0.146277588 [43,] 0.72111307 0.557773855 0.278886928 > postscript(file="/var/www/html/rcomp/tmp/1fawb1292003171.ps",horizontal=F,onefile=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/2fawb1292003171.ps",horizontal=F,onefile=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/3fawb1292003171.ps",horizontal=F,onefile=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/4pjee1292003171.ps",horizontal=F,onefile=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/5pjee1292003171.ps",horizontal=F,onefile=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 -3.8928302 -3.0501636 -7.5914969 -9.3661636 -19.0452509 -26.2925842 7 8 9 10 11 12 -27.8039175 -21.0185842 -21.0534312 -14.0707646 -16.4720979 -7.2667646 13 14 15 16 17 18 -0.3634078 -3.2007412 15.8579255 14.7332588 24.1856798 22.7283465 19 20 21 22 23 24 15.3770132 14.0423465 29.4140027 29.2966693 31.5553360 32.9106693 25 26 27 28 29 30 35.8313267 17.7439934 -3.1273399 -8.3920066 6.3969716 5.2496382 31 32 33 34 35 36 -4.6216951 -1.1263618 3.2886056 -0.4287277 2.1999390 3.5352723 37 38 39 40 41 42 1.2553437 -8.5719896 -16.7233229 -18.0279896 -21.7758486 -15.5331820 43 44 45 46 47 48 -11.5445153 -4.7391820 -3.1895840 16.0030826 9.3017493 -4.7029174 49 50 51 52 53 54 -11.4236985 -2.9210318 4.0076349 4.1729682 -2.0145005 11.7481662 55 56 57 58 59 60 28.4068328 13.1821662 -17.6133784 -28.7007117 -18.8220450 -7.9367117 > postscript(file="/var/www/html/rcomp/tmp/6pjee1292003171.ps",horizontal=F,onefile=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 -3.8928302 NA 1 -3.0501636 -3.8928302 2 -7.5914969 -3.0501636 3 -9.3661636 -7.5914969 4 -19.0452509 -9.3661636 5 -26.2925842 -19.0452509 6 -27.8039175 -26.2925842 7 -21.0185842 -27.8039175 8 -21.0534312 -21.0185842 9 -14.0707646 -21.0534312 10 -16.4720979 -14.0707646 11 -7.2667646 -16.4720979 12 -0.3634078 -7.2667646 13 -3.2007412 -0.3634078 14 15.8579255 -3.2007412 15 14.7332588 15.8579255 16 24.1856798 14.7332588 17 22.7283465 24.1856798 18 15.3770132 22.7283465 19 14.0423465 15.3770132 20 29.4140027 14.0423465 21 29.2966693 29.4140027 22 31.5553360 29.2966693 23 32.9106693 31.5553360 24 35.8313267 32.9106693 25 17.7439934 35.8313267 26 -3.1273399 17.7439934 27 -8.3920066 -3.1273399 28 6.3969716 -8.3920066 29 5.2496382 6.3969716 30 -4.6216951 5.2496382 31 -1.1263618 -4.6216951 32 3.2886056 -1.1263618 33 -0.4287277 3.2886056 34 2.1999390 -0.4287277 35 3.5352723 2.1999390 36 1.2553437 3.5352723 37 -8.5719896 1.2553437 38 -16.7233229 -8.5719896 39 -18.0279896 -16.7233229 40 -21.7758486 -18.0279896 41 -15.5331820 -21.7758486 42 -11.5445153 -15.5331820 43 -4.7391820 -11.5445153 44 -3.1895840 -4.7391820 45 16.0030826 -3.1895840 46 9.3017493 16.0030826 47 -4.7029174 9.3017493 48 -11.4236985 -4.7029174 49 -2.9210318 -11.4236985 50 4.0076349 -2.9210318 51 4.1729682 4.0076349 52 -2.0145005 4.1729682 53 11.7481662 -2.0145005 54 28.4068328 11.7481662 55 13.1821662 28.4068328 56 -17.6133784 13.1821662 57 -28.7007117 -17.6133784 58 -18.8220450 -28.7007117 59 -7.9367117 -18.8220450 60 NA -7.9367117 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.0501636 -3.8928302 [2,] -7.5914969 -3.0501636 [3,] -9.3661636 -7.5914969 [4,] -19.0452509 -9.3661636 [5,] -26.2925842 -19.0452509 [6,] -27.8039175 -26.2925842 [7,] -21.0185842 -27.8039175 [8,] -21.0534312 -21.0185842 [9,] -14.0707646 -21.0534312 [10,] -16.4720979 -14.0707646 [11,] -7.2667646 -16.4720979 [12,] -0.3634078 -7.2667646 [13,] -3.2007412 -0.3634078 [14,] 15.8579255 -3.2007412 [15,] 14.7332588 15.8579255 [16,] 24.1856798 14.7332588 [17,] 22.7283465 24.1856798 [18,] 15.3770132 22.7283465 [19,] 14.0423465 15.3770132 [20,] 29.4140027 14.0423465 [21,] 29.2966693 29.4140027 [22,] 31.5553360 29.2966693 [23,] 32.9106693 31.5553360 [24,] 35.8313267 32.9106693 [25,] 17.7439934 35.8313267 [26,] -3.1273399 17.7439934 [27,] -8.3920066 -3.1273399 [28,] 6.3969716 -8.3920066 [29,] 5.2496382 6.3969716 [30,] -4.6216951 5.2496382 [31,] -1.1263618 -4.6216951 [32,] 3.2886056 -1.1263618 [33,] -0.4287277 3.2886056 [34,] 2.1999390 -0.4287277 [35,] 3.5352723 2.1999390 [36,] 1.2553437 3.5352723 [37,] -8.5719896 1.2553437 [38,] -16.7233229 -8.5719896 [39,] -18.0279896 -16.7233229 [40,] -21.7758486 -18.0279896 [41,] -15.5331820 -21.7758486 [42,] -11.5445153 -15.5331820 [43,] -4.7391820 -11.5445153 [44,] -3.1895840 -4.7391820 [45,] 16.0030826 -3.1895840 [46,] 9.3017493 16.0030826 [47,] -4.7029174 9.3017493 [48,] -11.4236985 -4.7029174 [49,] -2.9210318 -11.4236985 [50,] 4.0076349 -2.9210318 [51,] 4.1729682 4.0076349 [52,] -2.0145005 4.1729682 [53,] 11.7481662 -2.0145005 [54,] 28.4068328 11.7481662 [55,] 13.1821662 28.4068328 [56,] -17.6133784 13.1821662 [57,] -28.7007117 -17.6133784 [58,] -18.8220450 -28.7007117 [59,] -7.9367117 -18.8220450 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.0501636 -3.8928302 2 -7.5914969 -3.0501636 3 -9.3661636 -7.5914969 4 -19.0452509 -9.3661636 5 -26.2925842 -19.0452509 6 -27.8039175 -26.2925842 7 -21.0185842 -27.8039175 8 -21.0534312 -21.0185842 9 -14.0707646 -21.0534312 10 -16.4720979 -14.0707646 11 -7.2667646 -16.4720979 12 -0.3634078 -7.2667646 13 -3.2007412 -0.3634078 14 15.8579255 -3.2007412 15 14.7332588 15.8579255 16 24.1856798 14.7332588 17 22.7283465 24.1856798 18 15.3770132 22.7283465 19 14.0423465 15.3770132 20 29.4140027 14.0423465 21 29.2966693 29.4140027 22 31.5553360 29.2966693 23 32.9106693 31.5553360 24 35.8313267 32.9106693 25 17.7439934 35.8313267 26 -3.1273399 17.7439934 27 -8.3920066 -3.1273399 28 6.3969716 -8.3920066 29 5.2496382 6.3969716 30 -4.6216951 5.2496382 31 -1.1263618 -4.6216951 32 3.2886056 -1.1263618 33 -0.4287277 3.2886056 34 2.1999390 -0.4287277 35 3.5352723 2.1999390 36 1.2553437 3.5352723 37 -8.5719896 1.2553437 38 -16.7233229 -8.5719896 39 -18.0279896 -16.7233229 40 -21.7758486 -18.0279896 41 -15.5331820 -21.7758486 42 -11.5445153 -15.5331820 43 -4.7391820 -11.5445153 44 -3.1895840 -4.7391820 45 16.0030826 -3.1895840 46 9.3017493 16.0030826 47 -4.7029174 9.3017493 48 -11.4236985 -4.7029174 49 -2.9210318 -11.4236985 50 4.0076349 -2.9210318 51 4.1729682 4.0076349 52 -2.0145005 4.1729682 53 11.7481662 -2.0145005 54 28.4068328 11.7481662 55 13.1821662 28.4068328 56 -17.6133784 13.1821662 57 -28.7007117 -17.6133784 58 -18.8220450 -28.7007117 59 -7.9367117 -18.8220450 > 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/70adh1292003171.ps",horizontal=F,onefile=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/8t1u21292003171.ps",horizontal=F,onefile=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/9t1u21292003171.ps",horizontal=F,onefile=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/10t1u21292003171.ps",horizontal=F,onefile=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/11pt9t1292003171.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/12i39e1292003171.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/13herk1292003172.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/14r5qn1292003172.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/15vn6t1292003172.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/169f421292003172.tab") + } > > try(system("convert tmp/1fawb1292003171.ps tmp/1fawb1292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/2fawb1292003171.ps tmp/2fawb1292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/3fawb1292003171.ps tmp/3fawb1292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/4pjee1292003171.ps tmp/4pjee1292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/5pjee1292003171.ps tmp/5pjee1292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/6pjee1292003171.ps tmp/6pjee1292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/70adh1292003171.ps tmp/70adh1292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/8t1u21292003171.ps tmp/8t1u21292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/9t1u21292003171.ps tmp/9t1u21292003171.png",intern=TRUE)) character(0) > try(system("convert tmp/10t1u21292003171.ps tmp/10t1u21292003171.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.502 1.715 6.064