R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
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(100.5
+ ,99.5
+ ,101.5
+ ,467
+ ,99
+ ,93.5
+ ,99.2
+ ,460
+ ,104.1
+ ,104.6
+ ,107.8
+ ,448
+ ,98.6
+ ,95.3
+ ,92.3
+ ,443
+ ,101.4
+ ,102.8
+ ,99.2
+ ,436
+ ,102.1
+ ,103.3
+ ,101.6
+ ,431
+ ,93
+ ,100.2
+ ,87
+ ,484
+ ,96.9
+ ,107.9
+ ,71.4
+ ,510
+ ,91.2
+ ,107.5
+ ,104.7
+ ,513
+ ,96.9
+ ,119.8
+ ,115.1
+ ,503
+ ,94
+ ,112
+ ,102.5
+ ,471
+ ,90.4
+ ,102.1
+ ,75.3
+ ,471
+ ,105.2
+ ,105.3
+ ,96.7
+ ,476
+ ,103.4
+ ,101.3
+ ,94.6
+ ,475
+ ,111.7
+ ,108.4
+ ,98.6
+ ,470
+ ,114.2
+ ,107.4
+ ,99.5
+ ,461
+ ,111.4
+ ,109.1
+ ,92
+ ,455
+ ,106.3
+ ,109.5
+ ,93.6
+ ,456
+ ,111.8
+ ,111.4
+ ,89.3
+ ,517
+ ,101.5
+ ,110.1
+ ,66.9
+ ,525
+ ,103
+ ,117
+ ,108.8
+ ,523
+ ,105.2
+ ,129.6
+ ,113.2
+ ,519
+ ,101.1
+ ,113.5
+ ,105.5
+ ,509
+ ,100.7
+ ,113.3
+ ,77.8
+ ,512
+ ,116.7
+ ,110.1
+ ,102.1
+ ,519
+ ,109
+ ,107.4
+ ,97
+ ,517
+ ,119.5
+ ,110.1
+ ,95.5
+ ,510
+ ,115.1
+ ,112.5
+ ,99.3
+ ,509
+ ,107.1
+ ,106
+ ,86.4
+ ,501
+ ,109.7
+ ,117.6
+ ,92.4
+ ,507
+ ,110.4
+ ,117.8
+ ,85.7
+ ,569
+ ,105
+ ,113.5
+ ,61.9
+ ,580
+ ,115.8
+ ,121.2
+ ,104.9
+ ,578
+ ,116.4
+ ,130.4
+ ,107.9
+ ,565
+ ,111.1
+ ,115.2
+ ,95.6
+ ,547
+ ,119.5
+ ,117.9
+ ,79.8
+ ,555
+ ,110.9
+ ,110.7
+ ,94.8
+ ,562
+ ,115.1
+ ,107.6
+ ,93.7
+ ,561
+ ,125.2
+ ,124.3
+ ,108.1
+ ,555
+ ,116
+ ,115.1
+ ,96.9
+ ,544
+ ,112.9
+ ,112.5
+ ,88.8
+ ,537
+ ,121.7
+ ,127.9
+ ,106.7
+ ,543
+ ,123.2
+ ,117.4
+ ,86.8
+ ,594
+ ,116.6
+ ,119.3
+ ,69.8
+ ,611
+ ,136.2
+ ,130.4
+ ,110.9
+ ,613
+ ,120.9
+ ,126
+ ,105.4
+ ,611
+ ,119.6
+ ,125.4
+ ,99.2
+ ,594
+ ,125.9
+ ,130.5
+ ,84.4
+ ,595
+ ,116.1
+ ,115.9
+ ,87.2
+ ,591
+ ,107.5
+ ,108.7
+ ,91.9
+ ,589
+ ,116.7
+ ,124
+ ,97.9
+ ,584
+ ,112.5
+ ,119.4
+ ,94.5
+ ,573
+ ,113
+ ,118.6
+ ,85
+ ,567
+ ,126.4
+ ,131.3
+ ,100.3
+ ,569
+ ,114.1
+ ,111.1
+ ,78.7
+ ,621
+ ,112.5
+ ,124.8
+ ,65.8
+ ,629
+ ,112.4
+ ,132.3
+ ,104.8
+ ,628
+ ,113.1
+ ,126.7
+ ,96
+ ,612
+ ,116.3
+ ,131.7
+ ,103.3
+ ,595
+ ,111.7
+ ,130.9
+ ,82.9
+ ,597
+ ,118.8
+ ,122.1
+ ,91.4
+ ,593
+ ,116.5
+ ,113.2
+ ,94.5
+ ,590
+ ,125.1
+ ,133.6
+ ,109.3
+ ,580
+ ,113.1
+ ,119.2
+ ,92.1
+ ,574
+ ,119.6
+ ,129.4
+ ,99.3
+ ,573
+ ,114.4
+ ,131.4
+ ,109.6
+ ,573
+ ,114
+ ,117.1
+ ,87.5
+ ,620
+ ,117.8
+ ,130.5
+ ,73.1
+ ,626
+ ,117
+ ,132.3
+ ,110.7
+ ,620
+ ,120.9
+ ,140.8
+ ,111.6
+ ,588
+ ,115
+ ,137.5
+ ,110.7
+ ,566
+ ,117.3
+ ,128.6
+ ,84
+ ,557
+ ,119.4
+ ,126.7
+ ,101.6
+ ,561
+ ,114.9
+ ,120.8
+ ,102.1
+ ,549
+ ,125.8
+ ,139.3
+ ,113.9
+ ,532
+ ,117.6
+ ,128.6
+ ,99
+ ,526
+ ,117.6
+ ,131.3
+ ,100.4
+ ,511
+ ,114.9
+ ,136.3
+ ,109.5
+ ,499
+ ,121.9
+ ,128.8
+ ,93.1
+ ,555
+ ,117
+ ,133.2
+ ,77
+ ,565
+ ,106.4
+ ,136.3
+ ,108
+ ,542
+ ,110.5
+ ,151.1
+ ,119.9
+ ,527
+ ,113.6
+ ,145
+ ,105.9
+ ,510
+ ,114.2
+ ,134.4
+ ,78.2
+ ,514
+ ,125.4
+ ,135.7
+ ,100.3
+ ,517
+ ,124.6
+ ,128.7
+ ,102.2
+ ,508
+ ,120.2
+ ,129.2
+ ,97
+ ,493
+ ,120.8
+ ,138.6
+ ,101.3
+ ,490
+ ,111.4
+ ,132.7
+ ,89.2
+ ,469
+ ,124.1
+ ,132.5
+ ,93.3
+ ,478
+ ,120.2
+ ,137.3
+ ,88.5
+ ,528
+ ,125.5
+ ,127.1
+ ,61.5
+ ,534
+ ,116
+ ,143.7
+ ,96.3
+ ,518
+ ,117
+ ,149.9
+ ,95.4
+ ,506
+ ,105.7
+ ,131.6
+ ,79.9
+ ,502
+ ,102
+ ,138.8
+ ,66.7
+ ,516
+ ,106.4
+ ,122.5
+ ,71.2
+ ,528
+ ,96.9
+ ,122
+ ,73.1
+ ,533
+ ,107.6
+ ,135.6
+ ,81
+ ,536
+ ,98.8
+ ,133.4
+ ,77.2
+ ,537
+ ,101.1
+ ,127.3
+ ,67.7
+ ,524
+ ,105.7
+ ,138.9
+ ,76.7
+ ,536
+ ,104.6
+ ,131.4
+ ,73.3
+ ,587
+ ,103.2
+ ,131.6
+ ,54.1
+ ,597
+ ,101.6
+ ,135.8
+ ,85
+ ,581
+ ,106.7
+ ,141.6
+ ,85.9
+ ,564
+ ,99.5
+ ,132.6
+ ,79.3
+ ,558
+ ,101
+ ,132.3
+ ,67.2
+ ,575
+ ,104.9
+ ,120.6
+ ,72.4
+ ,580
+ ,118.4
+ ,123.8
+ ,76.1
+ ,575
+ ,129
+ ,145.1
+ ,89.8
+ ,563
+ ,123.7
+ ,135
+ ,84
+ ,552
+ ,127.6
+ ,127.6
+ ,75.4
+ ,537
+ ,129.4
+ ,142
+ ,90
+ ,545
+ ,128.3
+ ,130.1
+ ,76.8
+ ,601
+ ,124.8
+ ,131
+ ,59.6
+ ,604
+ ,125.2
+ ,141.3
+ ,92.1
+ ,586
+ ,129.6
+ ,139.6
+ ,88.4
+ ,564
+ ,124.8
+ ,142.2
+ ,82.8
+ ,549
+ ,121.9
+ ,140
+ ,69.4
+ ,551
+ ,129.2
+ ,132
+ ,73.4
+ ,556)
+ ,dim=c(4
+ ,121)
+ ,dimnames=list(c('chemie'
+ ,'vm'
+ ,'textiel'
+ ,'werkloosheid')
+ ,1:121))
> y <- array(NA,dim=c(4,121),dimnames=list(c('chemie','vm','textiel','werkloosheid'),1:121))
> 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 = '4'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, 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
werkloosheid chemie vm textiel
1 467 100.5 99.5 101.5
2 460 99.0 93.5 99.2
3 448 104.1 104.6 107.8
4 443 98.6 95.3 92.3
5 436 101.4 102.8 99.2
6 431 102.1 103.3 101.6
7 484 93.0 100.2 87.0
8 510 96.9 107.9 71.4
9 513 91.2 107.5 104.7
10 503 96.9 119.8 115.1
11 471 94.0 112.0 102.5
12 471 90.4 102.1 75.3
13 476 105.2 105.3 96.7
14 475 103.4 101.3 94.6
15 470 111.7 108.4 98.6
16 461 114.2 107.4 99.5
17 455 111.4 109.1 92.0
18 456 106.3 109.5 93.6
19 517 111.8 111.4 89.3
20 525 101.5 110.1 66.9
21 523 103.0 117.0 108.8
22 519 105.2 129.6 113.2
23 509 101.1 113.5 105.5
24 512 100.7 113.3 77.8
25 519 116.7 110.1 102.1
26 517 109.0 107.4 97.0
27 510 119.5 110.1 95.5
28 509 115.1 112.5 99.3
29 501 107.1 106.0 86.4
30 507 109.7 117.6 92.4
31 569 110.4 117.8 85.7
32 580 105.0 113.5 61.9
33 578 115.8 121.2 104.9
34 565 116.4 130.4 107.9
35 547 111.1 115.2 95.6
36 555 119.5 117.9 79.8
37 562 110.9 110.7 94.8
38 561 115.1 107.6 93.7
39 555 125.2 124.3 108.1
40 544 116.0 115.1 96.9
41 537 112.9 112.5 88.8
42 543 121.7 127.9 106.7
43 594 123.2 117.4 86.8
44 611 116.6 119.3 69.8
45 613 136.2 130.4 110.9
46 611 120.9 126.0 105.4
47 594 119.6 125.4 99.2
48 595 125.9 130.5 84.4
49 591 116.1 115.9 87.2
50 589 107.5 108.7 91.9
51 584 116.7 124.0 97.9
52 573 112.5 119.4 94.5
53 567 113.0 118.6 85.0
54 569 126.4 131.3 100.3
55 621 114.1 111.1 78.7
56 629 112.5 124.8 65.8
57 628 112.4 132.3 104.8
58 612 113.1 126.7 96.0
59 595 116.3 131.7 103.3
60 597 111.7 130.9 82.9
61 593 118.8 122.1 91.4
62 590 116.5 113.2 94.5
63 580 125.1 133.6 109.3
64 574 113.1 119.2 92.1
65 573 119.6 129.4 99.3
66 573 114.4 131.4 109.6
67 620 114.0 117.1 87.5
68 626 117.8 130.5 73.1
69 620 117.0 132.3 110.7
70 588 120.9 140.8 111.6
71 566 115.0 137.5 110.7
72 557 117.3 128.6 84.0
73 561 119.4 126.7 101.6
74 549 114.9 120.8 102.1
75 532 125.8 139.3 113.9
76 526 117.6 128.6 99.0
77 511 117.6 131.3 100.4
78 499 114.9 136.3 109.5
79 555 121.9 128.8 93.1
80 565 117.0 133.2 77.0
81 542 106.4 136.3 108.0
82 527 110.5 151.1 119.9
83 510 113.6 145.0 105.9
84 514 114.2 134.4 78.2
85 517 125.4 135.7 100.3
86 508 124.6 128.7 102.2
87 493 120.2 129.2 97.0
88 490 120.8 138.6 101.3
89 469 111.4 132.7 89.2
90 478 124.1 132.5 93.3
91 528 120.2 137.3 88.5
92 534 125.5 127.1 61.5
93 518 116.0 143.7 96.3
94 506 117.0 149.9 95.4
95 502 105.7 131.6 79.9
96 516 102.0 138.8 66.7
97 528 106.4 122.5 71.2
98 533 96.9 122.0 73.1
99 536 107.6 135.6 81.0
100 537 98.8 133.4 77.2
101 524 101.1 127.3 67.7
102 536 105.7 138.9 76.7
103 587 104.6 131.4 73.3
104 597 103.2 131.6 54.1
105 581 101.6 135.8 85.0
106 564 106.7 141.6 85.9
107 558 99.5 132.6 79.3
108 575 101.0 132.3 67.2
109 580 104.9 120.6 72.4
110 575 118.4 123.8 76.1
111 563 129.0 145.1 89.8
112 552 123.7 135.0 84.0
113 537 127.6 127.6 75.4
114 545 129.4 142.0 90.0
115 601 128.3 130.1 76.8
116 604 124.8 131.0 59.6
117 586 125.2 141.3 92.1
118 564 129.6 139.6 88.4
119 549 124.8 142.2 82.8
120 551 121.9 140.0 69.4
121 556 129.2 132.0 73.4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) chemie vm textiel
325.7153 1.7035 0.8086 -0.8397
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-87.915 -29.332 -0.062 32.918 91.835
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 325.7153 50.8771 6.402 3.31e-09 ***
chemie 1.7035 0.4514 3.774 0.000254 ***
vm 0.8086 0.3370 2.400 0.017994 *
textiel -0.8397 0.2669 -3.146 0.002100 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 40.43 on 117 degrees of freedom
Multiple R-squared: 0.2817, Adjusted R-squared: 0.2633
F-statistic: 15.29 on 3 and 117 DF, p-value: 1.851e-08
> 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.013072024 0.026144047 0.9869279764
[2,] 0.083521862 0.167043725 0.9164781376
[3,] 0.038834718 0.077669436 0.9611652821
[4,] 0.014888134 0.029776268 0.9851118662
[5,] 0.021972267 0.043944535 0.9780277327
[6,] 0.026363082 0.052726164 0.9736369181
[7,] 0.022351792 0.044703583 0.9776482083
[8,] 0.016497793 0.032995586 0.9835022071
[9,] 0.010163739 0.020327477 0.9898362613
[10,] 0.006128683 0.012257366 0.9938713169
[11,] 0.004695805 0.009391609 0.9953041954
[12,] 0.004090773 0.008181547 0.9959092265
[13,] 0.011065004 0.022130007 0.9889349963
[14,] 0.007770775 0.015541550 0.9922292250
[15,] 0.008459076 0.016918152 0.9915409239
[16,] 0.004921039 0.009842078 0.9950789612
[17,] 0.003748967 0.007497934 0.9962510329
[18,] 0.002253827 0.004507653 0.9977461733
[19,] 0.006758728 0.013517455 0.9932412723
[20,] 0.010647568 0.021295137 0.9893524315
[21,] 0.010384228 0.020768455 0.9896157725
[22,] 0.008778905 0.017557810 0.9912210948
[23,] 0.008852625 0.017705249 0.9911473754
[24,] 0.007598605 0.015197210 0.9924013951
[25,] 0.012807068 0.025614137 0.9871929316
[26,] 0.015169965 0.030339930 0.9848300348
[27,] 0.029086601 0.058173202 0.9709133992
[28,] 0.020188517 0.040377034 0.9798114828
[29,] 0.019189527 0.038379054 0.9808104729
[30,] 0.013605116 0.027210232 0.9863948839
[31,] 0.028949380 0.057898761 0.9710506196
[32,] 0.056796379 0.113592759 0.9432036207
[33,] 0.042311344 0.084622688 0.9576886560
[34,] 0.036703366 0.073406732 0.9632966341
[35,] 0.034054843 0.068109686 0.9659451572
[36,] 0.029351796 0.058703591 0.9706482044
[37,] 0.029826727 0.059653454 0.9701732730
[38,] 0.027686081 0.055372163 0.9723139186
[39,] 0.026104302 0.052208605 0.9738956975
[40,] 0.036050834 0.072101668 0.9639491662
[41,] 0.030611041 0.061222082 0.9693889589
[42,] 0.028670995 0.057341989 0.9713290054
[43,] 0.030538739 0.061077477 0.9694612614
[44,] 0.082239695 0.164479390 0.9177603052
[45,] 0.067536862 0.135073725 0.9324631376
[46,] 0.056142601 0.112285202 0.9438573990
[47,] 0.042942250 0.085884499 0.9570577504
[48,] 0.040678925 0.081357850 0.9593210752
[49,] 0.077367972 0.154735944 0.9226320282
[50,] 0.083115093 0.166230185 0.9168849073
[51,] 0.143688469 0.287376938 0.8563115311
[52,] 0.165924197 0.331848395 0.8340758027
[53,] 0.161233917 0.322467834 0.8387660828
[54,] 0.159466044 0.318932087 0.8405339563
[55,] 0.143342101 0.286684202 0.8566578989
[56,] 0.162299081 0.324598161 0.8377009194
[57,] 0.156251391 0.312502782 0.8437486092
[58,] 0.132964168 0.265928335 0.8670358324
[59,] 0.119125537 0.238251074 0.8808744629
[60,] 0.108678994 0.217357988 0.8913210061
[61,] 0.195608144 0.391216289 0.8043918556
[62,] 0.259738019 0.519476039 0.7402619807
[63,] 0.485238662 0.970477323 0.5147613383
[64,] 0.599166255 0.801667490 0.4008337451
[65,] 0.652885913 0.694228174 0.3471140872
[66,] 0.666325277 0.667349445 0.3336747227
[67,] 0.674300847 0.651398305 0.3256991526
[68,] 0.672268108 0.655463785 0.3277318924
[69,] 0.744160123 0.511679754 0.2558398772
[70,] 0.748716457 0.502567085 0.2512835425
[71,] 0.781736008 0.436527983 0.2182639916
[72,] 0.812164384 0.375671231 0.1878356157
[73,] 0.812923589 0.374152822 0.1870764108
[74,] 0.812514764 0.374970472 0.1874852360
[75,] 0.822298743 0.355402514 0.1777012572
[76,] 0.845286865 0.309426269 0.1547131347
[77,] 0.854288190 0.291423620 0.1457118098
[78,] 0.897547099 0.204905801 0.1024529007
[79,] 0.901779556 0.196440888 0.0982204440
[80,] 0.897000155 0.205999690 0.1029998449
[81,] 0.904372270 0.191255460 0.0956277298
[82,] 0.920861755 0.158276491 0.0791382453
[83,] 0.969707528 0.060584943 0.0302924715
[84,] 0.992381624 0.015236753 0.0076183765
[85,] 0.990984706 0.018030587 0.0090152937
[86,] 0.994907409 0.010185183 0.0050925914
[87,] 0.993355686 0.013288628 0.0066443142
[88,] 0.994495198 0.011009604 0.0055048020
[89,] 0.997051220 0.005897560 0.0029487798
[90,] 0.998263231 0.003473538 0.0017367691
[91,] 0.998244993 0.003510014 0.0017550069
[92,] 0.997904058 0.004191884 0.0020959420
[93,] 0.997131834 0.005736331 0.0028681657
[94,] 0.996350256 0.007299489 0.0036497443
[95,] 0.999049359 0.001901281 0.0009506406
[96,] 0.999335608 0.001328785 0.0006643924
[97,] 0.998745609 0.002508781 0.0012543906
[98,] 0.997700631 0.004598737 0.0022993686
[99,] 0.996281339 0.007437321 0.0037186607
[100,] 0.992200225 0.015599549 0.0077997746
[101,] 0.985055789 0.029888423 0.0149442114
[102,] 0.970408069 0.059183861 0.0295919307
[103,] 0.944777255 0.110445489 0.0552227445
[104,] 0.901040178 0.197919645 0.0989598225
[105,] 0.834048076 0.331903848 0.1659519238
[106,] 0.748945703 0.502108594 0.2510542972
[107,] 0.951389362 0.097221277 0.0486106383
[108,] 0.878317608 0.243364784 0.1216823922
> postscript(file="/var/wessaorg/rcomp/tmp/10h0m1353244503.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2rwy81353244503.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3exnj1353244503.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/46dx81353244503.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/57z731353244503.ps",horizontal=F,onefile=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 = 121
Frequency = 1
1 2 3 4 5 6
-25.14279894 -26.66738852 -49.10907733 -50.23538042 -62.27559043 -66.85705258
7 8 9 10 11 12
-8.10807909 -8.07726471 32.91847455 11.99585122 -19.33733700 -28.03975589
13 14 15 16 17 18
-32.86969361 -29.33243135 -50.85375955 -62.54826912 -71.45076130 -60.74267163
19 20 21 22 23 24
-14.25909763 -6.47102931 18.57819388 4.33710956 7.87387503 -11.54285013
25 26 27 28 29 30
-8.80700178 0.21080898 -28.11893691 -20.37311121 -20.32136719 -23.09175941
31 32 33 34 35 36
31.92802772 35.61894482 45.10218030 26.16030256 19.15093783 -2.60919352
37 38 39 40 41 42
37.45846064 30.88654775 6.26950237 8.97612836 2.55773815 -3.85460535
43 44 45 46 47 48
36.36998254 48.80197466 42.94957691 65.95288921 46.44644312 20.16284813
49 50 51 52 53 54
47.01377026 69.43245460 41.42705840 38.44631320 24.26420333 6.01554775
55 56 57 58 59 60
77.16447985 65.98045814 91.83503411 71.78116692 51.41686269 44.76994939
61 62 63 64 65 66
42.92785321 53.64536087 24.92776600 36.57061756 22.29611862 38.18628352
67 68 69 70 71 72
78.87280108 55.47274467 80.95307220 36.19217340 26.15554344 -1.98640814
73 74 75 76 77 78
14.75129665 15.60760823 -25.01092698 -20.90187925 -36.90944031 -40.71146226
79 80 81 82 83 84
-4.34302622 -3.07272992 15.50896217 -8.44989299 -37.55440933 -49.26549468
85 86 87 88 89 90
-47.83864942 -48.22037004 -60.49560644 -68.50758138 -78.88427858 -87.91456835
91 92 93 94 95 96
-39.18255337 -56.63585308 -40.65290501 -60.12532505 -43.09400511 -39.69680145
97 98 99 100 101 102
-18.23389351 4.94934498 -14.64132592 -0.06230432 -20.02532257 -17.68365223
103 104 105 106 107 108
38.39953149 34.50040362 43.77694713 14.15496459 22.15546769 26.68230840
109 110 111 112 113 114
38.86533477 11.38718991 -24.38885261 -23.06385583 -45.94563683 -40.39574372
115 116 117 118 119 120
16.01604767 9.80773737 10.08845531 -21.13940145 -34.76711413 -37.30008011
121
-34.90841693
> postscript(file="/var/wessaorg/rcomp/tmp/63lk71353244503.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 121
Frequency = 1
lag(myerror, k = 1) myerror
0 -25.14279894 NA
1 -26.66738852 -25.14279894
2 -49.10907733 -26.66738852
3 -50.23538042 -49.10907733
4 -62.27559043 -50.23538042
5 -66.85705258 -62.27559043
6 -8.10807909 -66.85705258
7 -8.07726471 -8.10807909
8 32.91847455 -8.07726471
9 11.99585122 32.91847455
10 -19.33733700 11.99585122
11 -28.03975589 -19.33733700
12 -32.86969361 -28.03975589
13 -29.33243135 -32.86969361
14 -50.85375955 -29.33243135
15 -62.54826912 -50.85375955
16 -71.45076130 -62.54826912
17 -60.74267163 -71.45076130
18 -14.25909763 -60.74267163
19 -6.47102931 -14.25909763
20 18.57819388 -6.47102931
21 4.33710956 18.57819388
22 7.87387503 4.33710956
23 -11.54285013 7.87387503
24 -8.80700178 -11.54285013
25 0.21080898 -8.80700178
26 -28.11893691 0.21080898
27 -20.37311121 -28.11893691
28 -20.32136719 -20.37311121
29 -23.09175941 -20.32136719
30 31.92802772 -23.09175941
31 35.61894482 31.92802772
32 45.10218030 35.61894482
33 26.16030256 45.10218030
34 19.15093783 26.16030256
35 -2.60919352 19.15093783
36 37.45846064 -2.60919352
37 30.88654775 37.45846064
38 6.26950237 30.88654775
39 8.97612836 6.26950237
40 2.55773815 8.97612836
41 -3.85460535 2.55773815
42 36.36998254 -3.85460535
43 48.80197466 36.36998254
44 42.94957691 48.80197466
45 65.95288921 42.94957691
46 46.44644312 65.95288921
47 20.16284813 46.44644312
48 47.01377026 20.16284813
49 69.43245460 47.01377026
50 41.42705840 69.43245460
51 38.44631320 41.42705840
52 24.26420333 38.44631320
53 6.01554775 24.26420333
54 77.16447985 6.01554775
55 65.98045814 77.16447985
56 91.83503411 65.98045814
57 71.78116692 91.83503411
58 51.41686269 71.78116692
59 44.76994939 51.41686269
60 42.92785321 44.76994939
61 53.64536087 42.92785321
62 24.92776600 53.64536087
63 36.57061756 24.92776600
64 22.29611862 36.57061756
65 38.18628352 22.29611862
66 78.87280108 38.18628352
67 55.47274467 78.87280108
68 80.95307220 55.47274467
69 36.19217340 80.95307220
70 26.15554344 36.19217340
71 -1.98640814 26.15554344
72 14.75129665 -1.98640814
73 15.60760823 14.75129665
74 -25.01092698 15.60760823
75 -20.90187925 -25.01092698
76 -36.90944031 -20.90187925
77 -40.71146226 -36.90944031
78 -4.34302622 -40.71146226
79 -3.07272992 -4.34302622
80 15.50896217 -3.07272992
81 -8.44989299 15.50896217
82 -37.55440933 -8.44989299
83 -49.26549468 -37.55440933
84 -47.83864942 -49.26549468
85 -48.22037004 -47.83864942
86 -60.49560644 -48.22037004
87 -68.50758138 -60.49560644
88 -78.88427858 -68.50758138
89 -87.91456835 -78.88427858
90 -39.18255337 -87.91456835
91 -56.63585308 -39.18255337
92 -40.65290501 -56.63585308
93 -60.12532505 -40.65290501
94 -43.09400511 -60.12532505
95 -39.69680145 -43.09400511
96 -18.23389351 -39.69680145
97 4.94934498 -18.23389351
98 -14.64132592 4.94934498
99 -0.06230432 -14.64132592
100 -20.02532257 -0.06230432
101 -17.68365223 -20.02532257
102 38.39953149 -17.68365223
103 34.50040362 38.39953149
104 43.77694713 34.50040362
105 14.15496459 43.77694713
106 22.15546769 14.15496459
107 26.68230840 22.15546769
108 38.86533477 26.68230840
109 11.38718991 38.86533477
110 -24.38885261 11.38718991
111 -23.06385583 -24.38885261
112 -45.94563683 -23.06385583
113 -40.39574372 -45.94563683
114 16.01604767 -40.39574372
115 9.80773737 16.01604767
116 10.08845531 9.80773737
117 -21.13940145 10.08845531
118 -34.76711413 -21.13940145
119 -37.30008011 -34.76711413
120 -34.90841693 -37.30008011
121 NA -34.90841693
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -26.66738852 -25.14279894
[2,] -49.10907733 -26.66738852
[3,] -50.23538042 -49.10907733
[4,] -62.27559043 -50.23538042
[5,] -66.85705258 -62.27559043
[6,] -8.10807909 -66.85705258
[7,] -8.07726471 -8.10807909
[8,] 32.91847455 -8.07726471
[9,] 11.99585122 32.91847455
[10,] -19.33733700 11.99585122
[11,] -28.03975589 -19.33733700
[12,] -32.86969361 -28.03975589
[13,] -29.33243135 -32.86969361
[14,] -50.85375955 -29.33243135
[15,] -62.54826912 -50.85375955
[16,] -71.45076130 -62.54826912
[17,] -60.74267163 -71.45076130
[18,] -14.25909763 -60.74267163
[19,] -6.47102931 -14.25909763
[20,] 18.57819388 -6.47102931
[21,] 4.33710956 18.57819388
[22,] 7.87387503 4.33710956
[23,] -11.54285013 7.87387503
[24,] -8.80700178 -11.54285013
[25,] 0.21080898 -8.80700178
[26,] -28.11893691 0.21080898
[27,] -20.37311121 -28.11893691
[28,] -20.32136719 -20.37311121
[29,] -23.09175941 -20.32136719
[30,] 31.92802772 -23.09175941
[31,] 35.61894482 31.92802772
[32,] 45.10218030 35.61894482
[33,] 26.16030256 45.10218030
[34,] 19.15093783 26.16030256
[35,] -2.60919352 19.15093783
[36,] 37.45846064 -2.60919352
[37,] 30.88654775 37.45846064
[38,] 6.26950237 30.88654775
[39,] 8.97612836 6.26950237
[40,] 2.55773815 8.97612836
[41,] -3.85460535 2.55773815
[42,] 36.36998254 -3.85460535
[43,] 48.80197466 36.36998254
[44,] 42.94957691 48.80197466
[45,] 65.95288921 42.94957691
[46,] 46.44644312 65.95288921
[47,] 20.16284813 46.44644312
[48,] 47.01377026 20.16284813
[49,] 69.43245460 47.01377026
[50,] 41.42705840 69.43245460
[51,] 38.44631320 41.42705840
[52,] 24.26420333 38.44631320
[53,] 6.01554775 24.26420333
[54,] 77.16447985 6.01554775
[55,] 65.98045814 77.16447985
[56,] 91.83503411 65.98045814
[57,] 71.78116692 91.83503411
[58,] 51.41686269 71.78116692
[59,] 44.76994939 51.41686269
[60,] 42.92785321 44.76994939
[61,] 53.64536087 42.92785321
[62,] 24.92776600 53.64536087
[63,] 36.57061756 24.92776600
[64,] 22.29611862 36.57061756
[65,] 38.18628352 22.29611862
[66,] 78.87280108 38.18628352
[67,] 55.47274467 78.87280108
[68,] 80.95307220 55.47274467
[69,] 36.19217340 80.95307220
[70,] 26.15554344 36.19217340
[71,] -1.98640814 26.15554344
[72,] 14.75129665 -1.98640814
[73,] 15.60760823 14.75129665
[74,] -25.01092698 15.60760823
[75,] -20.90187925 -25.01092698
[76,] -36.90944031 -20.90187925
[77,] -40.71146226 -36.90944031
[78,] -4.34302622 -40.71146226
[79,] -3.07272992 -4.34302622
[80,] 15.50896217 -3.07272992
[81,] -8.44989299 15.50896217
[82,] -37.55440933 -8.44989299
[83,] -49.26549468 -37.55440933
[84,] -47.83864942 -49.26549468
[85,] -48.22037004 -47.83864942
[86,] -60.49560644 -48.22037004
[87,] -68.50758138 -60.49560644
[88,] -78.88427858 -68.50758138
[89,] -87.91456835 -78.88427858
[90,] -39.18255337 -87.91456835
[91,] -56.63585308 -39.18255337
[92,] -40.65290501 -56.63585308
[93,] -60.12532505 -40.65290501
[94,] -43.09400511 -60.12532505
[95,] -39.69680145 -43.09400511
[96,] -18.23389351 -39.69680145
[97,] 4.94934498 -18.23389351
[98,] -14.64132592 4.94934498
[99,] -0.06230432 -14.64132592
[100,] -20.02532257 -0.06230432
[101,] -17.68365223 -20.02532257
[102,] 38.39953149 -17.68365223
[103,] 34.50040362 38.39953149
[104,] 43.77694713 34.50040362
[105,] 14.15496459 43.77694713
[106,] 22.15546769 14.15496459
[107,] 26.68230840 22.15546769
[108,] 38.86533477 26.68230840
[109,] 11.38718991 38.86533477
[110,] -24.38885261 11.38718991
[111,] -23.06385583 -24.38885261
[112,] -45.94563683 -23.06385583
[113,] -40.39574372 -45.94563683
[114,] 16.01604767 -40.39574372
[115,] 9.80773737 16.01604767
[116,] 10.08845531 9.80773737
[117,] -21.13940145 10.08845531
[118,] -34.76711413 -21.13940145
[119,] -37.30008011 -34.76711413
[120,] -34.90841693 -37.30008011
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -26.66738852 -25.14279894
2 -49.10907733 -26.66738852
3 -50.23538042 -49.10907733
4 -62.27559043 -50.23538042
5 -66.85705258 -62.27559043
6 -8.10807909 -66.85705258
7 -8.07726471 -8.10807909
8 32.91847455 -8.07726471
9 11.99585122 32.91847455
10 -19.33733700 11.99585122
11 -28.03975589 -19.33733700
12 -32.86969361 -28.03975589
13 -29.33243135 -32.86969361
14 -50.85375955 -29.33243135
15 -62.54826912 -50.85375955
16 -71.45076130 -62.54826912
17 -60.74267163 -71.45076130
18 -14.25909763 -60.74267163
19 -6.47102931 -14.25909763
20 18.57819388 -6.47102931
21 4.33710956 18.57819388
22 7.87387503 4.33710956
23 -11.54285013 7.87387503
24 -8.80700178 -11.54285013
25 0.21080898 -8.80700178
26 -28.11893691 0.21080898
27 -20.37311121 -28.11893691
28 -20.32136719 -20.37311121
29 -23.09175941 -20.32136719
30 31.92802772 -23.09175941
31 35.61894482 31.92802772
32 45.10218030 35.61894482
33 26.16030256 45.10218030
34 19.15093783 26.16030256
35 -2.60919352 19.15093783
36 37.45846064 -2.60919352
37 30.88654775 37.45846064
38 6.26950237 30.88654775
39 8.97612836 6.26950237
40 2.55773815 8.97612836
41 -3.85460535 2.55773815
42 36.36998254 -3.85460535
43 48.80197466 36.36998254
44 42.94957691 48.80197466
45 65.95288921 42.94957691
46 46.44644312 65.95288921
47 20.16284813 46.44644312
48 47.01377026 20.16284813
49 69.43245460 47.01377026
50 41.42705840 69.43245460
51 38.44631320 41.42705840
52 24.26420333 38.44631320
53 6.01554775 24.26420333
54 77.16447985 6.01554775
55 65.98045814 77.16447985
56 91.83503411 65.98045814
57 71.78116692 91.83503411
58 51.41686269 71.78116692
59 44.76994939 51.41686269
60 42.92785321 44.76994939
61 53.64536087 42.92785321
62 24.92776600 53.64536087
63 36.57061756 24.92776600
64 22.29611862 36.57061756
65 38.18628352 22.29611862
66 78.87280108 38.18628352
67 55.47274467 78.87280108
68 80.95307220 55.47274467
69 36.19217340 80.95307220
70 26.15554344 36.19217340
71 -1.98640814 26.15554344
72 14.75129665 -1.98640814
73 15.60760823 14.75129665
74 -25.01092698 15.60760823
75 -20.90187925 -25.01092698
76 -36.90944031 -20.90187925
77 -40.71146226 -36.90944031
78 -4.34302622 -40.71146226
79 -3.07272992 -4.34302622
80 15.50896217 -3.07272992
81 -8.44989299 15.50896217
82 -37.55440933 -8.44989299
83 -49.26549468 -37.55440933
84 -47.83864942 -49.26549468
85 -48.22037004 -47.83864942
86 -60.49560644 -48.22037004
87 -68.50758138 -60.49560644
88 -78.88427858 -68.50758138
89 -87.91456835 -78.88427858
90 -39.18255337 -87.91456835
91 -56.63585308 -39.18255337
92 -40.65290501 -56.63585308
93 -60.12532505 -40.65290501
94 -43.09400511 -60.12532505
95 -39.69680145 -43.09400511
96 -18.23389351 -39.69680145
97 4.94934498 -18.23389351
98 -14.64132592 4.94934498
99 -0.06230432 -14.64132592
100 -20.02532257 -0.06230432
101 -17.68365223 -20.02532257
102 38.39953149 -17.68365223
103 34.50040362 38.39953149
104 43.77694713 34.50040362
105 14.15496459 43.77694713
106 22.15546769 14.15496459
107 26.68230840 22.15546769
108 38.86533477 26.68230840
109 11.38718991 38.86533477
110 -24.38885261 11.38718991
111 -23.06385583 -24.38885261
112 -45.94563683 -23.06385583
113 -40.39574372 -45.94563683
114 16.01604767 -40.39574372
115 9.80773737 16.01604767
116 10.08845531 9.80773737
117 -21.13940145 10.08845531
118 -34.76711413 -21.13940145
119 -37.30008011 -34.76711413
120 -34.90841693 -37.30008011
> 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/wessaorg/rcomp/tmp/7j2ex1353244503.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/852hi1353244503.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/9pynr1353244503.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/10471f1353244503.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11ecnb1353244503.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/wessaorg/rcomp/tmp/12f4i61353244503.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/wessaorg/rcomp/tmp/137ma91353244503.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/wessaorg/rcomp/tmp/14b0kr1353244503.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/wessaorg/rcomp/tmp/15ex5c1353244503.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/wessaorg/rcomp/tmp/16kijo1353244503.tab")
+ }
>
> try(system("convert tmp/10h0m1353244503.ps tmp/10h0m1353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/2rwy81353244503.ps tmp/2rwy81353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/3exnj1353244503.ps tmp/3exnj1353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/46dx81353244503.ps tmp/46dx81353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/57z731353244503.ps tmp/57z731353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/63lk71353244503.ps tmp/63lk71353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/7j2ex1353244503.ps tmp/7j2ex1353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/852hi1353244503.ps tmp/852hi1353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/9pynr1353244503.ps tmp/9pynr1353244503.png",intern=TRUE))
character(0)
> try(system("convert tmp/10471f1353244503.ps tmp/10471f1353244503.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
9.401 1.541 11.317