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(7.0,519,6.9,517,6.7,510,6.7,509,6.5,501,6.4,507,6.5,569,6.5,580,6.5,578,6.7,565,6.8,547,7.2,555,7.6,562,7.6,561,7.2,555,6.4,544,6.1,537,6.3,543,7.1,594,7.5,611,7.4,613,7.1,611,6.8,594,6.9,595,7.2,591,7.4,589,7.3,584,6.9,573,6.9,567,6.8,569,7.1,621,7.2,629,7.1,628,7.0,612,6.9,595,7.1,597,7.3,593,7.5,590,7.5,580,7.5,574,7.3,573,7.0,573,6.7,620,6.5,626,6.5,620,6.5,588,6.6,566,6.8,557,6.9,561,6.9,549,6.8,532,6.8,526,6.5,511,6.1,499,6.1,555,5.9,565,5.7,542,5.9,527,5.9,510,6.1,514,6.3,517,6.2,508,5.9,493,5.7,490,5.4,469,5.6,478,6.2,528,6.3,534,6.0,518,5.6,506,5.5,502,5.9,516),dim=c(2,72),dimnames=list(c('wzo','werklbr'),1:72))
> y <- array(NA,dim=c(2,72),dimnames=list(c('wzo','werklbr'),1:72))
> 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
wzo werklbr
1 7.0 519
2 6.9 517
3 6.7 510
4 6.7 509
5 6.5 501
6 6.4 507
7 6.5 569
8 6.5 580
9 6.5 578
10 6.7 565
11 6.8 547
12 7.2 555
13 7.6 562
14 7.6 561
15 7.2 555
16 6.4 544
17 6.1 537
18 6.3 543
19 7.1 594
20 7.5 611
21 7.4 613
22 7.1 611
23 6.8 594
24 6.9 595
25 7.2 591
26 7.4 589
27 7.3 584
28 6.9 573
29 6.9 567
30 6.8 569
31 7.1 621
32 7.2 629
33 7.1 628
34 7.0 612
35 6.9 595
36 7.1 597
37 7.3 593
38 7.5 590
39 7.5 580
40 7.5 574
41 7.3 573
42 7.0 573
43 6.7 620
44 6.5 626
45 6.5 620
46 6.5 588
47 6.6 566
48 6.8 557
49 6.9 561
50 6.9 549
51 6.8 532
52 6.8 526
53 6.5 511
54 6.1 499
55 6.1 555
56 5.9 565
57 5.7 542
58 5.9 527
59 5.9 510
60 6.1 514
61 6.3 517
62 6.2 508
63 5.9 493
64 5.7 490
65 5.4 469
66 5.6 478
67 6.2 528
68 6.3 534
69 6.0 518
70 5.6 506
71 5.5 502
72 5.9 516
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) werklbr
1.491047 0.009286
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.83784 -0.30781 -0.03139 0.31680 0.89930
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.491047 0.681802 2.187 0.0321 *
werklbr 0.009286 0.001223 7.595 1.02e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4214 on 70 degrees of freedom
Multiple R-squared: 0.4518, Adjusted R-squared: 0.4439
F-statistic: 57.68 on 1 and 70 DF, p-value: 1.016e-10
> 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.0003932188 0.0007864375 0.9996067812
[2,] 0.0101738972 0.0203477944 0.9898261028
[3,] 0.1167603058 0.2335206116 0.8832396942
[4,] 0.0614672885 0.1229345770 0.9385327115
[5,] 0.0299123795 0.0598247590 0.9700876205
[6,] 0.0154544643 0.0309089286 0.9845455357
[7,] 0.0093132517 0.0186265034 0.9906867483
[8,] 0.0461311331 0.0922622663 0.9538688669
[9,] 0.3474715882 0.6949431764 0.6525284118
[10,] 0.6384057455 0.7231885090 0.3615942545
[11,] 0.6436966714 0.7126066571 0.3563033286
[12,] 0.6435048057 0.7129903886 0.3564951943
[13,] 0.7404917324 0.5190165352 0.2595082676
[14,] 0.7403736602 0.5192526797 0.2596263398
[15,] 0.6807363747 0.6385272505 0.3192636253
[16,] 0.6744458195 0.6511083610 0.3255541805
[17,] 0.6233849652 0.7532300696 0.3766150348
[18,] 0.5519953552 0.8960092895 0.4480046448
[19,] 0.5044889959 0.9910220082 0.4955110041
[20,] 0.4386205782 0.8772411565 0.5613794218
[21,] 0.3857979459 0.7715958919 0.6142020541
[22,] 0.3924951252 0.7849902505 0.6075048748
[23,] 0.3789769241 0.7579538483 0.6210230759
[24,] 0.3195984794 0.6391969589 0.6804015206
[25,] 0.2679683005 0.5359366009 0.7320316995
[26,] 0.2199959511 0.4399919023 0.7800040489
[27,] 0.1755593038 0.3511186076 0.8244406962
[28,] 0.1347244696 0.2694489391 0.8652755304
[29,] 0.1050945810 0.2101891621 0.8949054190
[30,] 0.0797765219 0.1595530437 0.9202234781
[31,] 0.0590226643 0.1180453287 0.9409773357
[32,] 0.0420648426 0.0841296853 0.9579351574
[33,] 0.0376785278 0.0753570556 0.9623214722
[34,] 0.0568788183 0.1137576366 0.9431211817
[35,] 0.1091704673 0.2183409347 0.8908295327
[36,] 0.2385247727 0.4770495454 0.7614752273
[37,] 0.3485111799 0.6970223597 0.6514888201
[38,] 0.3639127570 0.7278255139 0.6360872430
[39,] 0.3660135523 0.7320271046 0.6339864477
[40,] 0.4576894583 0.9153789165 0.5423105417
[41,] 0.5512704025 0.8974591951 0.4487295975
[42,] 0.5602419131 0.8795161738 0.4397580869
[43,] 0.5048675370 0.9902649260 0.4951324630
[44,] 0.4646267928 0.9292535855 0.5353732072
[45,] 0.4554466956 0.9108933912 0.5445533044
[46,] 0.5279605703 0.9440788595 0.4720394297
[47,] 0.6694182835 0.6611634330 0.3305817165
[48,] 0.8717795999 0.2564408002 0.1282204001
[49,] 0.9474881676 0.1050236647 0.0525118324
[50,] 0.9528934029 0.0942131942 0.0471065971
[51,] 0.9473634918 0.1052730163 0.0526365082
[52,] 0.9749271277 0.0501457446 0.0250728723
[53,] 0.9971455793 0.0057088413 0.0028544207
[54,] 0.9976203279 0.0047593441 0.0023796721
[55,] 0.9954971493 0.0090057014 0.0045028507
[56,] 0.9912518060 0.0174963879 0.0087481940
[57,] 0.9909463500 0.0181073000 0.0090536500
[58,] 0.9939403981 0.0121192037 0.0060596019
[59,] 0.9932603824 0.0134792353 0.0067396176
[60,] 0.9849829260 0.0300341480 0.0150170740
[61,] 0.9684450086 0.0631099828 0.0315549914
[62,] 0.9997364787 0.0005270425 0.0002635213
[63,] 0.9974420051 0.0051159898 0.0025579949
> postscript(file="/var/www/html/rcomp/tmp/1esug1258982694.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/2revh1258982694.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/3fs7u1258982694.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/41v4n1258982694.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/5m9361258982694.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 = 72
Frequency = 1
1 2 3 4 5 6
0.689329733 0.607902464 0.472907021 0.482193386 0.356484308 0.200766117
7 8 9 10 11 12
-0.274988531 -0.377138550 -0.358565819 -0.037843070 0.229311505 0.555020583
13 14 15 16 17 18
0.890016026 0.899302391 0.555020583 -0.142829399 -0.377824842 -0.233543034
19 20 21 22 23 24
0.092852336 0.334984126 0.216411396 -0.065015874 -0.207147664 -0.116434029
25 26 27 28 29 30
0.220711432 0.439284163 0.385715989 0.087866007 0.143584199 0.025011469
31 32 33 34 35 36
-0.157879527 -0.132170449 -0.222884084 -0.174302239 -0.116434029 0.064993240
37 38 39 40 41 42
0.302138702 0.529997797 0.622861450 0.678579642 0.487866007 0.187866007
43 44 45 46 47 48
-0.548593161 -0.804311353 -0.748593161 -0.451429472 -0.147129436 0.136447852
49 50 51 52 53 54
0.199302391 0.310738774 0.368606984 0.424325176 0.263620656 -0.024942961
55 56 57 58 59 60
-0.544979417 -0.837843070 -0.824256669 -0.484961189 -0.327092979 -0.164238440
61 62 63 64 65 66
0.007902464 -0.008520249 -0.169224769 -0.341365673 -0.446352002 -0.329929290
67 68 69 70 71 72
-0.194247554 -0.149965746 -0.301383901 -0.589947518 -0.652802057 -0.382811171
> postscript(file="/var/www/html/rcomp/tmp/6a1421258982694.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 = 72
Frequency = 1
lag(myerror, k = 1) myerror
0 0.689329733 NA
1 0.607902464 0.689329733
2 0.472907021 0.607902464
3 0.482193386 0.472907021
4 0.356484308 0.482193386
5 0.200766117 0.356484308
6 -0.274988531 0.200766117
7 -0.377138550 -0.274988531
8 -0.358565819 -0.377138550
9 -0.037843070 -0.358565819
10 0.229311505 -0.037843070
11 0.555020583 0.229311505
12 0.890016026 0.555020583
13 0.899302391 0.890016026
14 0.555020583 0.899302391
15 -0.142829399 0.555020583
16 -0.377824842 -0.142829399
17 -0.233543034 -0.377824842
18 0.092852336 -0.233543034
19 0.334984126 0.092852336
20 0.216411396 0.334984126
21 -0.065015874 0.216411396
22 -0.207147664 -0.065015874
23 -0.116434029 -0.207147664
24 0.220711432 -0.116434029
25 0.439284163 0.220711432
26 0.385715989 0.439284163
27 0.087866007 0.385715989
28 0.143584199 0.087866007
29 0.025011469 0.143584199
30 -0.157879527 0.025011469
31 -0.132170449 -0.157879527
32 -0.222884084 -0.132170449
33 -0.174302239 -0.222884084
34 -0.116434029 -0.174302239
35 0.064993240 -0.116434029
36 0.302138702 0.064993240
37 0.529997797 0.302138702
38 0.622861450 0.529997797
39 0.678579642 0.622861450
40 0.487866007 0.678579642
41 0.187866007 0.487866007
42 -0.548593161 0.187866007
43 -0.804311353 -0.548593161
44 -0.748593161 -0.804311353
45 -0.451429472 -0.748593161
46 -0.147129436 -0.451429472
47 0.136447852 -0.147129436
48 0.199302391 0.136447852
49 0.310738774 0.199302391
50 0.368606984 0.310738774
51 0.424325176 0.368606984
52 0.263620656 0.424325176
53 -0.024942961 0.263620656
54 -0.544979417 -0.024942961
55 -0.837843070 -0.544979417
56 -0.824256669 -0.837843070
57 -0.484961189 -0.824256669
58 -0.327092979 -0.484961189
59 -0.164238440 -0.327092979
60 0.007902464 -0.164238440
61 -0.008520249 0.007902464
62 -0.169224769 -0.008520249
63 -0.341365673 -0.169224769
64 -0.446352002 -0.341365673
65 -0.329929290 -0.446352002
66 -0.194247554 -0.329929290
67 -0.149965746 -0.194247554
68 -0.301383901 -0.149965746
69 -0.589947518 -0.301383901
70 -0.652802057 -0.589947518
71 -0.382811171 -0.652802057
72 NA -0.382811171
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.607902464 0.689329733
[2,] 0.472907021 0.607902464
[3,] 0.482193386 0.472907021
[4,] 0.356484308 0.482193386
[5,] 0.200766117 0.356484308
[6,] -0.274988531 0.200766117
[7,] -0.377138550 -0.274988531
[8,] -0.358565819 -0.377138550
[9,] -0.037843070 -0.358565819
[10,] 0.229311505 -0.037843070
[11,] 0.555020583 0.229311505
[12,] 0.890016026 0.555020583
[13,] 0.899302391 0.890016026
[14,] 0.555020583 0.899302391
[15,] -0.142829399 0.555020583
[16,] -0.377824842 -0.142829399
[17,] -0.233543034 -0.377824842
[18,] 0.092852336 -0.233543034
[19,] 0.334984126 0.092852336
[20,] 0.216411396 0.334984126
[21,] -0.065015874 0.216411396
[22,] -0.207147664 -0.065015874
[23,] -0.116434029 -0.207147664
[24,] 0.220711432 -0.116434029
[25,] 0.439284163 0.220711432
[26,] 0.385715989 0.439284163
[27,] 0.087866007 0.385715989
[28,] 0.143584199 0.087866007
[29,] 0.025011469 0.143584199
[30,] -0.157879527 0.025011469
[31,] -0.132170449 -0.157879527
[32,] -0.222884084 -0.132170449
[33,] -0.174302239 -0.222884084
[34,] -0.116434029 -0.174302239
[35,] 0.064993240 -0.116434029
[36,] 0.302138702 0.064993240
[37,] 0.529997797 0.302138702
[38,] 0.622861450 0.529997797
[39,] 0.678579642 0.622861450
[40,] 0.487866007 0.678579642
[41,] 0.187866007 0.487866007
[42,] -0.548593161 0.187866007
[43,] -0.804311353 -0.548593161
[44,] -0.748593161 -0.804311353
[45,] -0.451429472 -0.748593161
[46,] -0.147129436 -0.451429472
[47,] 0.136447852 -0.147129436
[48,] 0.199302391 0.136447852
[49,] 0.310738774 0.199302391
[50,] 0.368606984 0.310738774
[51,] 0.424325176 0.368606984
[52,] 0.263620656 0.424325176
[53,] -0.024942961 0.263620656
[54,] -0.544979417 -0.024942961
[55,] -0.837843070 -0.544979417
[56,] -0.824256669 -0.837843070
[57,] -0.484961189 -0.824256669
[58,] -0.327092979 -0.484961189
[59,] -0.164238440 -0.327092979
[60,] 0.007902464 -0.164238440
[61,] -0.008520249 0.007902464
[62,] -0.169224769 -0.008520249
[63,] -0.341365673 -0.169224769
[64,] -0.446352002 -0.341365673
[65,] -0.329929290 -0.446352002
[66,] -0.194247554 -0.329929290
[67,] -0.149965746 -0.194247554
[68,] -0.301383901 -0.149965746
[69,] -0.589947518 -0.301383901
[70,] -0.652802057 -0.589947518
[71,] -0.382811171 -0.652802057
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.607902464 0.689329733
2 0.472907021 0.607902464
3 0.482193386 0.472907021
4 0.356484308 0.482193386
5 0.200766117 0.356484308
6 -0.274988531 0.200766117
7 -0.377138550 -0.274988531
8 -0.358565819 -0.377138550
9 -0.037843070 -0.358565819
10 0.229311505 -0.037843070
11 0.555020583 0.229311505
12 0.890016026 0.555020583
13 0.899302391 0.890016026
14 0.555020583 0.899302391
15 -0.142829399 0.555020583
16 -0.377824842 -0.142829399
17 -0.233543034 -0.377824842
18 0.092852336 -0.233543034
19 0.334984126 0.092852336
20 0.216411396 0.334984126
21 -0.065015874 0.216411396
22 -0.207147664 -0.065015874
23 -0.116434029 -0.207147664
24 0.220711432 -0.116434029
25 0.439284163 0.220711432
26 0.385715989 0.439284163
27 0.087866007 0.385715989
28 0.143584199 0.087866007
29 0.025011469 0.143584199
30 -0.157879527 0.025011469
31 -0.132170449 -0.157879527
32 -0.222884084 -0.132170449
33 -0.174302239 -0.222884084
34 -0.116434029 -0.174302239
35 0.064993240 -0.116434029
36 0.302138702 0.064993240
37 0.529997797 0.302138702
38 0.622861450 0.529997797
39 0.678579642 0.622861450
40 0.487866007 0.678579642
41 0.187866007 0.487866007
42 -0.548593161 0.187866007
43 -0.804311353 -0.548593161
44 -0.748593161 -0.804311353
45 -0.451429472 -0.748593161
46 -0.147129436 -0.451429472
47 0.136447852 -0.147129436
48 0.199302391 0.136447852
49 0.310738774 0.199302391
50 0.368606984 0.310738774
51 0.424325176 0.368606984
52 0.263620656 0.424325176
53 -0.024942961 0.263620656
54 -0.544979417 -0.024942961
55 -0.837843070 -0.544979417
56 -0.824256669 -0.837843070
57 -0.484961189 -0.824256669
58 -0.327092979 -0.484961189
59 -0.164238440 -0.327092979
60 0.007902464 -0.164238440
61 -0.008520249 0.007902464
62 -0.169224769 -0.008520249
63 -0.341365673 -0.169224769
64 -0.446352002 -0.341365673
65 -0.329929290 -0.446352002
66 -0.194247554 -0.329929290
67 -0.149965746 -0.194247554
68 -0.301383901 -0.149965746
69 -0.589947518 -0.301383901
70 -0.652802057 -0.589947518
71 -0.382811171 -0.652802057
> 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/7ghzj1258982694.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/8jsnd1258982694.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/9zcdl1258982694.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/10qvyl1258982694.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/11qlzs1258982694.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/12q7n61258982694.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/131emb1258982694.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/14gupi1258982694.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/15bmz71258982695.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/16jwfm1258982695.tab")
+ }
>
> system("convert tmp/1esug1258982694.ps tmp/1esug1258982694.png")
> system("convert tmp/2revh1258982694.ps tmp/2revh1258982694.png")
> system("convert tmp/3fs7u1258982694.ps tmp/3fs7u1258982694.png")
> system("convert tmp/41v4n1258982694.ps tmp/41v4n1258982694.png")
> system("convert tmp/5m9361258982694.ps tmp/5m9361258982694.png")
> system("convert tmp/6a1421258982694.ps tmp/6a1421258982694.png")
> system("convert tmp/7ghzj1258982694.ps tmp/7ghzj1258982694.png")
> system("convert tmp/8jsnd1258982694.ps tmp/8jsnd1258982694.png")
> system("convert tmp/9zcdl1258982694.ps tmp/9zcdl1258982694.png")
> system("convert tmp/10qvyl1258982694.ps tmp/10qvyl1258982694.png")
>
>
> proc.time()
user system elapsed
2.544 1.522 3.494