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(1.4,1.9,1,1.6,-0.8,0,-2.9,-1.3,-0.7,-0.4,-0.7,-0.3,1.5,1.4,3,2.6,3.2,2.8,3.1,2.6,3.9,3.4,1,1.7,1.3,1.2,0.8,0,1.2,0,2.9,1.6,3.9,2.5,4.5,3.2,4.5,3.4,3.3,2.3,2,1.9,1.5,1.7,1,1.9,2.1,3.3,3,3.8,4,4.4,5.1,4.5,4.5,3.5,4.2,3,3.3,2.8,2.7,2.9,1.8,2.6,1.4,2.1,0.5,1.5,-0.4,1.1,0.8,1.5,0.7,1.7,1.9,2.3,2,2.3,1.1,1.9,0.9,2,0.4,1.6,0.7,1.2,2.1,1.9,2.8,2.1,3.9,2.4,3.5,2.9,2,2.5,2,2.3,1.5,2.5,2.5,2.6,3.1,2.4,2.7,2.5,2.8,2.1,2.5,2.2,3,2.7,3.2,3,2.8,3.2,2.4,3,2,2.7,1.8,2.5,1.1,1.6,-1.5,0.1,-3.7,-1.9),dim=c(2,64),dimnames=list(c('bbp','dnst'),1:64))
> y <- array(NA,dim=c(2,64),dimnames=list(c('bbp','dnst'),1:64))
> 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
bbp dnst
1 1.4 1.9
2 1.0 1.6
3 -0.8 0.0
4 -2.9 -1.3
5 -0.7 -0.4
6 -0.7 -0.3
7 1.5 1.4
8 3.0 2.6
9 3.2 2.8
10 3.1 2.6
11 3.9 3.4
12 1.0 1.7
13 1.3 1.2
14 0.8 0.0
15 1.2 0.0
16 2.9 1.6
17 3.9 2.5
18 4.5 3.2
19 4.5 3.4
20 3.3 2.3
21 2.0 1.9
22 1.5 1.7
23 1.0 1.9
24 2.1 3.3
25 3.0 3.8
26 4.0 4.4
27 5.1 4.5
28 4.5 3.5
29 4.2 3.0
30 3.3 2.8
31 2.7 2.9
32 1.8 2.6
33 1.4 2.1
34 0.5 1.5
35 -0.4 1.1
36 0.8 1.5
37 0.7 1.7
38 1.9 2.3
39 2.0 2.3
40 1.1 1.9
41 0.9 2.0
42 0.4 1.6
43 0.7 1.2
44 2.1 1.9
45 2.8 2.1
46 3.9 2.4
47 3.5 2.9
48 2.0 2.5
49 2.0 2.3
50 1.5 2.5
51 2.5 2.6
52 3.1 2.4
53 2.7 2.5
54 2.8 2.1
55 2.5 2.2
56 3.0 2.7
57 3.2 3.0
58 2.8 3.2
59 2.4 3.0
60 2.0 2.7
61 1.8 2.5
62 1.1 1.6
63 -1.5 0.1
64 -3.7 -1.9
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dnst
-0.6358 1.2503
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.3903 -0.6520 -0.1396 0.4356 1.8358
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.63583 0.19133 -3.323 0.00150 **
dnst 1.25033 0.08056 15.520 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.7762 on 62 degrees of freedom
Multiple R-squared: 0.7953, Adjusted R-squared: 0.792
F-statistic: 240.9 on 1 and 62 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.198800457 0.39760091 0.801199543
[2,] 0.140045963 0.28009193 0.859954037
[3,] 0.109478540 0.21895708 0.890521460
[4,] 0.066625265 0.13325053 0.933374735
[5,] 0.033430177 0.06686035 0.966569823
[6,] 0.018146768 0.03629354 0.981853232
[7,] 0.007956824 0.01591365 0.992043176
[8,] 0.009006129 0.01801226 0.990993871
[9,] 0.005775140 0.01155028 0.994224860
[10,] 0.067528514 0.13505703 0.932471486
[11,] 0.333329307 0.66665861 0.666670693
[12,] 0.526462799 0.94707440 0.473537201
[13,] 0.642792069 0.71441586 0.357207931
[14,] 0.658095760 0.68380848 0.341904240
[15,] 0.627693101 0.74461380 0.372306899
[16,] 0.652584363 0.69483127 0.347415637
[17,] 0.599917874 0.80016425 0.400082126
[18,] 0.553942850 0.89211430 0.446057150
[19,] 0.631639516 0.73672097 0.368360484
[20,] 0.859670502 0.28065900 0.140329498
[21,] 0.922526927 0.15494615 0.077473073
[22,] 0.943818887 0.11236223 0.056181113
[23,] 0.922549394 0.15490121 0.077450606
[24,] 0.916116648 0.16776670 0.083883352
[25,] 0.941389267 0.11722147 0.058610733
[26,] 0.926655080 0.14668984 0.073344920
[27,] 0.904933800 0.19013240 0.095066200
[28,] 0.914890261 0.17021948 0.085109739
[29,] 0.903968093 0.19206381 0.096031907
[30,] 0.899972444 0.20005511 0.100027556
[31,] 0.926977123 0.14604575 0.073022877
[32,] 0.905360669 0.18927866 0.094639331
[33,] 0.901480521 0.19703896 0.098519479
[34,] 0.870576079 0.25884784 0.129423921
[35,] 0.829035529 0.34192894 0.170964471
[36,] 0.806280299 0.38743940 0.193719701
[37,] 0.828252375 0.34349525 0.171747625
[38,] 0.846294342 0.30741132 0.153705658
[39,] 0.794462528 0.41107494 0.205537472
[40,] 0.751502541 0.49699492 0.248497459
[41,] 0.772815419 0.45436916 0.227184581
[42,] 0.947247537 0.10550493 0.052752463
[43,] 0.941610792 0.11677842 0.058389208
[44,] 0.918567101 0.16286580 0.081432899
[45,] 0.877851402 0.24429720 0.122148598
[46,] 0.903534394 0.19293121 0.096465606
[47,] 0.852831253 0.29433749 0.147168747
[48,] 0.884027855 0.23194429 0.115972145
[49,] 0.843167626 0.31366475 0.156832374
[50,] 0.939583477 0.12083305 0.060416523
[51,] 0.962897904 0.07420419 0.037102096
[52,] 0.980325371 0.03934926 0.019674629
[53,] 0.993716535 0.01256693 0.006283465
[54,] 0.978567725 0.04286455 0.021432275
[55,] 0.933672904 0.13265419 0.066327096
> postscript(file="/var/www/html/rcomp/tmp/1cze01258644170.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/22t641258644170.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/34njd1258644170.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/4pqdw1258644170.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/5am4l1258644170.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 = 64
Frequency = 1
1 2 3 4 5 6
-0.33979555 -0.36469709 -0.16417199 -0.63874535 0.43595928 0.31092647
7 8 9 10 11 12
0.38536855 0.38497472 0.33490908 0.48497472 0.28471217 -0.48972991
13 14 15 16 17 18
0.43543418 1.43582801 1.83582801 1.53530291 1.41000754 1.13477781
19 20 21 22 23 24
0.88471217 1.06007318 0.26020445 0.01027009 -0.73979555 -1.39025501
25 26 27 28 29 30
-1.11541910 -0.86561602 0.10935116 0.75967935 1.08484345 0.43490908
31 32 33 34 35 36
-0.29012374 -0.81502528 -0.58986118 -0.73966427 -1.13953300 -0.43966427
37 38 39 40 41 42
-0.78972991 -0.33992682 -0.23992682 -0.63979555 -0.96482837 -0.96469709
43 44 45 46 47 48
-0.16456582 0.36020445 0.81013882 1.53504036 0.50987626 -0.48999246
49 50 51 52 53 54
-0.23992682 -0.98999246 -0.11502528 0.73504036 0.21000754 0.81013882
55 56 57 58 59 60
0.38510600 0.25994190 0.08484345 -0.56522219 -0.71515655 -0.74005810
61 62 63 64
-0.68999246 -0.26469709 -0.98920481 -0.68854843
> postscript(file="/var/www/html/rcomp/tmp/6p5s01258644170.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 = 64
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.33979555 NA
1 -0.36469709 -0.33979555
2 -0.16417199 -0.36469709
3 -0.63874535 -0.16417199
4 0.43595928 -0.63874535
5 0.31092647 0.43595928
6 0.38536855 0.31092647
7 0.38497472 0.38536855
8 0.33490908 0.38497472
9 0.48497472 0.33490908
10 0.28471217 0.48497472
11 -0.48972991 0.28471217
12 0.43543418 -0.48972991
13 1.43582801 0.43543418
14 1.83582801 1.43582801
15 1.53530291 1.83582801
16 1.41000754 1.53530291
17 1.13477781 1.41000754
18 0.88471217 1.13477781
19 1.06007318 0.88471217
20 0.26020445 1.06007318
21 0.01027009 0.26020445
22 -0.73979555 0.01027009
23 -1.39025501 -0.73979555
24 -1.11541910 -1.39025501
25 -0.86561602 -1.11541910
26 0.10935116 -0.86561602
27 0.75967935 0.10935116
28 1.08484345 0.75967935
29 0.43490908 1.08484345
30 -0.29012374 0.43490908
31 -0.81502528 -0.29012374
32 -0.58986118 -0.81502528
33 -0.73966427 -0.58986118
34 -1.13953300 -0.73966427
35 -0.43966427 -1.13953300
36 -0.78972991 -0.43966427
37 -0.33992682 -0.78972991
38 -0.23992682 -0.33992682
39 -0.63979555 -0.23992682
40 -0.96482837 -0.63979555
41 -0.96469709 -0.96482837
42 -0.16456582 -0.96469709
43 0.36020445 -0.16456582
44 0.81013882 0.36020445
45 1.53504036 0.81013882
46 0.50987626 1.53504036
47 -0.48999246 0.50987626
48 -0.23992682 -0.48999246
49 -0.98999246 -0.23992682
50 -0.11502528 -0.98999246
51 0.73504036 -0.11502528
52 0.21000754 0.73504036
53 0.81013882 0.21000754
54 0.38510600 0.81013882
55 0.25994190 0.38510600
56 0.08484345 0.25994190
57 -0.56522219 0.08484345
58 -0.71515655 -0.56522219
59 -0.74005810 -0.71515655
60 -0.68999246 -0.74005810
61 -0.26469709 -0.68999246
62 -0.98920481 -0.26469709
63 -0.68854843 -0.98920481
64 NA -0.68854843
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.36469709 -0.33979555
[2,] -0.16417199 -0.36469709
[3,] -0.63874535 -0.16417199
[4,] 0.43595928 -0.63874535
[5,] 0.31092647 0.43595928
[6,] 0.38536855 0.31092647
[7,] 0.38497472 0.38536855
[8,] 0.33490908 0.38497472
[9,] 0.48497472 0.33490908
[10,] 0.28471217 0.48497472
[11,] -0.48972991 0.28471217
[12,] 0.43543418 -0.48972991
[13,] 1.43582801 0.43543418
[14,] 1.83582801 1.43582801
[15,] 1.53530291 1.83582801
[16,] 1.41000754 1.53530291
[17,] 1.13477781 1.41000754
[18,] 0.88471217 1.13477781
[19,] 1.06007318 0.88471217
[20,] 0.26020445 1.06007318
[21,] 0.01027009 0.26020445
[22,] -0.73979555 0.01027009
[23,] -1.39025501 -0.73979555
[24,] -1.11541910 -1.39025501
[25,] -0.86561602 -1.11541910
[26,] 0.10935116 -0.86561602
[27,] 0.75967935 0.10935116
[28,] 1.08484345 0.75967935
[29,] 0.43490908 1.08484345
[30,] -0.29012374 0.43490908
[31,] -0.81502528 -0.29012374
[32,] -0.58986118 -0.81502528
[33,] -0.73966427 -0.58986118
[34,] -1.13953300 -0.73966427
[35,] -0.43966427 -1.13953300
[36,] -0.78972991 -0.43966427
[37,] -0.33992682 -0.78972991
[38,] -0.23992682 -0.33992682
[39,] -0.63979555 -0.23992682
[40,] -0.96482837 -0.63979555
[41,] -0.96469709 -0.96482837
[42,] -0.16456582 -0.96469709
[43,] 0.36020445 -0.16456582
[44,] 0.81013882 0.36020445
[45,] 1.53504036 0.81013882
[46,] 0.50987626 1.53504036
[47,] -0.48999246 0.50987626
[48,] -0.23992682 -0.48999246
[49,] -0.98999246 -0.23992682
[50,] -0.11502528 -0.98999246
[51,] 0.73504036 -0.11502528
[52,] 0.21000754 0.73504036
[53,] 0.81013882 0.21000754
[54,] 0.38510600 0.81013882
[55,] 0.25994190 0.38510600
[56,] 0.08484345 0.25994190
[57,] -0.56522219 0.08484345
[58,] -0.71515655 -0.56522219
[59,] -0.74005810 -0.71515655
[60,] -0.68999246 -0.74005810
[61,] -0.26469709 -0.68999246
[62,] -0.98920481 -0.26469709
[63,] -0.68854843 -0.98920481
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.36469709 -0.33979555
2 -0.16417199 -0.36469709
3 -0.63874535 -0.16417199
4 0.43595928 -0.63874535
5 0.31092647 0.43595928
6 0.38536855 0.31092647
7 0.38497472 0.38536855
8 0.33490908 0.38497472
9 0.48497472 0.33490908
10 0.28471217 0.48497472
11 -0.48972991 0.28471217
12 0.43543418 -0.48972991
13 1.43582801 0.43543418
14 1.83582801 1.43582801
15 1.53530291 1.83582801
16 1.41000754 1.53530291
17 1.13477781 1.41000754
18 0.88471217 1.13477781
19 1.06007318 0.88471217
20 0.26020445 1.06007318
21 0.01027009 0.26020445
22 -0.73979555 0.01027009
23 -1.39025501 -0.73979555
24 -1.11541910 -1.39025501
25 -0.86561602 -1.11541910
26 0.10935116 -0.86561602
27 0.75967935 0.10935116
28 1.08484345 0.75967935
29 0.43490908 1.08484345
30 -0.29012374 0.43490908
31 -0.81502528 -0.29012374
32 -0.58986118 -0.81502528
33 -0.73966427 -0.58986118
34 -1.13953300 -0.73966427
35 -0.43966427 -1.13953300
36 -0.78972991 -0.43966427
37 -0.33992682 -0.78972991
38 -0.23992682 -0.33992682
39 -0.63979555 -0.23992682
40 -0.96482837 -0.63979555
41 -0.96469709 -0.96482837
42 -0.16456582 -0.96469709
43 0.36020445 -0.16456582
44 0.81013882 0.36020445
45 1.53504036 0.81013882
46 0.50987626 1.53504036
47 -0.48999246 0.50987626
48 -0.23992682 -0.48999246
49 -0.98999246 -0.23992682
50 -0.11502528 -0.98999246
51 0.73504036 -0.11502528
52 0.21000754 0.73504036
53 0.81013882 0.21000754
54 0.38510600 0.81013882
55 0.25994190 0.38510600
56 0.08484345 0.25994190
57 -0.56522219 0.08484345
58 -0.71515655 -0.56522219
59 -0.74005810 -0.71515655
60 -0.68999246 -0.74005810
61 -0.26469709 -0.68999246
62 -0.98920481 -0.26469709
63 -0.68854843 -0.98920481
> 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/76s9a1258644170.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/8jgj51258644170.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/9mxue1258644170.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/1007rd1258644170.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/11n0ox1258644170.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/12pc831258644170.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/13x6fg1258644170.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/14a8ar1258644170.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/150ys51258644170.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/160o4m1258644170.tab")
+ }
>
> system("convert tmp/1cze01258644170.ps tmp/1cze01258644170.png")
> system("convert tmp/22t641258644170.ps tmp/22t641258644170.png")
> system("convert tmp/34njd1258644170.ps tmp/34njd1258644170.png")
> system("convert tmp/4pqdw1258644170.ps tmp/4pqdw1258644170.png")
> system("convert tmp/5am4l1258644170.ps tmp/5am4l1258644170.png")
> system("convert tmp/6p5s01258644170.ps tmp/6p5s01258644170.png")
> system("convert tmp/76s9a1258644170.ps tmp/76s9a1258644170.png")
> system("convert tmp/8jgj51258644170.ps tmp/8jgj51258644170.png")
> system("convert tmp/9mxue1258644170.ps tmp/9mxue1258644170.png")
> system("convert tmp/1007rd1258644170.ps tmp/1007rd1258644170.png")
>
>
> proc.time()
user system elapsed
2.453 1.602 3.001