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(16198.9
+ ,16896.2
+ ,0
+ ,16554.2
+ ,16698
+ ,0
+ ,19554.2
+ ,19691.6
+ ,0
+ ,15903.8
+ ,15930.7
+ ,0
+ ,18003.8
+ ,17444.6
+ ,0
+ ,18329.6
+ ,17699.4
+ ,0
+ ,16260.7
+ ,15189.8
+ ,0
+ ,14851.9
+ ,15672.7
+ ,0
+ ,18174.1
+ ,17180.8
+ ,0
+ ,18406.6
+ ,17664.9
+ ,0
+ ,18466.5
+ ,17862.9
+ ,0
+ ,16016.5
+ ,16162.3
+ ,0
+ ,17428.5
+ ,17463.6
+ ,0
+ ,17167.2
+ ,16772.1
+ ,0
+ ,19630
+ ,19106.9
+ ,0
+ ,17183.6
+ ,16721.3
+ ,0
+ ,18344.7
+ ,18161.3
+ ,0
+ ,19301.4
+ ,18509.9
+ ,0
+ ,18147.5
+ ,17802.7
+ ,0
+ ,16192.9
+ ,16409.9
+ ,0
+ ,18374.4
+ ,17967.7
+ ,0
+ ,20515.2
+ ,20286.6
+ ,0
+ ,18957.2
+ ,19537.3
+ ,0
+ ,16471.5
+ ,18021.9
+ ,0
+ ,18746.8
+ ,20194.3
+ ,0
+ ,19009.5
+ ,19049.6
+ ,0
+ ,19211.2
+ ,20244.7
+ ,0
+ ,20547.7
+ ,21473.3
+ ,0
+ ,19325.8
+ ,19673.6
+ ,0
+ ,20605.5
+ ,21053.2
+ ,0
+ ,20056.9
+ ,20159.5
+ ,0
+ ,16141.4
+ ,18203.6
+ ,0
+ ,20359.8
+ ,21289.5
+ ,0
+ ,19711.6
+ ,20432.3
+ ,1
+ ,15638.6
+ ,17180.4
+ ,1
+ ,14384.5
+ ,15816.8
+ ,1
+ ,13855.6
+ ,15071.8
+ ,1
+ ,14308.3
+ ,14521.1
+ ,1
+ ,15290.6
+ ,15668.8
+ ,1
+ ,14423.8
+ ,14346.9
+ ,1
+ ,13779.7
+ ,13881
+ ,1
+ ,15686.3
+ ,15465.9
+ ,1
+ ,14733.8
+ ,14238.2
+ ,1
+ ,12522.5
+ ,13557.7
+ ,1
+ ,16189.4
+ ,16127.6
+ ,1
+ ,16059.1
+ ,16793.9
+ ,1
+ ,16007.1
+ ,16014
+ ,1
+ ,15806.8
+ ,16867.9
+ ,1
+ ,15160
+ ,16014.6
+ ,0
+ ,15692.1
+ ,15878.6
+ ,0
+ ,18908.9
+ ,18664.9
+ ,0
+ ,16969.9
+ ,17962.5
+ ,0
+ ,16997.5
+ ,17332.7
+ ,0
+ ,19858.9
+ ,19542.1
+ ,0
+ ,17681.2
+ ,17203.6
+ ,0)
+ ,dim=c(3
+ ,55)
+ ,dimnames=list(c('uitvoer'
+ ,'invoer'
+ ,'crisis')
+ ,1:55))
> y <- array(NA,dim=c(3,55),dimnames=list(c('uitvoer','invoer','crisis'),1:55))
> 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
uitvoer invoer crisis
1 16198.9 16896.2 0
2 16554.2 16698.0 0
3 19554.2 19691.6 0
4 15903.8 15930.7 0
5 18003.8 17444.6 0
6 18329.6 17699.4 0
7 16260.7 15189.8 0
8 14851.9 15672.7 0
9 18174.1 17180.8 0
10 18406.6 17664.9 0
11 18466.5 17862.9 0
12 16016.5 16162.3 0
13 17428.5 17463.6 0
14 17167.2 16772.1 0
15 19630.0 19106.9 0
16 17183.6 16721.3 0
17 18344.7 18161.3 0
18 19301.4 18509.9 0
19 18147.5 17802.7 0
20 16192.9 16409.9 0
21 18374.4 17967.7 0
22 20515.2 20286.6 0
23 18957.2 19537.3 0
24 16471.5 18021.9 0
25 18746.8 20194.3 0
26 19009.5 19049.6 0
27 19211.2 20244.7 0
28 20547.7 21473.3 0
29 19325.8 19673.6 0
30 20605.5 21053.2 0
31 20056.9 20159.5 0
32 16141.4 18203.6 0
33 20359.8 21289.5 0
34 19711.6 20432.3 1
35 15638.6 17180.4 1
36 14384.5 15816.8 1
37 13855.6 15071.8 1
38 14308.3 14521.1 1
39 15290.6 15668.8 1
40 14423.8 14346.9 1
41 13779.7 13881.0 1
42 15686.3 15465.9 1
43 14733.8 14238.2 1
44 12522.5 13557.7 1
45 16189.4 16127.6 1
46 16059.1 16793.9 1
47 16007.1 16014.0 1
48 15806.8 16867.9 1
49 15160.0 16014.6 0
50 15692.1 15878.6 0
51 18908.9 18664.9 0
52 16969.9 17962.5 0
53 16997.5 17332.7 0
54 19858.9 19542.1 0
55 17681.2 17203.6 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) invoer crisis
2113.9401 0.8763 -673.8941
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1924.7 -397.1 143.2 524.4 1004.3
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2113.94009 1023.76892 2.065 0.04394 *
invoer 0.87632 0.05619 15.596 < 2e-16 ***
crisis -673.89410 245.81904 -2.741 0.00837 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 680.3 on 52 degrees of freedom
Multiple R-squared: 0.8907, Adjusted R-squared: 0.8865
F-statistic: 211.8 on 2 and 52 DF, p-value: < 2.2e-16
> 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.5122358 0.9755284 0.4877642
[2,] 0.5875490 0.8249020 0.4124510
[3,] 0.7080543 0.5838915 0.2919457
[4,] 0.7550401 0.4899198 0.2449599
[5,] 0.7236508 0.5526985 0.2763492
[6,] 0.6637127 0.6725747 0.3362873
[7,] 0.5801873 0.8396254 0.4198127
[8,] 0.4885323 0.9770647 0.5114677
[9,] 0.4045077 0.8090155 0.5954923
[10,] 0.3498001 0.6996002 0.6501999
[11,] 0.2892480 0.5784959 0.7107520
[12,] 0.2253534 0.4507069 0.7746466
[13,] 0.2390494 0.4780988 0.7609506
[14,] 0.1950004 0.3900008 0.8049996
[15,] 0.1566870 0.3133740 0.8433130
[16,] 0.1331213 0.2662426 0.8668787
[17,] 0.1228754 0.2457507 0.8771246
[18,] 0.1527855 0.3055710 0.8472145
[19,] 0.4868681 0.9737362 0.5131319
[20,] 0.6574124 0.6851752 0.3425876
[21,] 0.5975250 0.8049501 0.4024750
[22,] 0.5880110 0.8239779 0.4119890
[23,] 0.5273742 0.9452516 0.4726258
[24,] 0.4483804 0.8967609 0.5516196
[25,] 0.3717842 0.7435684 0.6282158
[26,] 0.3235043 0.6470086 0.6764957
[27,] 0.7756534 0.4486932 0.2243466
[28,] 0.7313892 0.5372215 0.2686108
[29,] 0.6573292 0.6853417 0.3426708
[30,] 0.7412625 0.5174751 0.2587375
[31,] 0.8137855 0.3724289 0.1862145
[32,] 0.8510292 0.2979416 0.1489708
[33,] 0.8027251 0.3945498 0.1972749
[34,] 0.7416698 0.5166603 0.2583302
[35,] 0.6940552 0.6118896 0.3059448
[36,] 0.6167348 0.7665304 0.3832652
[37,] 0.5993080 0.8013841 0.4006920
[38,] 0.7572512 0.4854977 0.2427488
[39,] 0.6891314 0.6217372 0.3108686
[40,] 0.6788738 0.6422525 0.3211262
[41,] 0.5670590 0.8658821 0.4329410
[42,] 0.6375620 0.7248760 0.3624380
[43,] 0.4900987 0.9801974 0.5099013
[44,] 0.4170778 0.8341556 0.5829222
> postscript(file="/var/www/html/rcomp/tmp/15oot1290252021.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/2xxne1290252021.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/3xxne1290252021.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/4xxne1290252021.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/5xxne1290252021.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 = 55
Frequency = 1
1 2 3 4 5 6
-721.46426 -192.47827 184.17972 -170.48037 602.86360 705.37808
7 8 9 10 11 12
835.68275 -996.29064 1004.33598 812.61101 699.00028 -260.73535
13 14 15 16 17 18
10.91358 355.58666 772.36216 416.50355 315.70734 966.92330
19 20 21 22 23 24
432.75455 -301.31139 515.06227 623.77121 -277.60460 -1435.33410
25 26 27 28 29 30
-1063.74475 202.07511 -643.51111 -383.65395 -28.44658 42.28674
31 32 33 34 35 36
276.85108 -1924.66086 -410.48692 366.38595 -856.91940 -916.07379
37 38 39 40 41 42
-792.11776 143.16991 119.72110 411.32430 175.50030 693.22578
43 44 45 46 47 48
816.57994 -798.38647 616.46695 -97.72295 533.71654 -414.87039
49 50 51 52 53 54
-987.80335 -336.52427 438.59419 -884.88088 -305.37655 619.88908
55
491.45595
> postscript(file="/var/www/html/rcomp/tmp/6qpmz1290252021.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 = 55
Frequency = 1
lag(myerror, k = 1) myerror
0 -721.46426 NA
1 -192.47827 -721.46426
2 184.17972 -192.47827
3 -170.48037 184.17972
4 602.86360 -170.48037
5 705.37808 602.86360
6 835.68275 705.37808
7 -996.29064 835.68275
8 1004.33598 -996.29064
9 812.61101 1004.33598
10 699.00028 812.61101
11 -260.73535 699.00028
12 10.91358 -260.73535
13 355.58666 10.91358
14 772.36216 355.58666
15 416.50355 772.36216
16 315.70734 416.50355
17 966.92330 315.70734
18 432.75455 966.92330
19 -301.31139 432.75455
20 515.06227 -301.31139
21 623.77121 515.06227
22 -277.60460 623.77121
23 -1435.33410 -277.60460
24 -1063.74475 -1435.33410
25 202.07511 -1063.74475
26 -643.51111 202.07511
27 -383.65395 -643.51111
28 -28.44658 -383.65395
29 42.28674 -28.44658
30 276.85108 42.28674
31 -1924.66086 276.85108
32 -410.48692 -1924.66086
33 366.38595 -410.48692
34 -856.91940 366.38595
35 -916.07379 -856.91940
36 -792.11776 -916.07379
37 143.16991 -792.11776
38 119.72110 143.16991
39 411.32430 119.72110
40 175.50030 411.32430
41 693.22578 175.50030
42 816.57994 693.22578
43 -798.38647 816.57994
44 616.46695 -798.38647
45 -97.72295 616.46695
46 533.71654 -97.72295
47 -414.87039 533.71654
48 -987.80335 -414.87039
49 -336.52427 -987.80335
50 438.59419 -336.52427
51 -884.88088 438.59419
52 -305.37655 -884.88088
53 619.88908 -305.37655
54 491.45595 619.88908
55 NA 491.45595
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -192.47827 -721.46426
[2,] 184.17972 -192.47827
[3,] -170.48037 184.17972
[4,] 602.86360 -170.48037
[5,] 705.37808 602.86360
[6,] 835.68275 705.37808
[7,] -996.29064 835.68275
[8,] 1004.33598 -996.29064
[9,] 812.61101 1004.33598
[10,] 699.00028 812.61101
[11,] -260.73535 699.00028
[12,] 10.91358 -260.73535
[13,] 355.58666 10.91358
[14,] 772.36216 355.58666
[15,] 416.50355 772.36216
[16,] 315.70734 416.50355
[17,] 966.92330 315.70734
[18,] 432.75455 966.92330
[19,] -301.31139 432.75455
[20,] 515.06227 -301.31139
[21,] 623.77121 515.06227
[22,] -277.60460 623.77121
[23,] -1435.33410 -277.60460
[24,] -1063.74475 -1435.33410
[25,] 202.07511 -1063.74475
[26,] -643.51111 202.07511
[27,] -383.65395 -643.51111
[28,] -28.44658 -383.65395
[29,] 42.28674 -28.44658
[30,] 276.85108 42.28674
[31,] -1924.66086 276.85108
[32,] -410.48692 -1924.66086
[33,] 366.38595 -410.48692
[34,] -856.91940 366.38595
[35,] -916.07379 -856.91940
[36,] -792.11776 -916.07379
[37,] 143.16991 -792.11776
[38,] 119.72110 143.16991
[39,] 411.32430 119.72110
[40,] 175.50030 411.32430
[41,] 693.22578 175.50030
[42,] 816.57994 693.22578
[43,] -798.38647 816.57994
[44,] 616.46695 -798.38647
[45,] -97.72295 616.46695
[46,] 533.71654 -97.72295
[47,] -414.87039 533.71654
[48,] -987.80335 -414.87039
[49,] -336.52427 -987.80335
[50,] 438.59419 -336.52427
[51,] -884.88088 438.59419
[52,] -305.37655 -884.88088
[53,] 619.88908 -305.37655
[54,] 491.45595 619.88908
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -192.47827 -721.46426
2 184.17972 -192.47827
3 -170.48037 184.17972
4 602.86360 -170.48037
5 705.37808 602.86360
6 835.68275 705.37808
7 -996.29064 835.68275
8 1004.33598 -996.29064
9 812.61101 1004.33598
10 699.00028 812.61101
11 -260.73535 699.00028
12 10.91358 -260.73535
13 355.58666 10.91358
14 772.36216 355.58666
15 416.50355 772.36216
16 315.70734 416.50355
17 966.92330 315.70734
18 432.75455 966.92330
19 -301.31139 432.75455
20 515.06227 -301.31139
21 623.77121 515.06227
22 -277.60460 623.77121
23 -1435.33410 -277.60460
24 -1063.74475 -1435.33410
25 202.07511 -1063.74475
26 -643.51111 202.07511
27 -383.65395 -643.51111
28 -28.44658 -383.65395
29 42.28674 -28.44658
30 276.85108 42.28674
31 -1924.66086 276.85108
32 -410.48692 -1924.66086
33 366.38595 -410.48692
34 -856.91940 366.38595
35 -916.07379 -856.91940
36 -792.11776 -916.07379
37 143.16991 -792.11776
38 119.72110 143.16991
39 411.32430 119.72110
40 175.50030 411.32430
41 693.22578 175.50030
42 816.57994 693.22578
43 -798.38647 816.57994
44 616.46695 -798.38647
45 -97.72295 616.46695
46 533.71654 -97.72295
47 -414.87039 533.71654
48 -987.80335 -414.87039
49 -336.52427 -987.80335
50 438.59419 -336.52427
51 -884.88088 438.59419
52 -305.37655 -884.88088
53 619.88908 -305.37655
54 491.45595 619.88908
> 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/7jglk1290252021.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/8jglk1290252021.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/9bp3n1290252021.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/10bp3n1290252021.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/11fqjt1290252021.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/12irih1290252021.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/13w0fq1290252021.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/14i1ev1290252021.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/15vbfe1290252022.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/16alv51290252022.tab")
+ }
>
> try(system("convert tmp/15oot1290252021.ps tmp/15oot1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/2xxne1290252021.ps tmp/2xxne1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/3xxne1290252021.ps tmp/3xxne1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/4xxne1290252021.ps tmp/4xxne1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/5xxne1290252021.ps tmp/5xxne1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/6qpmz1290252021.ps tmp/6qpmz1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/7jglk1290252021.ps tmp/7jglk1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/8jglk1290252021.ps tmp/8jglk1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/9bp3n1290252021.ps tmp/9bp3n1290252021.png",intern=TRUE))
character(0)
> try(system("convert tmp/10bp3n1290252021.ps tmp/10bp3n1290252021.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.456 1.630 28.199