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(17192.4,0,15386.1,0,14287.1,0,17526.6,0,14497,0,14398.3,0,16629.6,0,16670.7,0,16614.8,0,16869.2,0,15663.9,0,16359.9,0,18447.7,0,16889,0,16505,0,18320.9,0,15052.1,0,15699.8,0,18135.3,0,16768.7,0,18883,0,19021,0,18101.9,0,17776.1,0,21489.9,0,17065.3,0,18690,0,18953.1,0,16398.9,0,16895.6,0,18553,0,19270,0,19422.1,0,17579.4,0,18637.3,0,18076.7,0,20438.6,0,18075.2,0,19563,0,19899.2,0,19227.5,0,17789.6,0,19220.8,0,21968.9,0,21131.5,0,19484.6,0,22168.7,1,20866.8,1,22176.2,1,23533.8,1,21479.6,1,24347.7,1,22751.6,1,20328.3,1,23650.4,1,23335.7,1,19614.9,1,18042.3,1,17282.5,1,16847.2,1,18159.5,1),dim=c(2,61),dimnames=list(c('Invoer','Dummy'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Invoer','Dummy'),1:61))
> 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
Invoer Dummy
1 17192.4 0
2 15386.1 0
3 14287.1 0
4 17526.6 0
5 14497.0 0
6 14398.3 0
7 16629.6 0
8 16670.7 0
9 16614.8 0
10 16869.2 0
11 15663.9 0
12 16359.9 0
13 18447.7 0
14 16889.0 0
15 16505.0 0
16 18320.9 0
17 15052.1 0
18 15699.8 0
19 18135.3 0
20 16768.7 0
21 18883.0 0
22 19021.0 0
23 18101.9 0
24 17776.1 0
25 21489.9 0
26 17065.3 0
27 18690.0 0
28 18953.1 0
29 16398.9 0
30 16895.6 0
31 18553.0 0
32 19270.0 0
33 19422.1 0
34 17579.4 0
35 18637.3 0
36 18076.7 0
37 20438.6 0
38 18075.2 0
39 19563.0 0
40 19899.2 0
41 19227.5 0
42 17789.6 0
43 19220.8 0
44 21968.9 0
45 21131.5 0
46 19484.6 0
47 22168.7 1
48 20866.8 1
49 22176.2 1
50 23533.8 1
51 21479.6 1
52 24347.7 1
53 22751.6 1
54 20328.3 1
55 23650.4 1
56 23335.7 1
57 19614.9 1
58 18042.3 1
59 17282.5 1
60 16847.2 1
61 18159.5 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
17816 3157
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4125.1 -1201.0 259.4 1405.0 4153.1
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 17815.8 293.2 60.764 < 2e-16 ***
Dummy 3156.6 591.3 5.339 1.57e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1989 on 59 degrees of freedom
Multiple R-squared: 0.3257, Adjusted R-squared: 0.3143
F-statistic: 28.5 on 1 and 59 DF, p-value: 1.567e-06
> 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.507733467 0.98453307 0.4922665
[2,] 0.440652711 0.88130542 0.5593473
[3,] 0.342119231 0.68423846 0.6578808
[4,] 0.256938037 0.51387607 0.7430620
[5,] 0.183630466 0.36726093 0.8163695
[6,] 0.134273712 0.26854742 0.8657263
[7,] 0.092074020 0.18414804 0.9079260
[8,] 0.059596223 0.11919245 0.9404038
[9,] 0.102353238 0.20470648 0.8976468
[10,] 0.072347209 0.14469442 0.9276528
[11,] 0.048760925 0.09752185 0.9512391
[12,] 0.060064374 0.12012875 0.9399356
[13,] 0.068836675 0.13767335 0.9311633
[14,] 0.060790284 0.12158057 0.9392097
[15,] 0.065273578 0.13054716 0.9347264
[16,] 0.049738140 0.09947628 0.9502619
[17,] 0.073170579 0.14634116 0.9268294
[18,] 0.097245918 0.19449184 0.9027541
[19,] 0.084734903 0.16946981 0.9152651
[20,] 0.068246557 0.13649311 0.9317534
[21,] 0.282533105 0.56506621 0.7174669
[22,] 0.242702463 0.48540493 0.7572975
[23,] 0.218609530 0.43721906 0.7813905
[24,] 0.201733227 0.40346645 0.7982668
[25,] 0.196398214 0.39279643 0.8036018
[26,] 0.179005746 0.35801149 0.8209943
[27,] 0.154254637 0.30850927 0.8457454
[28,] 0.146164636 0.29232927 0.8538354
[29,] 0.139090385 0.27818077 0.8609096
[30,] 0.117101773 0.23420355 0.8828982
[31,] 0.096247114 0.19249423 0.9037529
[32,] 0.078481094 0.15696219 0.9215189
[33,] 0.093851241 0.18770248 0.9061488
[34,] 0.076510170 0.15302034 0.9234898
[35,] 0.066477017 0.13295403 0.9335230
[36,] 0.060102320 0.12020464 0.9398977
[37,] 0.047139959 0.09427992 0.9528600
[38,] 0.043061945 0.08612389 0.9569381
[39,] 0.035951788 0.07190358 0.9640482
[40,] 0.058494743 0.11698949 0.9415053
[41,] 0.062929793 0.12585959 0.9370702
[42,] 0.044924402 0.08984880 0.9550756
[43,] 0.030731186 0.06146237 0.9692688
[44,] 0.018839760 0.03767952 0.9811602
[45,] 0.012244502 0.02448900 0.9877555
[46,] 0.013976370 0.02795274 0.9860236
[47,] 0.008117993 0.01623599 0.9918820
[48,] 0.022171816 0.04434363 0.9778282
[49,] 0.026134279 0.05226856 0.9738657
[50,] 0.015486133 0.03097227 0.9845139
[51,] 0.068274713 0.13654943 0.9317253
[52,] 0.685688706 0.62862259 0.3143113
> postscript(file="/var/www/html/rcomp/tmp/1jk8h1260550494.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/2giqw1260550494.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/3an351260550494.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/4cwai1260550494.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/5qyl41260550494.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 = 61
Frequency = 1
1 2 3 4 5 6
-623.38913 -2429.68913 -3528.68913 -289.18913 -3318.78913 -3417.48913
7 8 9 10 11 12
-1186.18913 -1145.08913 -1200.98913 -946.58913 -2151.88913 -1455.88913
13 14 15 16 17 18
631.91087 -926.78913 -1310.78913 505.11087 -2763.68913 -2115.98913
19 20 21 22 23 24
319.51087 -1047.08913 1067.21087 1205.21087 286.11087 -39.68913
25 26 27 28 29 30
3674.11087 -750.48913 874.21087 1137.31087 -1416.88913 -920.18913
31 32 33 34 35 36
737.21087 1454.21087 1606.31087 -236.38913 821.51087 260.91087
37 38 39 40 41 42
2622.81087 259.41087 1747.21087 2083.41087 1411.71087 -26.18913
43 44 45 46 47 48
1405.01087 4153.11087 3315.71087 1668.81087 1196.35333 -105.54667
49 50 51 52 53 54
1203.85333 2561.45333 507.25333 3375.35333 1779.25333 -644.04667
55 56 57 58 59 60
2678.05333 2363.35333 -1357.44667 -2930.04667 -3689.84667 -4125.14667
61
-2812.84667
> postscript(file="/var/www/html/rcomp/tmp/6q36s1260550494.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -623.38913 NA
1 -2429.68913 -623.38913
2 -3528.68913 -2429.68913
3 -289.18913 -3528.68913
4 -3318.78913 -289.18913
5 -3417.48913 -3318.78913
6 -1186.18913 -3417.48913
7 -1145.08913 -1186.18913
8 -1200.98913 -1145.08913
9 -946.58913 -1200.98913
10 -2151.88913 -946.58913
11 -1455.88913 -2151.88913
12 631.91087 -1455.88913
13 -926.78913 631.91087
14 -1310.78913 -926.78913
15 505.11087 -1310.78913
16 -2763.68913 505.11087
17 -2115.98913 -2763.68913
18 319.51087 -2115.98913
19 -1047.08913 319.51087
20 1067.21087 -1047.08913
21 1205.21087 1067.21087
22 286.11087 1205.21087
23 -39.68913 286.11087
24 3674.11087 -39.68913
25 -750.48913 3674.11087
26 874.21087 -750.48913
27 1137.31087 874.21087
28 -1416.88913 1137.31087
29 -920.18913 -1416.88913
30 737.21087 -920.18913
31 1454.21087 737.21087
32 1606.31087 1454.21087
33 -236.38913 1606.31087
34 821.51087 -236.38913
35 260.91087 821.51087
36 2622.81087 260.91087
37 259.41087 2622.81087
38 1747.21087 259.41087
39 2083.41087 1747.21087
40 1411.71087 2083.41087
41 -26.18913 1411.71087
42 1405.01087 -26.18913
43 4153.11087 1405.01087
44 3315.71087 4153.11087
45 1668.81087 3315.71087
46 1196.35333 1668.81087
47 -105.54667 1196.35333
48 1203.85333 -105.54667
49 2561.45333 1203.85333
50 507.25333 2561.45333
51 3375.35333 507.25333
52 1779.25333 3375.35333
53 -644.04667 1779.25333
54 2678.05333 -644.04667
55 2363.35333 2678.05333
56 -1357.44667 2363.35333
57 -2930.04667 -1357.44667
58 -3689.84667 -2930.04667
59 -4125.14667 -3689.84667
60 -2812.84667 -4125.14667
61 NA -2812.84667
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2429.68913 -623.38913
[2,] -3528.68913 -2429.68913
[3,] -289.18913 -3528.68913
[4,] -3318.78913 -289.18913
[5,] -3417.48913 -3318.78913
[6,] -1186.18913 -3417.48913
[7,] -1145.08913 -1186.18913
[8,] -1200.98913 -1145.08913
[9,] -946.58913 -1200.98913
[10,] -2151.88913 -946.58913
[11,] -1455.88913 -2151.88913
[12,] 631.91087 -1455.88913
[13,] -926.78913 631.91087
[14,] -1310.78913 -926.78913
[15,] 505.11087 -1310.78913
[16,] -2763.68913 505.11087
[17,] -2115.98913 -2763.68913
[18,] 319.51087 -2115.98913
[19,] -1047.08913 319.51087
[20,] 1067.21087 -1047.08913
[21,] 1205.21087 1067.21087
[22,] 286.11087 1205.21087
[23,] -39.68913 286.11087
[24,] 3674.11087 -39.68913
[25,] -750.48913 3674.11087
[26,] 874.21087 -750.48913
[27,] 1137.31087 874.21087
[28,] -1416.88913 1137.31087
[29,] -920.18913 -1416.88913
[30,] 737.21087 -920.18913
[31,] 1454.21087 737.21087
[32,] 1606.31087 1454.21087
[33,] -236.38913 1606.31087
[34,] 821.51087 -236.38913
[35,] 260.91087 821.51087
[36,] 2622.81087 260.91087
[37,] 259.41087 2622.81087
[38,] 1747.21087 259.41087
[39,] 2083.41087 1747.21087
[40,] 1411.71087 2083.41087
[41,] -26.18913 1411.71087
[42,] 1405.01087 -26.18913
[43,] 4153.11087 1405.01087
[44,] 3315.71087 4153.11087
[45,] 1668.81087 3315.71087
[46,] 1196.35333 1668.81087
[47,] -105.54667 1196.35333
[48,] 1203.85333 -105.54667
[49,] 2561.45333 1203.85333
[50,] 507.25333 2561.45333
[51,] 3375.35333 507.25333
[52,] 1779.25333 3375.35333
[53,] -644.04667 1779.25333
[54,] 2678.05333 -644.04667
[55,] 2363.35333 2678.05333
[56,] -1357.44667 2363.35333
[57,] -2930.04667 -1357.44667
[58,] -3689.84667 -2930.04667
[59,] -4125.14667 -3689.84667
[60,] -2812.84667 -4125.14667
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2429.68913 -623.38913
2 -3528.68913 -2429.68913
3 -289.18913 -3528.68913
4 -3318.78913 -289.18913
5 -3417.48913 -3318.78913
6 -1186.18913 -3417.48913
7 -1145.08913 -1186.18913
8 -1200.98913 -1145.08913
9 -946.58913 -1200.98913
10 -2151.88913 -946.58913
11 -1455.88913 -2151.88913
12 631.91087 -1455.88913
13 -926.78913 631.91087
14 -1310.78913 -926.78913
15 505.11087 -1310.78913
16 -2763.68913 505.11087
17 -2115.98913 -2763.68913
18 319.51087 -2115.98913
19 -1047.08913 319.51087
20 1067.21087 -1047.08913
21 1205.21087 1067.21087
22 286.11087 1205.21087
23 -39.68913 286.11087
24 3674.11087 -39.68913
25 -750.48913 3674.11087
26 874.21087 -750.48913
27 1137.31087 874.21087
28 -1416.88913 1137.31087
29 -920.18913 -1416.88913
30 737.21087 -920.18913
31 1454.21087 737.21087
32 1606.31087 1454.21087
33 -236.38913 1606.31087
34 821.51087 -236.38913
35 260.91087 821.51087
36 2622.81087 260.91087
37 259.41087 2622.81087
38 1747.21087 259.41087
39 2083.41087 1747.21087
40 1411.71087 2083.41087
41 -26.18913 1411.71087
42 1405.01087 -26.18913
43 4153.11087 1405.01087
44 3315.71087 4153.11087
45 1668.81087 3315.71087
46 1196.35333 1668.81087
47 -105.54667 1196.35333
48 1203.85333 -105.54667
49 2561.45333 1203.85333
50 507.25333 2561.45333
51 3375.35333 507.25333
52 1779.25333 3375.35333
53 -644.04667 1779.25333
54 2678.05333 -644.04667
55 2363.35333 2678.05333
56 -1357.44667 2363.35333
57 -2930.04667 -1357.44667
58 -3689.84667 -2930.04667
59 -4125.14667 -3689.84667
60 -2812.84667 -4125.14667
> 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/7rmyq1260550494.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/8hpgn1260550494.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/96ifg1260550494.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/10she11260550494.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/11z33b1260550494.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/12x81u1260550494.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/13b3cd1260550494.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/14gvh11260550494.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/15soz21260550494.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/16kl4u1260550494.tab")
+ }
>
> system("convert tmp/1jk8h1260550494.ps tmp/1jk8h1260550494.png")
> system("convert tmp/2giqw1260550494.ps tmp/2giqw1260550494.png")
> system("convert tmp/3an351260550494.ps tmp/3an351260550494.png")
> system("convert tmp/4cwai1260550494.ps tmp/4cwai1260550494.png")
> system("convert tmp/5qyl41260550494.ps tmp/5qyl41260550494.png")
> system("convert tmp/6q36s1260550494.ps tmp/6q36s1260550494.png")
> system("convert tmp/7rmyq1260550494.ps tmp/7rmyq1260550494.png")
> system("convert tmp/8hpgn1260550494.ps tmp/8hpgn1260550494.png")
> system("convert tmp/96ifg1260550494.ps tmp/96ifg1260550494.png")
> system("convert tmp/10she11260550494.ps tmp/10she11260550494.png")
>
>
> proc.time()
user system elapsed
2.483 1.565 2.897