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(104.89,124,105.15,118.63,105.24,121.86,105.57,119.97,105.62,125.03,106.17,130.09,106.27,126.65,106.41,121.7,106.94,119.24,107.16,122.63,107.32,116.66,107.32,114.12,107.35,113.11,107.55,112.61,107.87,113.4,108.37,115.18,108.38,121.01,107.92,119.44,108.03,116.68,108.14,117.07,108.3,117.41,108.64,119.58,108.66,120.92,109.04,117.09,109.03,116.77,109.03,119.39,109.54,122.49,109.75,124.08,109.83,118.29,109.65,112.94,109.82,113.79,109.95,114.43,110.12,118.7,110.15,120.36,110.21,118.27,109.99,118.34,110.14,117.82,110.14,117.65,110.81,118.18,110.97,121.02,110.99,124.78,109.73,131.16,109.81,130.14,110.02,131.75,110.18,134.73,110.21,135.35,110.25,140.32,110.36,136.35,110.51,131.6,110.6,128.9,110.95,133.89,111.18,138.25,111.19,146.23,111.69,144.76,111.7,149.3,111.83,156.8,111.77,159.08,111.73,165.12,112.01,163.14,111.86,153.43,112.04,151.01),dim=c(2,61),dimnames=list(c('AKW','AKB'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('AKW','AKB'),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 = '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
AKW AKB t
1 104.89 124.00 1
2 105.15 118.63 2
3 105.24 121.86 3
4 105.57 119.97 4
5 105.62 125.03 5
6 106.17 130.09 6
7 106.27 126.65 7
8 106.41 121.70 8
9 106.94 119.24 9
10 107.16 122.63 10
11 107.32 116.66 11
12 107.32 114.12 12
13 107.35 113.11 13
14 107.55 112.61 14
15 107.87 113.40 15
16 108.37 115.18 16
17 108.38 121.01 17
18 107.92 119.44 18
19 108.03 116.68 19
20 108.14 117.07 20
21 108.30 117.41 21
22 108.64 119.58 22
23 108.66 120.92 23
24 109.04 117.09 24
25 109.03 116.77 25
26 109.03 119.39 26
27 109.54 122.49 27
28 109.75 124.08 28
29 109.83 118.29 29
30 109.65 112.94 30
31 109.82 113.79 31
32 109.95 114.43 32
33 110.12 118.70 33
34 110.15 120.36 34
35 110.21 118.27 35
36 109.99 118.34 36
37 110.14 117.82 37
38 110.14 117.65 38
39 110.81 118.18 39
40 110.97 121.02 40
41 110.99 124.78 41
42 109.73 131.16 42
43 109.81 130.14 43
44 110.02 131.75 44
45 110.18 134.73 45
46 110.21 135.35 46
47 110.25 140.32 47
48 110.36 136.35 48
49 110.51 131.60 49
50 110.60 128.90 50
51 110.95 133.89 51
52 111.18 138.25 52
53 111.19 146.23 53
54 111.69 144.76 54
55 111.70 149.30 55
56 111.83 156.80 56
57 111.77 159.08 57
58 111.73 165.12 58
59 112.01 163.14 59
60 111.86 153.43 60
61 112.04 151.01 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) AKB t
109.73101 -0.03435 0.12396
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.90145 -0.26037 0.06027 0.30388 0.81007
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 109.731010 0.696526 157.541 < 2e-16 ***
AKB -0.034348 0.006265 -5.483 9.54e-07 ***
t 0.123958 0.004774 25.965 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4472 on 58 degrees of freedom
Multiple R-squared: 0.9485, Adjusted R-squared: 0.9467
F-statistic: 534.3 on 2 and 58 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.0520011627 0.1040023255 0.947998837
[2,] 0.0153089587 0.0306179173 0.984691041
[3,] 0.0043693556 0.0087387112 0.995630644
[4,] 0.0059300082 0.0118600164 0.994069992
[5,] 0.0024453651 0.0048907302 0.997554635
[6,] 0.0007366560 0.0014733119 0.999263344
[7,] 0.0007594625 0.0015189249 0.999240538
[8,] 0.0017762223 0.0035524445 0.998223778
[9,] 0.0017424000 0.0034848000 0.998257600
[10,] 0.0008140721 0.0016281442 0.999185928
[11,] 0.0004276564 0.0008553129 0.999572344
[12,] 0.0002516754 0.0005033509 0.999748325
[13,] 0.0132807213 0.0265614427 0.986719279
[14,] 0.0513832773 0.1027665545 0.948616723
[15,] 0.1060562783 0.2121125566 0.893943722
[16,] 0.1482253626 0.2964507253 0.851774637
[17,] 0.1243689793 0.2487379586 0.875631021
[18,] 0.1208596392 0.2417192784 0.879140361
[19,] 0.0885585992 0.1771171984 0.911441401
[20,] 0.0753837672 0.1507675345 0.924616233
[21,] 0.0766753705 0.1533507410 0.923324630
[22,] 0.0541794047 0.1083588095 0.945820595
[23,] 0.0385551327 0.0771102654 0.961444867
[24,] 0.0257146571 0.0514293143 0.974285343
[25,] 0.0265950858 0.0531901717 0.973404914
[26,] 0.0231689960 0.0463379921 0.976831004
[27,] 0.0198376277 0.0396752555 0.980162372
[28,] 0.0162152468 0.0324304936 0.983784753
[29,] 0.0147705493 0.0295410986 0.985229451
[30,] 0.0162989992 0.0325979985 0.983701001
[31,] 0.0277625200 0.0555250400 0.972237480
[32,] 0.0373084829 0.0746169658 0.962691517
[33,] 0.0515280840 0.1030561679 0.948471916
[34,] 0.1000414371 0.2000828742 0.899958563
[35,] 0.3959839235 0.7919678470 0.604016076
[36,] 0.9972476304 0.0055047392 0.002752370
[37,] 0.9987620028 0.0024759944 0.001237997
[38,] 0.9988491606 0.0023016788 0.001150839
[39,] 0.9980362956 0.0039274087 0.001963704
[40,] 0.9959523739 0.0080952521 0.004047626
[41,] 0.9919452428 0.0161095144 0.008054757
[42,] 0.9891487613 0.0217024775 0.010851239
[43,] 0.9894876384 0.0210247233 0.010512362
[44,] 0.9892180797 0.0215638406 0.010781920
[45,] 0.9935271624 0.0129456753 0.006472838
[46,] 0.9900060852 0.0199878296 0.009993915
[47,] 0.9814319880 0.0371360239 0.018568012
[48,] 0.9979800721 0.0040398558 0.002019928
[49,] 0.9921607378 0.0156785243 0.007839262
[50,] 0.9710797926 0.0578404147 0.028920207
> postscript(file="/var/www/html/rcomp/tmp/16jm21258914986.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/2rry51258914986.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/3zthp1258914986.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/4jr1y1258914986.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/519oi1258914986.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
-0.705816642 -0.754223175 -0.677236998 -0.536112527 -0.436269529 0.163573469
7 8 9 10 11 12
0.021458556 -0.132521821 0.189024295 0.401506151 0.232490824 0.021289102
13 14 15 16 17 18
-0.107360197 -0.048492020 0.174685062 0.611866655 0.698157605 0.060273432
19 20 21 22 23 24
-0.048484848 -0.049046961 -0.001326473 0.289250835 0.231319312 0.355808683
25 26 27 28 29 30
0.210859497 0.176893401 0.669414339 0.810069814 0.567237125 0.079517552
31 32 33 34 35 36
0.154755514 0.182780399 0.375488485 0.338548319 0.202803191 -0.138750278
37 38 39 40 41 42
-0.130569062 -0.260366049 0.303880556 0.437471018 0.462661629 -0.702156026
43 44 45 46 47 48
-0.781148805 -0.639806370 -0.501407190 -0.574069266 -0.487317587 -0.637636934
49 50 51 52 53 54
-0.774747714 -0.901445115 -0.504006476 -0.248207070 -0.088067943 0.237482684
55 56 57 58 59 60
0.279464727 0.543116820 0.437472407 0.480976435 0.569009587 -0.038467221
61
-0.065547185
> postscript(file="/var/www/html/rcomp/tmp/6gq641258914986.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 -0.705816642 NA
1 -0.754223175 -0.705816642
2 -0.677236998 -0.754223175
3 -0.536112527 -0.677236998
4 -0.436269529 -0.536112527
5 0.163573469 -0.436269529
6 0.021458556 0.163573469
7 -0.132521821 0.021458556
8 0.189024295 -0.132521821
9 0.401506151 0.189024295
10 0.232490824 0.401506151
11 0.021289102 0.232490824
12 -0.107360197 0.021289102
13 -0.048492020 -0.107360197
14 0.174685062 -0.048492020
15 0.611866655 0.174685062
16 0.698157605 0.611866655
17 0.060273432 0.698157605
18 -0.048484848 0.060273432
19 -0.049046961 -0.048484848
20 -0.001326473 -0.049046961
21 0.289250835 -0.001326473
22 0.231319312 0.289250835
23 0.355808683 0.231319312
24 0.210859497 0.355808683
25 0.176893401 0.210859497
26 0.669414339 0.176893401
27 0.810069814 0.669414339
28 0.567237125 0.810069814
29 0.079517552 0.567237125
30 0.154755514 0.079517552
31 0.182780399 0.154755514
32 0.375488485 0.182780399
33 0.338548319 0.375488485
34 0.202803191 0.338548319
35 -0.138750278 0.202803191
36 -0.130569062 -0.138750278
37 -0.260366049 -0.130569062
38 0.303880556 -0.260366049
39 0.437471018 0.303880556
40 0.462661629 0.437471018
41 -0.702156026 0.462661629
42 -0.781148805 -0.702156026
43 -0.639806370 -0.781148805
44 -0.501407190 -0.639806370
45 -0.574069266 -0.501407190
46 -0.487317587 -0.574069266
47 -0.637636934 -0.487317587
48 -0.774747714 -0.637636934
49 -0.901445115 -0.774747714
50 -0.504006476 -0.901445115
51 -0.248207070 -0.504006476
52 -0.088067943 -0.248207070
53 0.237482684 -0.088067943
54 0.279464727 0.237482684
55 0.543116820 0.279464727
56 0.437472407 0.543116820
57 0.480976435 0.437472407
58 0.569009587 0.480976435
59 -0.038467221 0.569009587
60 -0.065547185 -0.038467221
61 NA -0.065547185
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.754223175 -0.705816642
[2,] -0.677236998 -0.754223175
[3,] -0.536112527 -0.677236998
[4,] -0.436269529 -0.536112527
[5,] 0.163573469 -0.436269529
[6,] 0.021458556 0.163573469
[7,] -0.132521821 0.021458556
[8,] 0.189024295 -0.132521821
[9,] 0.401506151 0.189024295
[10,] 0.232490824 0.401506151
[11,] 0.021289102 0.232490824
[12,] -0.107360197 0.021289102
[13,] -0.048492020 -0.107360197
[14,] 0.174685062 -0.048492020
[15,] 0.611866655 0.174685062
[16,] 0.698157605 0.611866655
[17,] 0.060273432 0.698157605
[18,] -0.048484848 0.060273432
[19,] -0.049046961 -0.048484848
[20,] -0.001326473 -0.049046961
[21,] 0.289250835 -0.001326473
[22,] 0.231319312 0.289250835
[23,] 0.355808683 0.231319312
[24,] 0.210859497 0.355808683
[25,] 0.176893401 0.210859497
[26,] 0.669414339 0.176893401
[27,] 0.810069814 0.669414339
[28,] 0.567237125 0.810069814
[29,] 0.079517552 0.567237125
[30,] 0.154755514 0.079517552
[31,] 0.182780399 0.154755514
[32,] 0.375488485 0.182780399
[33,] 0.338548319 0.375488485
[34,] 0.202803191 0.338548319
[35,] -0.138750278 0.202803191
[36,] -0.130569062 -0.138750278
[37,] -0.260366049 -0.130569062
[38,] 0.303880556 -0.260366049
[39,] 0.437471018 0.303880556
[40,] 0.462661629 0.437471018
[41,] -0.702156026 0.462661629
[42,] -0.781148805 -0.702156026
[43,] -0.639806370 -0.781148805
[44,] -0.501407190 -0.639806370
[45,] -0.574069266 -0.501407190
[46,] -0.487317587 -0.574069266
[47,] -0.637636934 -0.487317587
[48,] -0.774747714 -0.637636934
[49,] -0.901445115 -0.774747714
[50,] -0.504006476 -0.901445115
[51,] -0.248207070 -0.504006476
[52,] -0.088067943 -0.248207070
[53,] 0.237482684 -0.088067943
[54,] 0.279464727 0.237482684
[55,] 0.543116820 0.279464727
[56,] 0.437472407 0.543116820
[57,] 0.480976435 0.437472407
[58,] 0.569009587 0.480976435
[59,] -0.038467221 0.569009587
[60,] -0.065547185 -0.038467221
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.754223175 -0.705816642
2 -0.677236998 -0.754223175
3 -0.536112527 -0.677236998
4 -0.436269529 -0.536112527
5 0.163573469 -0.436269529
6 0.021458556 0.163573469
7 -0.132521821 0.021458556
8 0.189024295 -0.132521821
9 0.401506151 0.189024295
10 0.232490824 0.401506151
11 0.021289102 0.232490824
12 -0.107360197 0.021289102
13 -0.048492020 -0.107360197
14 0.174685062 -0.048492020
15 0.611866655 0.174685062
16 0.698157605 0.611866655
17 0.060273432 0.698157605
18 -0.048484848 0.060273432
19 -0.049046961 -0.048484848
20 -0.001326473 -0.049046961
21 0.289250835 -0.001326473
22 0.231319312 0.289250835
23 0.355808683 0.231319312
24 0.210859497 0.355808683
25 0.176893401 0.210859497
26 0.669414339 0.176893401
27 0.810069814 0.669414339
28 0.567237125 0.810069814
29 0.079517552 0.567237125
30 0.154755514 0.079517552
31 0.182780399 0.154755514
32 0.375488485 0.182780399
33 0.338548319 0.375488485
34 0.202803191 0.338548319
35 -0.138750278 0.202803191
36 -0.130569062 -0.138750278
37 -0.260366049 -0.130569062
38 0.303880556 -0.260366049
39 0.437471018 0.303880556
40 0.462661629 0.437471018
41 -0.702156026 0.462661629
42 -0.781148805 -0.702156026
43 -0.639806370 -0.781148805
44 -0.501407190 -0.639806370
45 -0.574069266 -0.501407190
46 -0.487317587 -0.574069266
47 -0.637636934 -0.487317587
48 -0.774747714 -0.637636934
49 -0.901445115 -0.774747714
50 -0.504006476 -0.901445115
51 -0.248207070 -0.504006476
52 -0.088067943 -0.248207070
53 0.237482684 -0.088067943
54 0.279464727 0.237482684
55 0.543116820 0.279464727
56 0.437472407 0.543116820
57 0.480976435 0.437472407
58 0.569009587 0.480976435
59 -0.038467221 0.569009587
60 -0.065547185 -0.038467221
> 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/7pqsn1258914986.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/8dyl41258914986.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/9of1v1258914986.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/10ime41258914986.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/110p0r1258914986.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/12oqm21258914986.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/13rxug1258914987.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/14a9s11258914987.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/15k8nm1258914987.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/16qlkt1258914987.tab")
+ }
>
> system("convert tmp/16jm21258914986.ps tmp/16jm21258914986.png")
> system("convert tmp/2rry51258914986.ps tmp/2rry51258914986.png")
> system("convert tmp/3zthp1258914986.ps tmp/3zthp1258914986.png")
> system("convert tmp/4jr1y1258914986.ps tmp/4jr1y1258914986.png")
> system("convert tmp/519oi1258914986.ps tmp/519oi1258914986.png")
> system("convert tmp/6gq641258914986.ps tmp/6gq641258914986.png")
> system("convert tmp/7pqsn1258914986.ps tmp/7pqsn1258914986.png")
> system("convert tmp/8dyl41258914986.ps tmp/8dyl41258914986.png")
> system("convert tmp/9of1v1258914986.ps tmp/9of1v1258914986.png")
> system("convert tmp/10ime41258914986.ps tmp/10ime41258914986.png")
>
>
> proc.time()
user system elapsed
2.399 1.622 2.900