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(17823.2,1.2218,17872,1.249,17420.4,1.2991,16704.4,1.3408,15991.2,1.3119,16583.6,1.3014,19123.5,1.3201,17838.7,1.2938,17209.4,1.2694,18586.5,1.2165,16258.1,1.2037,15141.6,1.2292,19202.1,1.2256,17746.5,1.2015,19090.1,1.1786,18040.3,1.1856,17515.5,1.2103,17751.8,1.1938,21072.4,1.202,17170,1.2271,19439.5,1.277,19795.4,1.265,17574.9,1.2684,16165.4,1.2811,19464.6,1.2727,19932.1,1.2611,19961.2,1.2881,17343.4,1.3213,18924.2,1.2999,18574.1,1.3074,21350.6,1.3242,18594.6,1.3516,19823.1,1.3511,20844.4,1.3419,19640.2,1.3716,17735.4,1.3622,19813.6,1.3896,22160,1.4227,20664.3,1.4684,17877.4,1.457,20906.5,1.4718,21164.1,1.4748,21374.4,1.5527,22952.3,1.5751,21343.5,1.5557,23899.3,1.5553,22392.9,1.577,18274.1,1.4975,22786.7,1.437,22321.5,1.3322,17842.2,1.2732,16373.5,1.3449,15993.8,1.3239,16446.1,1.2785,17729,1.305,16643,1.319,16196.7,1.365,18252.1,1.4016,17570.4,1.4088,15836.8,1.4268),dim=c(2,60),dimnames=list(c('UITV','EUDO'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('UITV','EUDO'),1:60))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> #'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
EUDO UITV
1 1.2218 17823.2
2 1.2490 17872.0
3 1.2991 17420.4
4 1.3408 16704.4
5 1.3119 15991.2
6 1.3014 16583.6
7 1.3201 19123.5
8 1.2938 17838.7
9 1.2694 17209.4
10 1.2165 18586.5
11 1.2037 16258.1
12 1.2292 15141.6
13 1.2256 19202.1
14 1.2015 17746.5
15 1.1786 19090.1
16 1.1856 18040.3
17 1.2103 17515.5
18 1.1938 17751.8
19 1.2020 21072.4
20 1.2271 17170.0
21 1.2770 19439.5
22 1.2650 19795.4
23 1.2684 17574.9
24 1.2811 16165.4
25 1.2727 19464.6
26 1.2611 19932.1
27 1.2881 19961.2
28 1.3213 17343.4
29 1.2999 18924.2
30 1.3074 18574.1
31 1.3242 21350.6
32 1.3516 18594.6
33 1.3511 19823.1
34 1.3419 20844.4
35 1.3716 19640.2
36 1.3622 17735.4
37 1.3896 19813.6
38 1.4227 22160.0
39 1.4684 20664.3
40 1.4570 17877.4
41 1.4718 20906.5
42 1.4748 21164.1
43 1.5527 21374.4
44 1.5751 22952.3
45 1.5557 21343.5
46 1.5553 23899.3
47 1.5770 22392.9
48 1.4975 18274.1
49 1.4370 22786.7
50 1.3322 22321.5
51 1.2732 17842.2
52 1.3449 16373.5
53 1.3239 15993.8
54 1.2785 16446.1
55 1.3050 17729.0
56 1.3190 16643.0
57 1.3650 16196.7
58 1.4016 18252.1
59 1.4088 17570.4
60 1.4268 15836.8
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) UITV
8.249e-01 2.713e-05
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.194482 -0.075950 -0.004635 0.067846 0.176927
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.249e-01 1.063e-01 7.761 1.54e-10 ***
UITV 2.713e-05 5.629e-06 4.819 1.08e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.08961 on 58 degrees of freedom
Multiple R-squared: 0.2859, Adjusted R-squared: 0.2736
F-statistic: 23.22 on 1 and 58 DF, p-value: 1.078e-05
> 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.068038952 0.136077904 0.93196105
[2,] 0.021386691 0.042773382 0.97861331
[3,] 0.048491158 0.096982316 0.95150884
[4,] 0.019496162 0.038992324 0.98050384
[5,] 0.008531586 0.017063173 0.99146841
[6,] 0.007763698 0.015527396 0.99223630
[7,] 0.017150410 0.034300821 0.98284959
[8,] 0.011283605 0.022567209 0.98871640
[9,] 0.008370786 0.016741572 0.99162921
[10,] 0.008489090 0.016978180 0.99151091
[11,] 0.012239036 0.024478071 0.98776096
[12,] 0.014236737 0.028473474 0.98576326
[13,] 0.011255059 0.022510118 0.98874494
[14,] 0.011510635 0.023021271 0.98848936
[15,] 0.014343313 0.028686626 0.98565669
[16,] 0.010515996 0.021031991 0.98948400
[17,] 0.010320114 0.020640228 0.98967989
[18,] 0.010221763 0.020443527 0.98977824
[19,] 0.007029236 0.014058472 0.99297076
[20,] 0.004197429 0.008394857 0.99580257
[21,] 0.004279346 0.008558693 0.99572065
[22,] 0.005350395 0.010700791 0.99464960
[23,] 0.007281653 0.014563307 0.99271835
[24,] 0.007418487 0.014836974 0.99258151
[25,] 0.008165205 0.016330410 0.99183480
[26,] 0.008696246 0.017392493 0.99130375
[27,] 0.019059885 0.038119770 0.98094011
[28,] 0.026457100 0.052914199 0.97354290
[29,] 0.037185921 0.074371841 0.96281408
[30,] 0.057261564 0.114523128 0.94273844
[31,] 0.075106008 0.150212017 0.92489399
[32,] 0.082523837 0.165047674 0.91747616
[33,] 0.101554404 0.203108809 0.89844560
[34,] 0.137231035 0.274462070 0.86276896
[35,] 0.199222982 0.398445963 0.80077702
[36,] 0.332124155 0.664248311 0.66787584
[37,] 0.350304489 0.700608977 0.64969551
[38,] 0.342816431 0.685632862 0.65718357
[39,] 0.452978566 0.905957133 0.54702143
[40,] 0.490352365 0.980704730 0.50964763
[41,] 0.586429463 0.827141074 0.41357054
[42,] 0.553928421 0.892143158 0.44607158
[43,] 0.771633338 0.456733324 0.22836666
[44,] 0.932278395 0.135443210 0.06772160
[45,] 0.936841292 0.126317416 0.06315871
[46,] 0.899844479 0.200311043 0.10015552
[47,] 0.906988160 0.186023680 0.09301184
[48,] 0.845999563 0.308000874 0.15400044
[49,] 0.765185939 0.469628122 0.23481406
[50,] 0.802943316 0.394113369 0.19705668
[51,] 0.810393271 0.379213457 0.18960673
> postscript(file="/var/www/html/rcomp/tmp/1wdth1258916165.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/2xx431258916165.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/3jmix1258916165.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/4ti1i1258916165.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/5iaks1258916165.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 60
Frequency = 1
1 2 3 4 5
-0.0865414962 -0.0606652832 0.0016851725 0.0628079499 0.0532547723
6 7 8 9 10
0.0266848654 -0.0235144535 -0.0149619613 -0.0222910761 -0.1125473705
11 12 13 14 15
-0.0621853664 -0.0063983120 -0.1201466187 -0.1047608718 -0.1641084189
16 17 18 19 20
-0.1286307210 -0.0896945847 -0.1126046438 -0.1944818430 -0.0635222808
21 22 23 24 25
-0.0751865173 -0.0968409397 -0.0332059157 0.0177292865 -0.0801673996
26 27 28 29 30
-0.1044491711 -0.0782385605 0.0259739348 -0.0383080854 -0.0213109983
31 32 33 34 35
-0.0798285143 0.0223329026 -0.0114923516 -0.0483969362 0.0139691372
36 37 38 39 40
0.0562402355 0.0272653528 -0.0032849334 0.0829885976 0.1471882321
41 42 43 44 45
0.0798184905 0.0758306309 0.1480258682 0.1276225156 0.1518640858
46 47 48 49 50
0.0821334511 0.1446972386 0.1769270369 -0.0059852889 -0.0981659090
51 52 53 54 55
-0.0356569051 0.0758842027 0.0651842426 0.0075147982 -0.0007861531
56 57 58 59 60
0.0426735344 0.1007802181 0.0816238261 0.1073161548 0.1723431477
> postscript(file="/var/www/html/rcomp/tmp/6v2js1258916165.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.0865414962 NA
1 -0.0606652832 -0.0865414962
2 0.0016851725 -0.0606652832
3 0.0628079499 0.0016851725
4 0.0532547723 0.0628079499
5 0.0266848654 0.0532547723
6 -0.0235144535 0.0266848654
7 -0.0149619613 -0.0235144535
8 -0.0222910761 -0.0149619613
9 -0.1125473705 -0.0222910761
10 -0.0621853664 -0.1125473705
11 -0.0063983120 -0.0621853664
12 -0.1201466187 -0.0063983120
13 -0.1047608718 -0.1201466187
14 -0.1641084189 -0.1047608718
15 -0.1286307210 -0.1641084189
16 -0.0896945847 -0.1286307210
17 -0.1126046438 -0.0896945847
18 -0.1944818430 -0.1126046438
19 -0.0635222808 -0.1944818430
20 -0.0751865173 -0.0635222808
21 -0.0968409397 -0.0751865173
22 -0.0332059157 -0.0968409397
23 0.0177292865 -0.0332059157
24 -0.0801673996 0.0177292865
25 -0.1044491711 -0.0801673996
26 -0.0782385605 -0.1044491711
27 0.0259739348 -0.0782385605
28 -0.0383080854 0.0259739348
29 -0.0213109983 -0.0383080854
30 -0.0798285143 -0.0213109983
31 0.0223329026 -0.0798285143
32 -0.0114923516 0.0223329026
33 -0.0483969362 -0.0114923516
34 0.0139691372 -0.0483969362
35 0.0562402355 0.0139691372
36 0.0272653528 0.0562402355
37 -0.0032849334 0.0272653528
38 0.0829885976 -0.0032849334
39 0.1471882321 0.0829885976
40 0.0798184905 0.1471882321
41 0.0758306309 0.0798184905
42 0.1480258682 0.0758306309
43 0.1276225156 0.1480258682
44 0.1518640858 0.1276225156
45 0.0821334511 0.1518640858
46 0.1446972386 0.0821334511
47 0.1769270369 0.1446972386
48 -0.0059852889 0.1769270369
49 -0.0981659090 -0.0059852889
50 -0.0356569051 -0.0981659090
51 0.0758842027 -0.0356569051
52 0.0651842426 0.0758842027
53 0.0075147982 0.0651842426
54 -0.0007861531 0.0075147982
55 0.0426735344 -0.0007861531
56 0.1007802181 0.0426735344
57 0.0816238261 0.1007802181
58 0.1073161548 0.0816238261
59 0.1723431477 0.1073161548
60 NA 0.1723431477
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.0606652832 -0.0865414962
[2,] 0.0016851725 -0.0606652832
[3,] 0.0628079499 0.0016851725
[4,] 0.0532547723 0.0628079499
[5,] 0.0266848654 0.0532547723
[6,] -0.0235144535 0.0266848654
[7,] -0.0149619613 -0.0235144535
[8,] -0.0222910761 -0.0149619613
[9,] -0.1125473705 -0.0222910761
[10,] -0.0621853664 -0.1125473705
[11,] -0.0063983120 -0.0621853664
[12,] -0.1201466187 -0.0063983120
[13,] -0.1047608718 -0.1201466187
[14,] -0.1641084189 -0.1047608718
[15,] -0.1286307210 -0.1641084189
[16,] -0.0896945847 -0.1286307210
[17,] -0.1126046438 -0.0896945847
[18,] -0.1944818430 -0.1126046438
[19,] -0.0635222808 -0.1944818430
[20,] -0.0751865173 -0.0635222808
[21,] -0.0968409397 -0.0751865173
[22,] -0.0332059157 -0.0968409397
[23,] 0.0177292865 -0.0332059157
[24,] -0.0801673996 0.0177292865
[25,] -0.1044491711 -0.0801673996
[26,] -0.0782385605 -0.1044491711
[27,] 0.0259739348 -0.0782385605
[28,] -0.0383080854 0.0259739348
[29,] -0.0213109983 -0.0383080854
[30,] -0.0798285143 -0.0213109983
[31,] 0.0223329026 -0.0798285143
[32,] -0.0114923516 0.0223329026
[33,] -0.0483969362 -0.0114923516
[34,] 0.0139691372 -0.0483969362
[35,] 0.0562402355 0.0139691372
[36,] 0.0272653528 0.0562402355
[37,] -0.0032849334 0.0272653528
[38,] 0.0829885976 -0.0032849334
[39,] 0.1471882321 0.0829885976
[40,] 0.0798184905 0.1471882321
[41,] 0.0758306309 0.0798184905
[42,] 0.1480258682 0.0758306309
[43,] 0.1276225156 0.1480258682
[44,] 0.1518640858 0.1276225156
[45,] 0.0821334511 0.1518640858
[46,] 0.1446972386 0.0821334511
[47,] 0.1769270369 0.1446972386
[48,] -0.0059852889 0.1769270369
[49,] -0.0981659090 -0.0059852889
[50,] -0.0356569051 -0.0981659090
[51,] 0.0758842027 -0.0356569051
[52,] 0.0651842426 0.0758842027
[53,] 0.0075147982 0.0651842426
[54,] -0.0007861531 0.0075147982
[55,] 0.0426735344 -0.0007861531
[56,] 0.1007802181 0.0426735344
[57,] 0.0816238261 0.1007802181
[58,] 0.1073161548 0.0816238261
[59,] 0.1723431477 0.1073161548
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.0606652832 -0.0865414962
2 0.0016851725 -0.0606652832
3 0.0628079499 0.0016851725
4 0.0532547723 0.0628079499
5 0.0266848654 0.0532547723
6 -0.0235144535 0.0266848654
7 -0.0149619613 -0.0235144535
8 -0.0222910761 -0.0149619613
9 -0.1125473705 -0.0222910761
10 -0.0621853664 -0.1125473705
11 -0.0063983120 -0.0621853664
12 -0.1201466187 -0.0063983120
13 -0.1047608718 -0.1201466187
14 -0.1641084189 -0.1047608718
15 -0.1286307210 -0.1641084189
16 -0.0896945847 -0.1286307210
17 -0.1126046438 -0.0896945847
18 -0.1944818430 -0.1126046438
19 -0.0635222808 -0.1944818430
20 -0.0751865173 -0.0635222808
21 -0.0968409397 -0.0751865173
22 -0.0332059157 -0.0968409397
23 0.0177292865 -0.0332059157
24 -0.0801673996 0.0177292865
25 -0.1044491711 -0.0801673996
26 -0.0782385605 -0.1044491711
27 0.0259739348 -0.0782385605
28 -0.0383080854 0.0259739348
29 -0.0213109983 -0.0383080854
30 -0.0798285143 -0.0213109983
31 0.0223329026 -0.0798285143
32 -0.0114923516 0.0223329026
33 -0.0483969362 -0.0114923516
34 0.0139691372 -0.0483969362
35 0.0562402355 0.0139691372
36 0.0272653528 0.0562402355
37 -0.0032849334 0.0272653528
38 0.0829885976 -0.0032849334
39 0.1471882321 0.0829885976
40 0.0798184905 0.1471882321
41 0.0758306309 0.0798184905
42 0.1480258682 0.0758306309
43 0.1276225156 0.1480258682
44 0.1518640858 0.1276225156
45 0.0821334511 0.1518640858
46 0.1446972386 0.0821334511
47 0.1769270369 0.1446972386
48 -0.0059852889 0.1769270369
49 -0.0981659090 -0.0059852889
50 -0.0356569051 -0.0981659090
51 0.0758842027 -0.0356569051
52 0.0651842426 0.0758842027
53 0.0075147982 0.0651842426
54 -0.0007861531 0.0075147982
55 0.0426735344 -0.0007861531
56 0.1007802181 0.0426735344
57 0.0816238261 0.1007802181
58 0.1073161548 0.0816238261
59 0.1723431477 0.1073161548
> 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/7a8c01258916165.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/8gzoc1258916165.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/97ard1258916165.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/10syf61258916165.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/119f7z1258916165.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/128ytk1258916165.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/136c711258916165.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/1428d21258916165.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/1539aj1258916165.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/16zc501258916165.tab")
+ }
>
> system("convert tmp/1wdth1258916165.ps tmp/1wdth1258916165.png")
> system("convert tmp/2xx431258916165.ps tmp/2xx431258916165.png")
> system("convert tmp/3jmix1258916165.ps tmp/3jmix1258916165.png")
> system("convert tmp/4ti1i1258916165.ps tmp/4ti1i1258916165.png")
> system("convert tmp/5iaks1258916165.ps tmp/5iaks1258916165.png")
> system("convert tmp/6v2js1258916165.ps tmp/6v2js1258916165.png")
> system("convert tmp/7a8c01258916165.ps tmp/7a8c01258916165.png")
> system("convert tmp/8gzoc1258916165.ps tmp/8gzoc1258916165.png")
> system("convert tmp/97ard1258916165.ps tmp/97ard1258916165.png")
> system("convert tmp/10syf61258916165.ps tmp/10syf61258916165.png")
>
>
> proc.time()
user system elapsed
2.501 1.580 3.427