R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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
+ ,162556
+ ,162556
+ ,1081
+ ,1081
+ ,213118
+ ,213118
+ ,230380558
+ ,6282929
+ ,1
+ ,29790
+ ,29790
+ ,309
+ ,309
+ ,81767
+ ,81767
+ ,25266003
+ ,4324047
+ ,1
+ ,87550
+ ,87550
+ ,458
+ ,458
+ ,153198
+ ,153198
+ ,70164684
+ ,4108272
+ ,0
+ ,84738
+ ,0
+ ,588
+ ,0
+ ,-26007
+ ,0
+ ,-15292116
+ ,-1212617
+ ,1
+ ,54660
+ ,54660
+ ,299
+ ,299
+ ,126942
+ ,126942
+ ,37955658
+ ,1485329
+ ,1
+ ,42634
+ ,42634
+ ,156
+ ,156
+ ,157214
+ ,157214
+ ,24525384
+ ,1779876
+ ,0
+ ,40949
+ ,0
+ ,481
+ ,0
+ ,129352
+ ,0
+ ,62218312
+ ,1367203
+ ,1
+ ,42312
+ ,42312
+ ,323
+ ,323
+ ,234817
+ ,234817
+ ,75845891
+ ,2519076
+ ,1
+ ,37704
+ ,37704
+ ,452
+ ,452
+ ,60448
+ ,60448
+ ,27322496
+ ,912684
+ ,1
+ ,16275
+ ,16275
+ ,109
+ ,109
+ ,47818
+ ,47818
+ ,5212162
+ ,1443586
+ ,0
+ ,25830
+ ,0
+ ,115
+ ,0
+ ,245546
+ ,0
+ ,28237790
+ ,1220017
+ ,0
+ ,12679
+ ,0
+ ,110
+ ,0
+ ,48020
+ ,0
+ ,5282200
+ ,984885
+ ,1
+ ,18014
+ ,18014
+ ,239
+ ,239
+ ,-1710
+ ,-1710
+ ,-408690
+ ,1457425
+ ,0
+ ,43556
+ ,0
+ ,247
+ ,0
+ ,32648
+ ,0
+ ,8064056
+ ,-572920
+ ,1
+ ,24524
+ ,24524
+ ,497
+ ,497
+ ,95350
+ ,95350
+ ,47388950
+ ,929144
+ ,0
+ ,6532
+ ,0
+ ,103
+ ,0
+ ,151352
+ ,0
+ ,15589256
+ ,1151176
+ ,0
+ ,7123
+ ,0
+ ,109
+ ,0
+ ,288170
+ ,0
+ ,31410530
+ ,790090
+ ,1
+ ,20813
+ ,20813
+ ,502
+ ,502
+ ,114337
+ ,114337
+ ,57397174
+ ,774497
+ ,1
+ ,37597
+ ,37597
+ ,248
+ ,248
+ ,37884
+ ,37884
+ ,9395232
+ ,990576
+ ,0
+ ,17821
+ ,0
+ ,373
+ ,0
+ ,122844
+ ,0
+ ,45820812
+ ,454195
+ ,1
+ ,12988
+ ,12988
+ ,119
+ ,119
+ ,82340
+ ,82340
+ ,9798460
+ ,876607
+ ,1
+ ,22330
+ ,22330
+ ,84
+ ,84
+ ,79801
+ ,79801
+ ,6703284
+ ,711969
+ ,0
+ ,13326
+ ,0
+ ,102
+ ,0
+ ,165548
+ ,0
+ ,16885896
+ ,702380
+ ,0
+ ,16189
+ ,0
+ ,295
+ ,0
+ ,116384
+ ,0
+ ,34333280
+ ,264449
+ ,0
+ ,7146
+ ,0
+ ,105
+ ,0
+ ,134028
+ ,0
+ ,14072940
+ ,450033
+ ,0
+ ,15824
+ ,0
+ ,64
+ ,0
+ ,63838
+ ,0
+ ,4085632
+ ,541063
+ ,1
+ ,26088
+ ,26088
+ ,267
+ ,267
+ ,74996
+ ,74996
+ ,20023932
+ ,588864
+ ,0
+ ,11326
+ ,0
+ ,129
+ ,0
+ ,31080
+ ,0
+ ,4009320
+ ,-37216
+ ,0
+ ,8568
+ ,0
+ ,37
+ ,0
+ ,32168
+ ,0
+ ,1190216
+ ,783310
+ ,0
+ ,14416
+ ,0
+ ,361
+ ,0
+ ,49857
+ ,0
+ ,17998377
+ ,467359
+ ,1
+ ,3369
+ ,3369
+ ,28
+ ,28
+ ,87161
+ ,87161
+ ,2440508
+ ,688779
+ ,1
+ ,11819
+ ,11819
+ ,85
+ ,85
+ ,106113
+ ,106113
+ ,9019605
+ ,608419
+ ,1
+ ,6620
+ ,6620
+ ,44
+ ,44
+ ,80570
+ ,80570
+ ,3545080
+ ,696348
+ ,1
+ ,4519
+ ,4519
+ ,49
+ ,49
+ ,102129
+ ,102129
+ ,5004321
+ ,597793
+ ,0
+ ,2220
+ ,0
+ ,22
+ ,0
+ ,301670
+ ,0
+ ,6636740
+ ,821730
+ ,0
+ ,18562
+ ,0
+ ,155
+ ,0
+ ,102313
+ ,0
+ ,15858515
+ ,377934
+ ,0
+ ,10327
+ ,0
+ ,91
+ ,0
+ ,88577
+ ,0
+ ,8060507
+ ,651939
+ ,1
+ ,5336
+ ,5336
+ ,81
+ ,81
+ ,112477
+ ,112477
+ ,9110637
+ ,697458
+ ,1
+ ,2365
+ ,2365
+ ,79
+ ,79
+ ,191778
+ ,191778
+ ,15150462
+ ,700368
+ ,0
+ ,4069
+ ,0
+ ,145
+ ,0
+ ,79804
+ ,0
+ ,11571580
+ ,225986
+ ,0
+ ,7710
+ ,0
+ ,816
+ ,0
+ ,128294
+ ,0
+ ,104687904
+ ,348695
+ ,0
+ ,13718
+ ,0
+ ,61
+ ,0
+ ,96448
+ ,0
+ ,5883328
+ ,373683
+ ,0
+ ,4525
+ ,0
+ ,226
+ ,0
+ ,93811
+ ,0
+ ,21201286
+ ,501709
+ ,0
+ ,6869
+ ,0
+ ,105
+ ,0
+ ,117520
+ ,0
+ ,12339600
+ ,413743
+ ,0
+ ,4628
+ ,0
+ ,62
+ ,0
+ ,69159
+ ,0
+ ,4287858
+ ,379825
+ ,1
+ ,3653
+ ,3653
+ ,24
+ ,24
+ ,101792
+ ,101792
+ ,2443008
+ ,336260
+ ,1
+ ,1265
+ ,1265
+ ,26
+ ,26
+ ,210568
+ ,210568
+ ,5474768
+ ,636765
+ ,1
+ ,7489
+ ,7489
+ ,322
+ ,322
+ ,136996
+ ,136996
+ ,44112712
+ ,481231
+ ,0
+ ,4901
+ ,0
+ ,84
+ ,0
+ ,121920
+ ,0
+ ,10241280
+ ,469107
+ ,0
+ ,2284
+ ,0
+ ,33
+ ,0
+ ,76403
+ ,0
+ ,2521299
+ ,211928
+ ,1
+ ,3160
+ ,3160
+ ,108
+ ,108
+ ,108094
+ ,108094
+ ,11674152
+ ,563925
+ ,1
+ ,4150
+ ,4150
+ ,150
+ ,150
+ ,134759
+ ,134759
+ ,20213850
+ ,511939
+ ,1
+ ,7285
+ ,7285
+ ,115
+ ,115
+ ,188873
+ ,188873
+ ,21720395
+ ,521016
+ ,1
+ ,1134
+ ,1134
+ ,162
+ ,162
+ ,146216
+ ,146216
+ ,23686992
+ ,543856
+ ,1
+ ,4658
+ ,4658
+ ,158
+ ,158
+ ,156608
+ ,156608
+ ,24744064
+ ,329304
+ ,0
+ ,2384
+ ,0
+ ,97
+ ,0
+ ,61348
+ ,0
+ ,5950756
+ ,423262
+ ,0
+ ,3748
+ ,0
+ ,9
+ ,0
+ ,50350
+ ,0
+ ,453150
+ ,509665
+ ,0
+ ,5371
+ ,0
+ ,66
+ ,0
+ ,87720
+ ,0
+ ,5789520
+ ,455881
+ ,0
+ ,1285
+ ,0
+ ,107
+ ,0
+ ,99489
+ ,0
+ ,10645323
+ ,367772
+ ,1
+ ,9327
+ ,9327
+ ,101
+ ,101
+ ,87419
+ ,87419
+ ,8829319
+ ,406339
+ ,1
+ ,5565
+ ,5565
+ ,47
+ ,47
+ ,94355
+ ,94355
+ ,4434685
+ ,493408
+ ,0
+ ,1528
+ ,0
+ ,38
+ ,0
+ ,60326
+ ,0
+ ,2292388
+ ,232942
+ ,1
+ ,3122
+ ,3122
+ ,34
+ ,34
+ ,94670
+ ,94670
+ ,3218780
+ ,416002
+ ,1
+ ,7317
+ ,7317
+ ,84
+ ,84
+ ,82425
+ ,82425
+ ,6923700
+ ,337430
+ ,0
+ ,2675
+ ,0
+ ,79
+ ,0
+ ,59017
+ ,0
+ ,4662343
+ ,361517
+ ,0
+ ,13253
+ ,0
+ ,947
+ ,0
+ ,90829
+ ,0
+ ,86015063
+ ,360962
+ ,0
+ ,880
+ ,0
+ ,74
+ ,0
+ ,80791
+ ,0
+ ,5978534
+ ,235561
+ ,1
+ ,2053
+ ,2053
+ ,53
+ ,53
+ ,100423
+ ,100423
+ ,5322419
+ ,408247
+ ,0
+ ,1424
+ ,0
+ ,94
+ ,0
+ ,131116
+ ,0
+ ,12324904
+ ,450296
+ ,1
+ ,4036
+ ,4036
+ ,63
+ ,63
+ ,100269
+ ,100269
+ ,6316947
+ ,418799
+ ,1
+ ,3045
+ ,3045
+ ,58
+ ,58
+ ,27330
+ ,27330
+ ,1585140
+ ,247405
+ ,0
+ ,5119
+ ,0
+ ,49
+ ,0
+ ,39039
+ ,0
+ ,1912911
+ ,378519
+ ,0
+ ,1431
+ ,0
+ ,34
+ ,0
+ ,106885
+ ,0
+ ,3634090
+ ,326638
+ ,0
+ ,554
+ ,0
+ ,11
+ ,0
+ ,79285
+ ,0
+ ,872135
+ ,328233
+ ,0
+ ,1975
+ ,0
+ ,35
+ ,0
+ ,118881
+ ,0
+ ,4160835
+ ,386225
+ ,1
+ ,1286
+ ,1286
+ ,17
+ ,17
+ ,77623
+ ,77623
+ ,1319591
+ ,283662
+ ,0
+ ,1012
+ ,0
+ ,47
+ ,0
+ ,114768
+ ,0
+ ,5394096
+ ,370225
+ ,0
+ ,810
+ ,0
+ ,43
+ ,0
+ ,74015
+ ,0
+ ,3182645
+ ,269236
+ ,0
+ ,1280
+ ,0
+ ,117
+ ,0
+ ,69465
+ ,0
+ ,8127405
+ ,365732
+ ,1
+ ,666
+ ,666
+ ,171
+ ,171
+ ,117869
+ ,117869
+ ,20155599
+ ,420383
+ ,0
+ ,1380
+ ,0
+ ,26
+ ,0
+ ,60982
+ ,0
+ ,1585532
+ ,345811
+ ,1
+ ,4608
+ ,4608
+ ,73
+ ,73
+ ,90131
+ ,90131
+ ,6579563
+ ,431809
+ ,0
+ ,876
+ ,0
+ ,59
+ ,0
+ ,138971
+ ,0
+ ,8199289
+ ,418876
+ ,0
+ ,814
+ ,0
+ ,18
+ ,0
+ ,39625
+ ,0
+ ,713250
+ ,297476
+ ,0
+ ,514
+ ,0
+ ,15
+ ,0
+ ,102725
+ ,0
+ ,1540875
+ ,416776
+ ,1
+ ,5692
+ ,5692
+ ,72
+ ,72
+ ,64239
+ ,64239
+ ,4625208
+ ,357257
+ ,0
+ ,3642
+ ,0
+ ,86
+ ,0
+ ,90262
+ ,0
+ ,7762532
+ ,458343
+ ,0
+ ,540
+ ,0
+ ,14
+ ,0
+ ,103960
+ ,0
+ ,1455440
+ ,388386
+ ,0
+ ,2099
+ ,0
+ ,64
+ ,0
+ ,106611
+ ,0
+ ,6823104
+ ,358934
+ ,0
+ ,567
+ ,0
+ ,11
+ ,0
+ ,103345
+ ,0
+ ,1136795
+ ,407560
+ ,0
+ ,2001
+ ,0
+ ,52
+ ,0
+ ,95551
+ ,0
+ ,4968652
+ ,392558
+ ,1
+ ,2949
+ ,2949
+ ,41
+ ,41
+ ,82903
+ ,82903
+ ,3399023
+ ,373177
+ ,0
+ ,2253
+ ,0
+ ,99
+ ,0
+ ,63593
+ ,0
+ ,6295707
+ ,428370
+ ,1
+ ,6533
+ ,6533
+ ,75
+ ,75
+ ,126910
+ ,126910
+ ,9518250
+ ,369419
+ ,0
+ ,1889
+ ,0
+ ,45
+ ,0
+ ,37527
+ ,0
+ ,1688715
+ ,358649
+ ,1
+ ,3055
+ ,3055
+ ,43
+ ,43
+ ,60247
+ ,60247
+ ,2590621
+ ,376641
+ ,0
+ ,272
+ ,0
+ ,8
+ ,0
+ ,112995
+ ,0
+ ,903960
+ ,467427
+ ,1
+ ,1414
+ ,1414
+ ,198
+ ,198
+ ,70184
+ ,70184
+ ,13896432
+ ,364885
+ ,0
+ ,2564
+ ,0
+ ,22
+ ,0
+ ,130140
+ ,0
+ ,2863080
+ ,436230
+ ,1
+ ,1383
+ ,1383
+ ,11
+ ,11
+ ,73221
+ ,73221
+ ,805431
+ ,329118)
+ ,dim=c(9
+ ,100)
+ ,dimnames=list(c('Group'
+ ,'Costs'
+ ,'GrCosts'
+ ,'Trades'
+ ,'GrTrades'
+ ,'Dividends'
+ ,'GrDiv'
+ ,'TrDiv'
+ ,'Wealth
')
+ ,1:100))
> y <- array(NA,dim=c(9,100),dimnames=list(c('Group','Costs','GrCosts','Trades','GrTrades','Dividends','GrDiv','TrDiv','Wealth
'),1:100))
> 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 = '6'
> #'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
Dividends Group Costs GrCosts Trades GrTrades GrDiv TrDiv Wealth\r
1 213118 1 162556 162556 1081 1081 213118 230380558 6282929
2 81767 1 29790 29790 309 309 81767 25266003 4324047
3 153198 1 87550 87550 458 458 153198 70164684 4108272
4 -26007 0 84738 0 588 0 0 -15292116 -1212617
5 126942 1 54660 54660 299 299 126942 37955658 1485329
6 157214 1 42634 42634 156 156 157214 24525384 1779876
7 129352 0 40949 0 481 0 0 62218312 1367203
8 234817 1 42312 42312 323 323 234817 75845891 2519076
9 60448 1 37704 37704 452 452 60448 27322496 912684
10 47818 1 16275 16275 109 109 47818 5212162 1443586
11 245546 0 25830 0 115 0 0 28237790 1220017
12 48020 0 12679 0 110 0 0 5282200 984885
13 -1710 1 18014 18014 239 239 -1710 -408690 1457425
14 32648 0 43556 0 247 0 0 8064056 -572920
15 95350 1 24524 24524 497 497 95350 47388950 929144
16 151352 0 6532 0 103 0 0 15589256 1151176
17 288170 0 7123 0 109 0 0 31410530 790090
18 114337 1 20813 20813 502 502 114337 57397174 774497
19 37884 1 37597 37597 248 248 37884 9395232 990576
20 122844 0 17821 0 373 0 0 45820812 454195
21 82340 1 12988 12988 119 119 82340 9798460 876607
22 79801 1 22330 22330 84 84 79801 6703284 711969
23 165548 0 13326 0 102 0 0 16885896 702380
24 116384 0 16189 0 295 0 0 34333280 264449
25 134028 0 7146 0 105 0 0 14072940 450033
26 63838 0 15824 0 64 0 0 4085632 541063
27 74996 1 26088 26088 267 267 74996 20023932 588864
28 31080 0 11326 0 129 0 0 4009320 -37216
29 32168 0 8568 0 37 0 0 1190216 783310
30 49857 0 14416 0 361 0 0 17998377 467359
31 87161 1 3369 3369 28 28 87161 2440508 688779
32 106113 1 11819 11819 85 85 106113 9019605 608419
33 80570 1 6620 6620 44 44 80570 3545080 696348
34 102129 1 4519 4519 49 49 102129 5004321 597793
35 301670 0 2220 0 22 0 0 6636740 821730
36 102313 0 18562 0 155 0 0 15858515 377934
37 88577 0 10327 0 91 0 0 8060507 651939
38 112477 1 5336 5336 81 81 112477 9110637 697458
39 191778 1 2365 2365 79 79 191778 15150462 700368
40 79804 0 4069 0 145 0 0 11571580 225986
41 128294 0 7710 0 816 0 0 104687904 348695
42 96448 0 13718 0 61 0 0 5883328 373683
43 93811 0 4525 0 226 0 0 21201286 501709
44 117520 0 6869 0 105 0 0 12339600 413743
45 69159 0 4628 0 62 0 0 4287858 379825
46 101792 1 3653 3653 24 24 101792 2443008 336260
47 210568 1 1265 1265 26 26 210568 5474768 636765
48 136996 1 7489 7489 322 322 136996 44112712 481231
49 121920 0 4901 0 84 0 0 10241280 469107
50 76403 0 2284 0 33 0 0 2521299 211928
51 108094 1 3160 3160 108 108 108094 11674152 563925
52 134759 1 4150 4150 150 150 134759 20213850 511939
53 188873 1 7285 7285 115 115 188873 21720395 521016
54 146216 1 1134 1134 162 162 146216 23686992 543856
55 156608 1 4658 4658 158 158 156608 24744064 329304
56 61348 0 2384 0 97 0 0 5950756 423262
57 50350 0 3748 0 9 0 0 453150 509665
58 87720 0 5371 0 66 0 0 5789520 455881
59 99489 0 1285 0 107 0 0 10645323 367772
60 87419 1 9327 9327 101 101 87419 8829319 406339
61 94355 1 5565 5565 47 47 94355 4434685 493408
62 60326 0 1528 0 38 0 0 2292388 232942
63 94670 1 3122 3122 34 34 94670 3218780 416002
64 82425 1 7317 7317 84 84 82425 6923700 337430
65 59017 0 2675 0 79 0 0 4662343 361517
66 90829 0 13253 0 947 0 0 86015063 360962
67 80791 0 880 0 74 0 0 5978534 235561
68 100423 1 2053 2053 53 53 100423 5322419 408247
69 131116 0 1424 0 94 0 0 12324904 450296
70 100269 1 4036 4036 63 63 100269 6316947 418799
71 27330 1 3045 3045 58 58 27330 1585140 247405
72 39039 0 5119 0 49 0 0 1912911 378519
73 106885 0 1431 0 34 0 0 3634090 326638
74 79285 0 554 0 11 0 0 872135 328233
75 118881 0 1975 0 35 0 0 4160835 386225
76 77623 1 1286 1286 17 17 77623 1319591 283662
77 114768 0 1012 0 47 0 0 5394096 370225
78 74015 0 810 0 43 0 0 3182645 269236
79 69465 0 1280 0 117 0 0 8127405 365732
80 117869 1 666 666 171 171 117869 20155599 420383
81 60982 0 1380 0 26 0 0 1585532 345811
82 90131 1 4608 4608 73 73 90131 6579563 431809
83 138971 0 876 0 59 0 0 8199289 418876
84 39625 0 814 0 18 0 0 713250 297476
85 102725 0 514 0 15 0 0 1540875 416776
86 64239 1 5692 5692 72 72 64239 4625208 357257
87 90262 0 3642 0 86 0 0 7762532 458343
88 103960 0 540 0 14 0 0 1455440 388386
89 106611 0 2099 0 64 0 0 6823104 358934
90 103345 0 567 0 11 0 0 1136795 407560
91 95551 0 2001 0 52 0 0 4968652 392558
92 82903 1 2949 2949 41 41 82903 3399023 373177
93 63593 0 2253 0 99 0 0 6295707 428370
94 126910 1 6533 6533 75 75 126910 9518250 369419
95 37527 0 1889 0 45 0 0 1688715 358649
96 60247 1 3055 3055 43 43 60247 2590621 376641
97 112995 0 272 0 8 0 0 903960 467427
98 70184 1 1414 1414 198 198 70184 13896432 364885
99 130140 0 2564 0 22 0 0 2863080 436230
100 73221 1 1383 1383 11 11 73221 805431 329118
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Group Costs GrCosts Trades GrTrades
8.964e+04 -4.711e+04 4.514e-01 -1.881e+00 -1.960e+02 3.056e+00
GrDiv TrDiv `Wealth\r`
6.160e-01 1.881e-03 1.678e-02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-69471 -15723 -4965 11133 189067
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.964e+04 7.611e+03 11.777 < 2e-16 ***
Group -4.711e+04 1.850e+04 -2.546 0.01258 *
Costs 4.514e-01 4.932e-01 0.915 0.36239
GrCosts -1.881e+00 7.738e-01 -2.431 0.01702 *
Trades -1.960e+02 5.543e+01 -3.537 0.00064 ***
GrTrades 3.056e+00 6.560e+01 0.047 0.96295
GrDiv 6.160e-01 1.424e-01 4.325 3.9e-05 ***
TrDiv 1.881e-03 4.079e-04 4.612 1.3e-05 ***
`Wealth\r` 1.678e-02 8.868e-03 1.892 0.06164 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 36870 on 91 degrees of freedom
Multiple R-squared: 0.5627, Adjusted R-squared: 0.5242
F-statistic: 14.64 on 8 and 91 DF, p-value: 1.518e-13
> 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.9971266 5.746768e-03 2.873384e-03
[2,] 0.9937334 1.253311e-02 6.266553e-03
[3,] 0.9984770 3.046015e-03 1.523007e-03
[4,] 0.9967984 6.403193e-03 3.201596e-03
[5,] 0.9956213 8.757355e-03 4.378678e-03
[6,] 0.9999494 1.011749e-04 5.058745e-05
[7,] 0.9998878 2.243308e-04 1.121654e-04
[8,] 0.9997518 4.964828e-04 2.482414e-04
[9,] 0.9995204 9.592262e-04 4.796131e-04
[10,] 0.9993414 1.317158e-03 6.585791e-04
[11,] 0.9988996 2.200864e-03 1.100432e-03
[12,] 0.9981536 3.692788e-03 1.846394e-03
[13,] 0.9972599 5.480180e-03 2.740090e-03
[14,] 0.9962379 7.524179e-03 3.762089e-03
[15,] 0.9986180 2.764038e-03 1.382019e-03
[16,] 0.9976972 4.605675e-03 2.302838e-03
[17,] 0.9989381 2.123763e-03 1.061881e-03
[18,] 0.9999488 1.023518e-04 5.117592e-05
[19,] 0.9999049 1.902840e-04 9.514199e-05
[20,] 0.9999215 1.570282e-04 7.851409e-05
[21,] 0.9998588 2.823905e-04 1.411952e-04
[22,] 0.9998777 2.445900e-04 1.222950e-04
[23,] 0.9998303 3.393737e-04 1.696868e-04
[24,] 1.0000000 1.183653e-11 5.918267e-12
[25,] 1.0000000 2.608169e-11 1.304084e-11
[26,] 1.0000000 4.671369e-11 2.335685e-11
[27,] 1.0000000 1.043491e-10 5.217453e-11
[28,] 1.0000000 2.626626e-10 1.313313e-10
[29,] 1.0000000 5.339552e-10 2.669776e-10
[30,] 1.0000000 1.969100e-11 9.845498e-12
[31,] 1.0000000 1.694164e-11 8.470820e-12
[32,] 1.0000000 4.208699e-11 2.104349e-11
[33,] 1.0000000 4.799093e-11 2.399547e-11
[34,] 1.0000000 9.292133e-11 4.646067e-11
[35,] 1.0000000 2.546211e-10 1.273105e-10
[36,] 1.0000000 1.483800e-10 7.419001e-11
[37,] 1.0000000 6.893977e-12 3.446989e-12
[38,] 1.0000000 1.565133e-11 7.825663e-12
[39,] 1.0000000 3.095287e-11 1.547644e-11
[40,] 1.0000000 8.895508e-11 4.447754e-11
[41,] 1.0000000 1.841101e-10 9.205506e-11
[42,] 1.0000000 5.470582e-10 2.735291e-10
[43,] 1.0000000 2.726800e-10 1.363400e-10
[44,] 1.0000000 1.803863e-10 9.019315e-11
[45,] 1.0000000 4.348451e-10 2.174225e-10
[46,] 1.0000000 3.392505e-11 1.696252e-11
[47,] 1.0000000 1.094181e-10 5.470906e-11
[48,] 1.0000000 3.418733e-10 1.709366e-10
[49,] 1.0000000 9.959048e-10 4.979524e-10
[50,] 1.0000000 2.420647e-09 1.210323e-09
[51,] 1.0000000 6.381178e-09 3.190589e-09
[52,] 1.0000000 1.884487e-08 9.422433e-09
[53,] 1.0000000 5.729793e-08 2.864896e-08
[54,] 0.9999999 1.498761e-07 7.493803e-08
[55,] 0.9999998 4.086101e-07 2.043051e-07
[56,] 0.9999996 7.525075e-07 3.762538e-07
[57,] 0.9999991 1.866749e-06 9.333746e-07
[58,] 0.9999988 2.457707e-06 1.228854e-06
[59,] 0.9999966 6.788485e-06 3.394243e-06
[60,] 0.9999933 1.340424e-05 6.702118e-06
[61,] 0.9999868 2.638637e-05 1.319318e-05
[62,] 0.9999759 4.815223e-05 2.407612e-05
[63,] 0.9999388 1.223861e-04 6.119307e-05
[64,] 0.9998936 2.127517e-04 1.063759e-04
[65,] 0.9998619 2.762583e-04 1.381291e-04
[66,] 0.9996898 6.204551e-04 3.102275e-04
[67,] 0.9994297 1.140548e-03 5.702739e-04
[68,] 0.9989079 2.184190e-03 1.092095e-03
[69,] 0.9999719 5.614010e-05 2.807005e-05
[70,] 0.9999166 1.667735e-04 8.338676e-05
[71,] 0.9998753 2.494060e-04 1.247030e-04
[72,] 0.9996596 6.807477e-04 3.403739e-04
[73,] 0.9996328 7.343375e-04 3.671687e-04
[74,] 0.9985363 2.927405e-03 1.463703e-03
[75,] 0.9965193 6.961488e-03 3.480744e-03
[76,] 0.9979741 4.051719e-03 2.025859e-03
[77,] 0.9953841 9.231819e-03 4.615910e-03
> postscript(file="/var/www/html/freestat/rcomp/tmp/1ib371293220930.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/www/html/freestat/rcomp/tmp/2ib371293220930.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/www/html/freestat/rcomp/tmp/3bk2s1293220930.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/www/html/freestat/rcomp/tmp/4bk2s1293220930.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/www/html/freestat/rcomp/tmp/5bk2s1293220930.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 = 100
Frequency = 1
1 2 3 4 5 6
-58438.7622 -28992.2294 28940.6118 10483.2452 45748.4017 32900.5722
7 8 9 10 11 12
-24454.7455 -14471.6527 55110.0375 -13891.7613 93200.7763 -52243.0167
13 14 15 16 17 18
5005.7694 -33788.5255 20330.2078 30313.5664 144340.1587 7049.3279
19 20 21 22 23 24
39337.9495 4470.3697 -2518.4813 11693.7959 46338.3973 8248.0465
25 26 27 28 29 30
27722.1860 -37164.4799 27547.8944 -45301.7535 -69470.6271 -17218.4477
31 32 33 34 35 36
-14989.8777 4342.3036 -11989.4326 -6841.2581 189066.8239 -1493.2431
37 38 39 40 41 42
-13988.0692 -4920.5768 9485.8610 -8806.2912 -7627.6556 -4764.6368
43 44 45 46 47 48
-1866.0736 15208.6386 -24855.8974 -3827.0044 24167.2235 -8128.6132
49 50 51 52 53 54
19398.1278 -16098.6281 -7085.3775 -2516.5333 13003.8943 -7182.2355
55 56 57 58 59 60
2686.5999 -28649.1829 -48623.5209 -9947.0563 4048.9833 437.8711
61 62 63 64 65 66
-5893.6338 -30776.1599 -8188.4092 -2893.5374 -31180.6889 13004.6110
67 68 69 70 71 72
-9938.7276 -7667.8876 28520.5683 -5009.6941 -23622.0857 -53256.8876
73 74 75 76 77 78
10946.4352 -15598.1141 20902.1772 -14846.8573 17525.1392 -18066.4240
79 80 81 82 83 84
-19241.8590 -8284.6717 -32970.2466 -6867.0948 38049.0522 -53188.2095
85 86 87 88 89 90
5900.4115 -10525.0620 -6456.2273 7564.7333 9711.6247 6627.0432
91 92 93 94 95 96
-732.6208 -11223.5774 -26687.5305 5912.8709 -53339.7384 -17923.0414
97 98 99 100
15255.4618 -7609.8368 30948.7082 -17352.0071
> postscript(file="/var/www/html/freestat/rcomp/tmp/63bjd1293220930.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 = 100
Frequency = 1
lag(myerror, k = 1) myerror
0 -58438.7622 NA
1 -28992.2294 -58438.7622
2 28940.6118 -28992.2294
3 10483.2452 28940.6118
4 45748.4017 10483.2452
5 32900.5722 45748.4017
6 -24454.7455 32900.5722
7 -14471.6527 -24454.7455
8 55110.0375 -14471.6527
9 -13891.7613 55110.0375
10 93200.7763 -13891.7613
11 -52243.0167 93200.7763
12 5005.7694 -52243.0167
13 -33788.5255 5005.7694
14 20330.2078 -33788.5255
15 30313.5664 20330.2078
16 144340.1587 30313.5664
17 7049.3279 144340.1587
18 39337.9495 7049.3279
19 4470.3697 39337.9495
20 -2518.4813 4470.3697
21 11693.7959 -2518.4813
22 46338.3973 11693.7959
23 8248.0465 46338.3973
24 27722.1860 8248.0465
25 -37164.4799 27722.1860
26 27547.8944 -37164.4799
27 -45301.7535 27547.8944
28 -69470.6271 -45301.7535
29 -17218.4477 -69470.6271
30 -14989.8777 -17218.4477
31 4342.3036 -14989.8777
32 -11989.4326 4342.3036
33 -6841.2581 -11989.4326
34 189066.8239 -6841.2581
35 -1493.2431 189066.8239
36 -13988.0692 -1493.2431
37 -4920.5768 -13988.0692
38 9485.8610 -4920.5768
39 -8806.2912 9485.8610
40 -7627.6556 -8806.2912
41 -4764.6368 -7627.6556
42 -1866.0736 -4764.6368
43 15208.6386 -1866.0736
44 -24855.8974 15208.6386
45 -3827.0044 -24855.8974
46 24167.2235 -3827.0044
47 -8128.6132 24167.2235
48 19398.1278 -8128.6132
49 -16098.6281 19398.1278
50 -7085.3775 -16098.6281
51 -2516.5333 -7085.3775
52 13003.8943 -2516.5333
53 -7182.2355 13003.8943
54 2686.5999 -7182.2355
55 -28649.1829 2686.5999
56 -48623.5209 -28649.1829
57 -9947.0563 -48623.5209
58 4048.9833 -9947.0563
59 437.8711 4048.9833
60 -5893.6338 437.8711
61 -30776.1599 -5893.6338
62 -8188.4092 -30776.1599
63 -2893.5374 -8188.4092
64 -31180.6889 -2893.5374
65 13004.6110 -31180.6889
66 -9938.7276 13004.6110
67 -7667.8876 -9938.7276
68 28520.5683 -7667.8876
69 -5009.6941 28520.5683
70 -23622.0857 -5009.6941
71 -53256.8876 -23622.0857
72 10946.4352 -53256.8876
73 -15598.1141 10946.4352
74 20902.1772 -15598.1141
75 -14846.8573 20902.1772
76 17525.1392 -14846.8573
77 -18066.4240 17525.1392
78 -19241.8590 -18066.4240
79 -8284.6717 -19241.8590
80 -32970.2466 -8284.6717
81 -6867.0948 -32970.2466
82 38049.0522 -6867.0948
83 -53188.2095 38049.0522
84 5900.4115 -53188.2095
85 -10525.0620 5900.4115
86 -6456.2273 -10525.0620
87 7564.7333 -6456.2273
88 9711.6247 7564.7333
89 6627.0432 9711.6247
90 -732.6208 6627.0432
91 -11223.5774 -732.6208
92 -26687.5305 -11223.5774
93 5912.8709 -26687.5305
94 -53339.7384 5912.8709
95 -17923.0414 -53339.7384
96 15255.4618 -17923.0414
97 -7609.8368 15255.4618
98 30948.7082 -7609.8368
99 -17352.0071 30948.7082
100 NA -17352.0071
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -28992.2294 -58438.7622
[2,] 28940.6118 -28992.2294
[3,] 10483.2452 28940.6118
[4,] 45748.4017 10483.2452
[5,] 32900.5722 45748.4017
[6,] -24454.7455 32900.5722
[7,] -14471.6527 -24454.7455
[8,] 55110.0375 -14471.6527
[9,] -13891.7613 55110.0375
[10,] 93200.7763 -13891.7613
[11,] -52243.0167 93200.7763
[12,] 5005.7694 -52243.0167
[13,] -33788.5255 5005.7694
[14,] 20330.2078 -33788.5255
[15,] 30313.5664 20330.2078
[16,] 144340.1587 30313.5664
[17,] 7049.3279 144340.1587
[18,] 39337.9495 7049.3279
[19,] 4470.3697 39337.9495
[20,] -2518.4813 4470.3697
[21,] 11693.7959 -2518.4813
[22,] 46338.3973 11693.7959
[23,] 8248.0465 46338.3973
[24,] 27722.1860 8248.0465
[25,] -37164.4799 27722.1860
[26,] 27547.8944 -37164.4799
[27,] -45301.7535 27547.8944
[28,] -69470.6271 -45301.7535
[29,] -17218.4477 -69470.6271
[30,] -14989.8777 -17218.4477
[31,] 4342.3036 -14989.8777
[32,] -11989.4326 4342.3036
[33,] -6841.2581 -11989.4326
[34,] 189066.8239 -6841.2581
[35,] -1493.2431 189066.8239
[36,] -13988.0692 -1493.2431
[37,] -4920.5768 -13988.0692
[38,] 9485.8610 -4920.5768
[39,] -8806.2912 9485.8610
[40,] -7627.6556 -8806.2912
[41,] -4764.6368 -7627.6556
[42,] -1866.0736 -4764.6368
[43,] 15208.6386 -1866.0736
[44,] -24855.8974 15208.6386
[45,] -3827.0044 -24855.8974
[46,] 24167.2235 -3827.0044
[47,] -8128.6132 24167.2235
[48,] 19398.1278 -8128.6132
[49,] -16098.6281 19398.1278
[50,] -7085.3775 -16098.6281
[51,] -2516.5333 -7085.3775
[52,] 13003.8943 -2516.5333
[53,] -7182.2355 13003.8943
[54,] 2686.5999 -7182.2355
[55,] -28649.1829 2686.5999
[56,] -48623.5209 -28649.1829
[57,] -9947.0563 -48623.5209
[58,] 4048.9833 -9947.0563
[59,] 437.8711 4048.9833
[60,] -5893.6338 437.8711
[61,] -30776.1599 -5893.6338
[62,] -8188.4092 -30776.1599
[63,] -2893.5374 -8188.4092
[64,] -31180.6889 -2893.5374
[65,] 13004.6110 -31180.6889
[66,] -9938.7276 13004.6110
[67,] -7667.8876 -9938.7276
[68,] 28520.5683 -7667.8876
[69,] -5009.6941 28520.5683
[70,] -23622.0857 -5009.6941
[71,] -53256.8876 -23622.0857
[72,] 10946.4352 -53256.8876
[73,] -15598.1141 10946.4352
[74,] 20902.1772 -15598.1141
[75,] -14846.8573 20902.1772
[76,] 17525.1392 -14846.8573
[77,] -18066.4240 17525.1392
[78,] -19241.8590 -18066.4240
[79,] -8284.6717 -19241.8590
[80,] -32970.2466 -8284.6717
[81,] -6867.0948 -32970.2466
[82,] 38049.0522 -6867.0948
[83,] -53188.2095 38049.0522
[84,] 5900.4115 -53188.2095
[85,] -10525.0620 5900.4115
[86,] -6456.2273 -10525.0620
[87,] 7564.7333 -6456.2273
[88,] 9711.6247 7564.7333
[89,] 6627.0432 9711.6247
[90,] -732.6208 6627.0432
[91,] -11223.5774 -732.6208
[92,] -26687.5305 -11223.5774
[93,] 5912.8709 -26687.5305
[94,] -53339.7384 5912.8709
[95,] -17923.0414 -53339.7384
[96,] 15255.4618 -17923.0414
[97,] -7609.8368 15255.4618
[98,] 30948.7082 -7609.8368
[99,] -17352.0071 30948.7082
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -28992.2294 -58438.7622
2 28940.6118 -28992.2294
3 10483.2452 28940.6118
4 45748.4017 10483.2452
5 32900.5722 45748.4017
6 -24454.7455 32900.5722
7 -14471.6527 -24454.7455
8 55110.0375 -14471.6527
9 -13891.7613 55110.0375
10 93200.7763 -13891.7613
11 -52243.0167 93200.7763
12 5005.7694 -52243.0167
13 -33788.5255 5005.7694
14 20330.2078 -33788.5255
15 30313.5664 20330.2078
16 144340.1587 30313.5664
17 7049.3279 144340.1587
18 39337.9495 7049.3279
19 4470.3697 39337.9495
20 -2518.4813 4470.3697
21 11693.7959 -2518.4813
22 46338.3973 11693.7959
23 8248.0465 46338.3973
24 27722.1860 8248.0465
25 -37164.4799 27722.1860
26 27547.8944 -37164.4799
27 -45301.7535 27547.8944
28 -69470.6271 -45301.7535
29 -17218.4477 -69470.6271
30 -14989.8777 -17218.4477
31 4342.3036 -14989.8777
32 -11989.4326 4342.3036
33 -6841.2581 -11989.4326
34 189066.8239 -6841.2581
35 -1493.2431 189066.8239
36 -13988.0692 -1493.2431
37 -4920.5768 -13988.0692
38 9485.8610 -4920.5768
39 -8806.2912 9485.8610
40 -7627.6556 -8806.2912
41 -4764.6368 -7627.6556
42 -1866.0736 -4764.6368
43 15208.6386 -1866.0736
44 -24855.8974 15208.6386
45 -3827.0044 -24855.8974
46 24167.2235 -3827.0044
47 -8128.6132 24167.2235
48 19398.1278 -8128.6132
49 -16098.6281 19398.1278
50 -7085.3775 -16098.6281
51 -2516.5333 -7085.3775
52 13003.8943 -2516.5333
53 -7182.2355 13003.8943
54 2686.5999 -7182.2355
55 -28649.1829 2686.5999
56 -48623.5209 -28649.1829
57 -9947.0563 -48623.5209
58 4048.9833 -9947.0563
59 437.8711 4048.9833
60 -5893.6338 437.8711
61 -30776.1599 -5893.6338
62 -8188.4092 -30776.1599
63 -2893.5374 -8188.4092
64 -31180.6889 -2893.5374
65 13004.6110 -31180.6889
66 -9938.7276 13004.6110
67 -7667.8876 -9938.7276
68 28520.5683 -7667.8876
69 -5009.6941 28520.5683
70 -23622.0857 -5009.6941
71 -53256.8876 -23622.0857
72 10946.4352 -53256.8876
73 -15598.1141 10946.4352
74 20902.1772 -15598.1141
75 -14846.8573 20902.1772
76 17525.1392 -14846.8573
77 -18066.4240 17525.1392
78 -19241.8590 -18066.4240
79 -8284.6717 -19241.8590
80 -32970.2466 -8284.6717
81 -6867.0948 -32970.2466
82 38049.0522 -6867.0948
83 -53188.2095 38049.0522
84 5900.4115 -53188.2095
85 -10525.0620 5900.4115
86 -6456.2273 -10525.0620
87 7564.7333 -6456.2273
88 9711.6247 7564.7333
89 6627.0432 9711.6247
90 -732.6208 6627.0432
91 -11223.5774 -732.6208
92 -26687.5305 -11223.5774
93 5912.8709 -26687.5305
94 -53339.7384 5912.8709
95 -17923.0414 -53339.7384
96 15255.4618 -17923.0414
97 -7609.8368 15255.4618
98 30948.7082 -7609.8368
99 -17352.0071 30948.7082
> 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/freestat/rcomp/tmp/73bjd1293220930.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/www/html/freestat/rcomp/tmp/8e20g1293220930.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/www/html/freestat/rcomp/tmp/9e20g1293220930.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/www/html/freestat/rcomp/tmp/10puzj1293220930.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/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11auyp1293220930.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/freestat/rcomp/tmp/1233x91293220930.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/freestat/rcomp/tmp/13a4u31293220930.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/freestat/rcomp/tmp/14kec61293220930.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/freestat/rcomp/tmp/156wsu1293220930.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/freestat/rcomp/tmp/16koq31293220930.tab")
+ }
>
> try(system("convert tmp/1ib371293220930.ps tmp/1ib371293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ib371293220930.ps tmp/2ib371293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bk2s1293220930.ps tmp/3bk2s1293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/4bk2s1293220930.ps tmp/4bk2s1293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/5bk2s1293220930.ps tmp/5bk2s1293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/63bjd1293220930.ps tmp/63bjd1293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/73bjd1293220930.ps tmp/73bjd1293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/8e20g1293220930.ps tmp/8e20g1293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/9e20g1293220930.ps tmp/9e20g1293220930.png",intern=TRUE))
character(0)
> try(system("convert tmp/10puzj1293220930.ps tmp/10puzj1293220930.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.749 2.573 5.252