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(10519.20
+ ,1154.80
+ ,10414.90
+ ,1206.70
+ ,12476.80
+ ,1199.00
+ ,12384.60
+ ,1265.00
+ ,12266.70
+ ,1247.10
+ ,12919.90
+ ,1116.50
+ ,11497.30
+ ,1153.90
+ ,12142.00
+ ,1077.40
+ ,13919.40
+ ,1132.50
+ ,12656.80
+ ,1058.80
+ ,12034.10
+ ,1195.10
+ ,13199.70
+ ,1263.40
+ ,10881.30
+ ,1023.10
+ ,11301.20
+ ,1141.00
+ ,13643.90
+ ,1116.30
+ ,12517.00
+ ,1135.60
+ ,13981.10
+ ,1210.50
+ ,14275.70
+ ,1230.00
+ ,13425.00
+ ,1136.50
+ ,13565.70
+ ,1068.70
+ ,16216.30
+ ,1372.50
+ ,12970.00
+ ,1049.90
+ ,14079.90
+ ,1302.20
+ ,14235.00
+ ,1305.90
+ ,12213.40
+ ,1173.50
+ ,12581.00
+ ,1277.40
+ ,14130.40
+ ,1238.60
+ ,14210.80
+ ,1508.60
+ ,14378.50
+ ,1423.40
+ ,13142.80
+ ,1375.10
+ ,13714.70
+ ,1344.10
+ ,13621.90
+ ,1287.50
+ ,15379.80
+ ,1446.90
+ ,13306.30
+ ,1451.00
+ ,14391.20
+ ,1604.40
+ ,14909.90
+ ,1501.50
+ ,14025.40
+ ,1522.80
+ ,12951.20
+ ,1328.00
+ ,14344.30
+ ,1420.50
+ ,16093.40
+ ,1648.00
+ ,15413.60
+ ,1631.10
+ ,14705.70
+ ,1396.60
+ ,15972.80
+ ,1663.40
+ ,16241.40
+ ,1283.00
+ ,16626.40
+ ,1582.40
+ ,17136.20
+ ,1785.20
+ ,15622.90
+ ,1853.60
+ ,18003.90
+ ,1994.10
+ ,16136.10
+ ,2042.80
+ ,14423.70
+ ,1586.10
+ ,16789.40
+ ,1942.40
+ ,16782.20
+ ,1763.60
+ ,14133.80
+ ,1819.90
+ ,12607.00
+ ,1836.00
+ ,12004.50
+ ,1447.50
+ ,12175.40
+ ,1509.50
+ ,13268.00
+ ,1661.20
+ ,12299.30
+ ,1456.20
+ ,11800.60
+ ,1310.90
+ ,13873.30
+ ,1542.10
+ ,12315.00
+ ,1537.70)
+ ,dim=c(2
+ ,61)
+ ,dimnames=list(c('InvoerEU'
+ ,'InvoerAM')
+ ,1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('InvoerEU','InvoerAM'),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
InvoerEU InvoerAM
1 10519.2 1154.8
2 10414.9 1206.7
3 12476.8 1199.0
4 12384.6 1265.0
5 12266.7 1247.1
6 12919.9 1116.5
7 11497.3 1153.9
8 12142.0 1077.4
9 13919.4 1132.5
10 12656.8 1058.8
11 12034.1 1195.1
12 13199.7 1263.4
13 10881.3 1023.1
14 11301.2 1141.0
15 13643.9 1116.3
16 12517.0 1135.6
17 13981.1 1210.5
18 14275.7 1230.0
19 13425.0 1136.5
20 13565.7 1068.7
21 16216.3 1372.5
22 12970.0 1049.9
23 14079.9 1302.2
24 14235.0 1305.9
25 12213.4 1173.5
26 12581.0 1277.4
27 14130.4 1238.6
28 14210.8 1508.6
29 14378.5 1423.4
30 13142.8 1375.1
31 13714.7 1344.1
32 13621.9 1287.5
33 15379.8 1446.9
34 13306.3 1451.0
35 14391.2 1604.4
36 14909.9 1501.5
37 14025.4 1522.8
38 12951.2 1328.0
39 14344.3 1420.5
40 16093.4 1648.0
41 15413.6 1631.1
42 14705.7 1396.6
43 15972.8 1663.4
44 16241.4 1283.0
45 16626.4 1582.4
46 17136.2 1785.2
47 15622.9 1853.6
48 18003.9 1994.1
49 16136.1 2042.8
50 14423.7 1586.1
51 16789.4 1942.4
52 16782.2 1763.6
53 14133.8 1819.9
54 12607.0 1836.0
55 12004.5 1447.5
56 12175.4 1509.5
57 13268.0 1661.2
58 12299.3 1456.2
59 11800.6 1310.9
60 13873.3 1542.1
61 12315.0 1537.7
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) InvoerAM
7568.587 4.423
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3082.71 -779.42 -30.73 959.57 2997.76
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7568.5874 926.7590 8.167 2.86e-11 ***
InvoerAM 4.4233 0.6517 6.788 6.18e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1292 on 59 degrees of freedom
Multiple R-squared: 0.4385, Adjusted R-squared: 0.429
F-statistic: 46.07 on 1 and 59 DF, p-value: 6.182e-09
> 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.326175141 0.652350281 0.67382486
[2,] 0.534070916 0.931858169 0.46592908
[3,] 0.401816708 0.803633417 0.59818329
[4,] 0.287607485 0.575214969 0.71239252
[5,] 0.445179614 0.890359229 0.55482039
[6,] 0.334654723 0.669309446 0.66534528
[7,] 0.245869328 0.491738656 0.75413067
[8,] 0.245618357 0.491236714 0.75438164
[9,] 0.256074965 0.512149929 0.74392504
[10,] 0.228795682 0.457591363 0.77120432
[11,] 0.270784672 0.541569344 0.72921533
[12,] 0.207299708 0.414599416 0.79270029
[13,] 0.247459773 0.494919545 0.75254023
[14,] 0.294089945 0.588179891 0.70591005
[15,] 0.265089855 0.530179711 0.73491014
[16,] 0.260600445 0.521200890 0.73939955
[17,] 0.489149109 0.978298218 0.51085089
[18,] 0.446869925 0.893739850 0.55313008
[19,] 0.384230939 0.768461879 0.61576906
[20,] 0.330906097 0.661812194 0.66909390
[21,] 0.275577607 0.551155214 0.72442239
[22,] 0.237547571 0.475095143 0.76245243
[23,] 0.212498646 0.424997292 0.78750135
[24,] 0.168779142 0.337558284 0.83122086
[25,] 0.127862042 0.255724084 0.87213796
[26,] 0.101163134 0.202326267 0.89883687
[27,] 0.071673394 0.143346789 0.92832661
[28,] 0.050248573 0.100497145 0.94975143
[29,] 0.048555169 0.097110338 0.95144483
[30,] 0.039661939 0.079323878 0.96033806
[31,] 0.028028758 0.056057516 0.97197124
[32,] 0.019774270 0.039548540 0.98022573
[33,] 0.012964425 0.025928851 0.98703557
[34,] 0.008385958 0.016771915 0.99161404
[35,] 0.005283277 0.010566554 0.99471672
[36,] 0.004418301 0.008836602 0.99558170
[37,] 0.002730571 0.005461143 0.99726943
[38,] 0.002192875 0.004385751 0.99780712
[39,] 0.001636260 0.003272520 0.99836374
[40,] 0.055069837 0.110139674 0.94493016
[41,] 0.181691544 0.363383088 0.81830846
[42,] 0.273292620 0.546585240 0.72670738
[43,] 0.226507032 0.453014065 0.77349297
[44,] 0.282181732 0.564363465 0.71781827
[45,] 0.240550769 0.481101538 0.75944923
[46,] 0.224394866 0.448789733 0.77560513
[47,] 0.236525923 0.473051845 0.76347408
[48,] 0.895190587 0.209618826 0.10480941
[49,] 0.901222748 0.197554503 0.09877725
[50,] 0.943293870 0.113412261 0.05670613
[51,] 0.896734927 0.206530147 0.10326507
[52,] 0.835869838 0.328260325 0.16413016
> postscript(file="/var/www/html/rcomp/tmp/15usg1262179463.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/285cz1262179463.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/3a5y21262179463.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/4w42e1262179463.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/50lsj1262179463.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
-2157.37912 -2491.24681 -395.28764 -779.42343 -818.14690 412.73210
7 8 9 10 11 12
-1175.29818 -192.21806 1341.45979 404.85475 -820.73689 42.75380
13 14 15 16 17 18
-1212.73452 -1314.33800 1137.61675 -74.65235 1058.14476 1266.49100
19 20 21 22 23 24
829.36671 1269.96438 2576.77509 757.42185 751.33094 890.06484
25 26 27 28 29 30
-545.89427 -637.87197 1083.15089 -30.73189 513.83067 -508.22541
31 32 33 34 35 36
200.79595 358.35300 1411.18384 -680.45157 -274.08112 699.77332
37 38 39 40 41 42
-278.94232 -491.48941 492.45815 1235.26433 630.21758 959.57430
43 44 45 46 47 48
1046.54598 2997.75772 2058.43081 1671.19175 -144.65989 1614.87073
49 50 51 52 53 54
-468.34249 -160.63529 629.05377 1412.73437 -1484.69571 -3082.71035
55 56 57 58 59 60
-1966.77012 -2070.11284 -1648.52283 -1710.45257 -1566.45150 -516.41142
61
-2055.24904
> postscript(file="/var/www/html/rcomp/tmp/6naxr1262179463.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 -2157.37912 NA
1 -2491.24681 -2157.37912
2 -395.28764 -2491.24681
3 -779.42343 -395.28764
4 -818.14690 -779.42343
5 412.73210 -818.14690
6 -1175.29818 412.73210
7 -192.21806 -1175.29818
8 1341.45979 -192.21806
9 404.85475 1341.45979
10 -820.73689 404.85475
11 42.75380 -820.73689
12 -1212.73452 42.75380
13 -1314.33800 -1212.73452
14 1137.61675 -1314.33800
15 -74.65235 1137.61675
16 1058.14476 -74.65235
17 1266.49100 1058.14476
18 829.36671 1266.49100
19 1269.96438 829.36671
20 2576.77509 1269.96438
21 757.42185 2576.77509
22 751.33094 757.42185
23 890.06484 751.33094
24 -545.89427 890.06484
25 -637.87197 -545.89427
26 1083.15089 -637.87197
27 -30.73189 1083.15089
28 513.83067 -30.73189
29 -508.22541 513.83067
30 200.79595 -508.22541
31 358.35300 200.79595
32 1411.18384 358.35300
33 -680.45157 1411.18384
34 -274.08112 -680.45157
35 699.77332 -274.08112
36 -278.94232 699.77332
37 -491.48941 -278.94232
38 492.45815 -491.48941
39 1235.26433 492.45815
40 630.21758 1235.26433
41 959.57430 630.21758
42 1046.54598 959.57430
43 2997.75772 1046.54598
44 2058.43081 2997.75772
45 1671.19175 2058.43081
46 -144.65989 1671.19175
47 1614.87073 -144.65989
48 -468.34249 1614.87073
49 -160.63529 -468.34249
50 629.05377 -160.63529
51 1412.73437 629.05377
52 -1484.69571 1412.73437
53 -3082.71035 -1484.69571
54 -1966.77012 -3082.71035
55 -2070.11284 -1966.77012
56 -1648.52283 -2070.11284
57 -1710.45257 -1648.52283
58 -1566.45150 -1710.45257
59 -516.41142 -1566.45150
60 -2055.24904 -516.41142
61 NA -2055.24904
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2491.24681 -2157.37912
[2,] -395.28764 -2491.24681
[3,] -779.42343 -395.28764
[4,] -818.14690 -779.42343
[5,] 412.73210 -818.14690
[6,] -1175.29818 412.73210
[7,] -192.21806 -1175.29818
[8,] 1341.45979 -192.21806
[9,] 404.85475 1341.45979
[10,] -820.73689 404.85475
[11,] 42.75380 -820.73689
[12,] -1212.73452 42.75380
[13,] -1314.33800 -1212.73452
[14,] 1137.61675 -1314.33800
[15,] -74.65235 1137.61675
[16,] 1058.14476 -74.65235
[17,] 1266.49100 1058.14476
[18,] 829.36671 1266.49100
[19,] 1269.96438 829.36671
[20,] 2576.77509 1269.96438
[21,] 757.42185 2576.77509
[22,] 751.33094 757.42185
[23,] 890.06484 751.33094
[24,] -545.89427 890.06484
[25,] -637.87197 -545.89427
[26,] 1083.15089 -637.87197
[27,] -30.73189 1083.15089
[28,] 513.83067 -30.73189
[29,] -508.22541 513.83067
[30,] 200.79595 -508.22541
[31,] 358.35300 200.79595
[32,] 1411.18384 358.35300
[33,] -680.45157 1411.18384
[34,] -274.08112 -680.45157
[35,] 699.77332 -274.08112
[36,] -278.94232 699.77332
[37,] -491.48941 -278.94232
[38,] 492.45815 -491.48941
[39,] 1235.26433 492.45815
[40,] 630.21758 1235.26433
[41,] 959.57430 630.21758
[42,] 1046.54598 959.57430
[43,] 2997.75772 1046.54598
[44,] 2058.43081 2997.75772
[45,] 1671.19175 2058.43081
[46,] -144.65989 1671.19175
[47,] 1614.87073 -144.65989
[48,] -468.34249 1614.87073
[49,] -160.63529 -468.34249
[50,] 629.05377 -160.63529
[51,] 1412.73437 629.05377
[52,] -1484.69571 1412.73437
[53,] -3082.71035 -1484.69571
[54,] -1966.77012 -3082.71035
[55,] -2070.11284 -1966.77012
[56,] -1648.52283 -2070.11284
[57,] -1710.45257 -1648.52283
[58,] -1566.45150 -1710.45257
[59,] -516.41142 -1566.45150
[60,] -2055.24904 -516.41142
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2491.24681 -2157.37912
2 -395.28764 -2491.24681
3 -779.42343 -395.28764
4 -818.14690 -779.42343
5 412.73210 -818.14690
6 -1175.29818 412.73210
7 -192.21806 -1175.29818
8 1341.45979 -192.21806
9 404.85475 1341.45979
10 -820.73689 404.85475
11 42.75380 -820.73689
12 -1212.73452 42.75380
13 -1314.33800 -1212.73452
14 1137.61675 -1314.33800
15 -74.65235 1137.61675
16 1058.14476 -74.65235
17 1266.49100 1058.14476
18 829.36671 1266.49100
19 1269.96438 829.36671
20 2576.77509 1269.96438
21 757.42185 2576.77509
22 751.33094 757.42185
23 890.06484 751.33094
24 -545.89427 890.06484
25 -637.87197 -545.89427
26 1083.15089 -637.87197
27 -30.73189 1083.15089
28 513.83067 -30.73189
29 -508.22541 513.83067
30 200.79595 -508.22541
31 358.35300 200.79595
32 1411.18384 358.35300
33 -680.45157 1411.18384
34 -274.08112 -680.45157
35 699.77332 -274.08112
36 -278.94232 699.77332
37 -491.48941 -278.94232
38 492.45815 -491.48941
39 1235.26433 492.45815
40 630.21758 1235.26433
41 959.57430 630.21758
42 1046.54598 959.57430
43 2997.75772 1046.54598
44 2058.43081 2997.75772
45 1671.19175 2058.43081
46 -144.65989 1671.19175
47 1614.87073 -144.65989
48 -468.34249 1614.87073
49 -160.63529 -468.34249
50 629.05377 -160.63529
51 1412.73437 629.05377
52 -1484.69571 1412.73437
53 -3082.71035 -1484.69571
54 -1966.77012 -3082.71035
55 -2070.11284 -1966.77012
56 -1648.52283 -2070.11284
57 -1710.45257 -1648.52283
58 -1566.45150 -1710.45257
59 -516.41142 -1566.45150
60 -2055.24904 -516.41142
> 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/7kynn1262179463.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/8qkh31262179463.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/9dxq61262179463.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/10str81262179463.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/11yr1o1262179463.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/12pewh1262179463.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/137s0b1262179463.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/14ql8i1262179463.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/15ugsj1262179464.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/16m66j1262179464.tab")
+ }
>
> try(system("convert tmp/15usg1262179463.ps tmp/15usg1262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/285cz1262179463.ps tmp/285cz1262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/3a5y21262179463.ps tmp/3a5y21262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/4w42e1262179463.ps tmp/4w42e1262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/50lsj1262179463.ps tmp/50lsj1262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/6naxr1262179463.ps tmp/6naxr1262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/7kynn1262179463.ps tmp/7kynn1262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qkh31262179463.ps tmp/8qkh31262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/9dxq61262179463.ps tmp/9dxq61262179463.png",intern=TRUE))
character(0)
> try(system("convert tmp/10str81262179463.ps tmp/10str81262179463.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.522 1.584 3.953