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 = '9'
> #'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
Wealth\r Group Costs GrCosts Trades GrTrades Dividends GrDiv TrDiv
1 6282929 1 162556 162556 1081 1081 213118 213118 230380558
2 4324047 1 29790 29790 309 309 81767 81767 25266003
3 4108272 1 87550 87550 458 458 153198 153198 70164684
4 -1212617 0 84738 0 588 0 -26007 0 -15292116
5 1485329 1 54660 54660 299 299 126942 126942 37955658
6 1779876 1 42634 42634 156 156 157214 157214 24525384
7 1367203 0 40949 0 481 0 129352 0 62218312
8 2519076 1 42312 42312 323 323 234817 234817 75845891
9 912684 1 37704 37704 452 452 60448 60448 27322496
10 1443586 1 16275 16275 109 109 47818 47818 5212162
11 1220017 0 25830 0 115 0 245546 0 28237790
12 984885 0 12679 0 110 0 48020 0 5282200
13 1457425 1 18014 18014 239 239 -1710 -1710 -408690
14 -572920 0 43556 0 247 0 32648 0 8064056
15 929144 1 24524 24524 497 497 95350 95350 47388950
16 1151176 0 6532 0 103 0 151352 0 15589256
17 790090 0 7123 0 109 0 288170 0 31410530
18 774497 1 20813 20813 502 502 114337 114337 57397174
19 990576 1 37597 37597 248 248 37884 37884 9395232
20 454195 0 17821 0 373 0 122844 0 45820812
21 876607 1 12988 12988 119 119 82340 82340 9798460
22 711969 1 22330 22330 84 84 79801 79801 6703284
23 702380 0 13326 0 102 0 165548 0 16885896
24 264449 0 16189 0 295 0 116384 0 34333280
25 450033 0 7146 0 105 0 134028 0 14072940
26 541063 0 15824 0 64 0 63838 0 4085632
27 588864 1 26088 26088 267 267 74996 74996 20023932
28 -37216 0 11326 0 129 0 31080 0 4009320
29 783310 0 8568 0 37 0 32168 0 1190216
30 467359 0 14416 0 361 0 49857 0 17998377
31 688779 1 3369 3369 28 28 87161 87161 2440508
32 608419 1 11819 11819 85 85 106113 106113 9019605
33 696348 1 6620 6620 44 44 80570 80570 3545080
34 597793 1 4519 4519 49 49 102129 102129 5004321
35 821730 0 2220 0 22 0 301670 0 6636740
36 377934 0 18562 0 155 0 102313 0 15858515
37 651939 0 10327 0 91 0 88577 0 8060507
38 697458 1 5336 5336 81 81 112477 112477 9110637
39 700368 1 2365 2365 79 79 191778 191778 15150462
40 225986 0 4069 0 145 0 79804 0 11571580
41 348695 0 7710 0 816 0 128294 0 104687904
42 373683 0 13718 0 61 0 96448 0 5883328
43 501709 0 4525 0 226 0 93811 0 21201286
44 413743 0 6869 0 105 0 117520 0 12339600
45 379825 0 4628 0 62 0 69159 0 4287858
46 336260 1 3653 3653 24 24 101792 101792 2443008
47 636765 1 1265 1265 26 26 210568 210568 5474768
48 481231 1 7489 7489 322 322 136996 136996 44112712
49 469107 0 4901 0 84 0 121920 0 10241280
50 211928 0 2284 0 33 0 76403 0 2521299
51 563925 1 3160 3160 108 108 108094 108094 11674152
52 511939 1 4150 4150 150 150 134759 134759 20213850
53 521016 1 7285 7285 115 115 188873 188873 21720395
54 543856 1 1134 1134 162 162 146216 146216 23686992
55 329304 1 4658 4658 158 158 156608 156608 24744064
56 423262 0 2384 0 97 0 61348 0 5950756
57 509665 0 3748 0 9 0 50350 0 453150
58 455881 0 5371 0 66 0 87720 0 5789520
59 367772 0 1285 0 107 0 99489 0 10645323
60 406339 1 9327 9327 101 101 87419 87419 8829319
61 493408 1 5565 5565 47 47 94355 94355 4434685
62 232942 0 1528 0 38 0 60326 0 2292388
63 416002 1 3122 3122 34 34 94670 94670 3218780
64 337430 1 7317 7317 84 84 82425 82425 6923700
65 361517 0 2675 0 79 0 59017 0 4662343
66 360962 0 13253 0 947 0 90829 0 86015063
67 235561 0 880 0 74 0 80791 0 5978534
68 408247 1 2053 2053 53 53 100423 100423 5322419
69 450296 0 1424 0 94 0 131116 0 12324904
70 418799 1 4036 4036 63 63 100269 100269 6316947
71 247405 1 3045 3045 58 58 27330 27330 1585140
72 378519 0 5119 0 49 0 39039 0 1912911
73 326638 0 1431 0 34 0 106885 0 3634090
74 328233 0 554 0 11 0 79285 0 872135
75 386225 0 1975 0 35 0 118881 0 4160835
76 283662 1 1286 1286 17 17 77623 77623 1319591
77 370225 0 1012 0 47 0 114768 0 5394096
78 269236 0 810 0 43 0 74015 0 3182645
79 365732 0 1280 0 117 0 69465 0 8127405
80 420383 1 666 666 171 171 117869 117869 20155599
81 345811 0 1380 0 26 0 60982 0 1585532
82 431809 1 4608 4608 73 73 90131 90131 6579563
83 418876 0 876 0 59 0 138971 0 8199289
84 297476 0 814 0 18 0 39625 0 713250
85 416776 0 514 0 15 0 102725 0 1540875
86 357257 1 5692 5692 72 72 64239 64239 4625208
87 458343 0 3642 0 86 0 90262 0 7762532
88 388386 0 540 0 14 0 103960 0 1455440
89 358934 0 2099 0 64 0 106611 0 6823104
90 407560 0 567 0 11 0 103345 0 1136795
91 392558 0 2001 0 52 0 95551 0 4968652
92 373177 1 2949 2949 41 41 82903 82903 3399023
93 428370 0 2253 0 99 0 63593 0 6295707
94 369419 1 6533 6533 75 75 126910 126910 9518250
95 358649 0 1889 0 45 0 37527 0 1688715
96 376641 1 3055 3055 43 43 60247 60247 2590621
97 467427 0 272 0 8 0 112995 0 903960
98 364885 1 1414 1414 198 198 70184 70184 13896432
99 436230 0 2564 0 22 0 130140 0 2863080
100 329118 1 1383 1383 11 11 73221 73221 805431
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Group Costs GrCosts Trades GrTrades
2.472e+05 1.824e+05 -3.390e+00 3.661e+01 -9.509e+02 -6.481e+01
Dividends GrDiv TrDiv
2.256e+00 -2.694e+00 8.814e-03
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-735059 -157487 -70014 84406 3031952
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.472e+05 1.378e+05 1.794 0.0762 .
Group 1.824e+05 2.212e+05 0.824 0.4119
Costs -3.390e+00 5.733e+00 -0.591 0.5558
GrCosts 3.661e+01 8.427e+00 4.344 3.63e-05 ***
Trades -9.509e+02 6.782e+02 -1.402 0.1643
GrTrades -6.481e+01 7.606e+02 -0.085 0.9323
Dividends 2.256e+00 1.192e+00 1.892 0.0616 .
GrDiv -2.694e+00 1.791e+00 -1.504 0.1361
TrDiv 8.814e-03 5.171e-03 1.705 0.0917 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 427500 on 91 degrees of freedom
Multiple R-squared: 0.7807, Adjusted R-squared: 0.7614
F-statistic: 40.5 on 8 and 91 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 1.0000000 1.033658e-23 5.168288e-24
[2,] 1.0000000 4.397215e-26 2.198608e-26
[3,] 1.0000000 1.143513e-29 5.717566e-30
[4,] 1.0000000 7.555857e-30 3.777929e-30
[5,] 1.0000000 6.450887e-33 3.225443e-33
[6,] 1.0000000 1.016877e-32 5.084385e-33
[7,] 1.0000000 2.891019e-32 1.445510e-32
[8,] 1.0000000 9.960913e-33 4.980457e-33
[9,] 1.0000000 2.217084e-32 1.108542e-32
[10,] 1.0000000 2.956038e-33 1.478019e-33
[11,] 1.0000000 3.071784e-33 1.535892e-33
[12,] 1.0000000 1.239624e-32 6.198118e-33
[13,] 1.0000000 1.474330e-32 7.371650e-33
[14,] 1.0000000 9.695610e-32 4.847805e-32
[15,] 1.0000000 5.561865e-31 2.780933e-31
[16,] 1.0000000 1.089926e-30 5.449632e-31
[17,] 1.0000000 1.644172e-32 8.220858e-33
[18,] 1.0000000 5.494118e-35 2.747059e-35
[19,] 1.0000000 3.920701e-34 1.960350e-34
[20,] 1.0000000 1.044335e-34 5.221673e-35
[21,] 1.0000000 4.471712e-34 2.235856e-34
[22,] 1.0000000 3.682900e-35 1.841450e-35
[23,] 1.0000000 5.396272e-35 2.698136e-35
[24,] 1.0000000 1.522614e-34 7.613068e-35
[25,] 1.0000000 3.570169e-34 1.785085e-34
[26,] 1.0000000 1.509830e-34 7.549152e-35
[27,] 1.0000000 5.165974e-36 2.582987e-36
[28,] 1.0000000 1.108873e-35 5.544364e-36
[29,] 1.0000000 9.072300e-36 4.536150e-36
[30,] 1.0000000 5.308463e-35 2.654231e-35
[31,] 1.0000000 5.995773e-35 2.997887e-35
[32,] 1.0000000 1.315342e-34 6.576711e-35
[33,] 1.0000000 7.240782e-34 3.620391e-34
[34,] 1.0000000 5.862044e-33 2.931022e-33
[35,] 1.0000000 2.812520e-32 1.406260e-32
[36,] 1.0000000 2.635542e-31 1.317771e-31
[37,] 1.0000000 1.523154e-30 7.615768e-31
[38,] 1.0000000 1.413838e-29 7.069189e-30
[39,] 1.0000000 4.123533e-30 2.061766e-30
[40,] 1.0000000 3.230425e-30 1.615213e-30
[41,] 1.0000000 1.450701e-29 7.253506e-30
[42,] 1.0000000 1.349946e-28 6.749730e-29
[43,] 1.0000000 7.755483e-29 3.877741e-29
[44,] 1.0000000 2.834822e-28 1.417411e-28
[45,] 1.0000000 1.507356e-27 7.536782e-28
[46,] 1.0000000 9.289898e-28 4.644949e-28
[47,] 1.0000000 1.024469e-26 5.122345e-27
[48,] 1.0000000 1.070649e-25 5.353243e-26
[49,] 1.0000000 9.611115e-25 4.805557e-25
[50,] 1.0000000 1.428948e-24 7.144740e-25
[51,] 1.0000000 1.798383e-24 8.991914e-25
[52,] 1.0000000 1.596682e-23 7.983410e-24
[53,] 1.0000000 1.320938e-22 6.604692e-23
[54,] 1.0000000 1.478523e-21 7.392613e-22
[55,] 1.0000000 1.293218e-20 6.466089e-21
[56,] 1.0000000 4.557225e-21 2.278613e-21
[57,] 1.0000000 4.839985e-20 2.419992e-20
[58,] 1.0000000 3.417178e-19 1.708589e-19
[59,] 1.0000000 3.241690e-18 1.620845e-18
[60,] 1.0000000 1.933736e-17 9.668682e-18
[61,] 1.0000000 2.138713e-16 1.069357e-16
[62,] 1.0000000 7.481749e-16 3.740874e-16
[63,] 1.0000000 7.177123e-15 3.588561e-15
[64,] 1.0000000 5.537067e-14 2.768533e-14
[65,] 1.0000000 1.980990e-13 9.904948e-14
[66,] 1.0000000 1.738649e-12 8.693246e-13
[67,] 1.0000000 1.691614e-12 8.458072e-13
[68,] 1.0000000 1.707892e-11 8.539462e-12
[69,] 1.0000000 1.896702e-11 9.483511e-12
[70,] 1.0000000 2.810031e-10 1.405015e-10
[71,] 1.0000000 7.951780e-10 3.975890e-10
[72,] 1.0000000 1.102868e-08 5.514338e-09
[73,] 0.9999999 1.650593e-07 8.252964e-08
[74,] 0.9999989 2.202584e-06 1.101292e-06
[75,] 0.9999920 1.606091e-05 8.030457e-06
[76,] 0.9999911 1.775782e-05 8.878910e-06
[77,] 0.9999348 1.303868e-04 6.519338e-05
> postscript(file="/var/www/html/freestat/rcomp/tmp/1845n1291364961.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/21dn81291364961.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/31dn81291364961.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/41dn81291364961.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/51dn81291364961.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
-385354.276 3031951.861 684521.405 -419917.413 -735058.574 -54673.022
7 8 9 10 11 12
876008.912 446465.076 -524497.192 559157.609 366925.180 730410.155
13 14 15 16 17 18
675130.635 -582281.337 -186143.292 545236.147 -256257.720 -292351.579
19 20 21 22 23 24
-502111.672 -58892.047 86204.203 -398109.843 75068.519 -212510.435
25 26 27 28 29 30
-99474.932 228372.697 -579685.791 -228775.340 517314.639 341210.922
31 32 33 34 35 36
192414.104 -160414.226 95629.064 68514.934 -136059.940 -29514.627
37 38 39 40 41 42
255437.451 141881.057 222926.524 -151541.907 -308606.418 -38414.301
43 44 45 46 47 48
86268.023 -84183.615 13486.942 -167216.843 235540.637 -198863.700
49 50 51 52 53 54
-46891.407 -190703.858 83533.225 -22273.982 -142461.650 96411.623
55 56 57 58 59 60
-244021.200 85560.439 166181.431 40755.448 -91572.997 -269978.532
61 62 63 64 65 66
-71027.436 -129211.004 -69636.892 -274781.047 24301.778 96124.721
67 68 69 70 71 72
-173218.164 -38610.124 -107094.288 -92600.863 -226384.569 90369.202
73 74 75 76 77 78
-156511.488 -93148.911 -125835.323 -148983.735 -135281.252 -129326.659
79 80 81 82 83 84
5806.934 16339.721 -23503.635 -95186.842 -155009.175 -25494.132
85 86 87 88 89 90
-59713.673 -200870.123 33247.147 -90999.522 -120915.516 -70390.488
91 92 93 94 95 96
-57736.898 -106346.630 84020.761 -229284.273 61131.895 -107166.188
97 98 99 100
-34094.584 -2288.539 -100156.337 -110239.042
> postscript(file="/var/www/html/freestat/rcomp/tmp/6u44t1291364961.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 -385354.276 NA
1 3031951.861 -385354.276
2 684521.405 3031951.861
3 -419917.413 684521.405
4 -735058.574 -419917.413
5 -54673.022 -735058.574
6 876008.912 -54673.022
7 446465.076 876008.912
8 -524497.192 446465.076
9 559157.609 -524497.192
10 366925.180 559157.609
11 730410.155 366925.180
12 675130.635 730410.155
13 -582281.337 675130.635
14 -186143.292 -582281.337
15 545236.147 -186143.292
16 -256257.720 545236.147
17 -292351.579 -256257.720
18 -502111.672 -292351.579
19 -58892.047 -502111.672
20 86204.203 -58892.047
21 -398109.843 86204.203
22 75068.519 -398109.843
23 -212510.435 75068.519
24 -99474.932 -212510.435
25 228372.697 -99474.932
26 -579685.791 228372.697
27 -228775.340 -579685.791
28 517314.639 -228775.340
29 341210.922 517314.639
30 192414.104 341210.922
31 -160414.226 192414.104
32 95629.064 -160414.226
33 68514.934 95629.064
34 -136059.940 68514.934
35 -29514.627 -136059.940
36 255437.451 -29514.627
37 141881.057 255437.451
38 222926.524 141881.057
39 -151541.907 222926.524
40 -308606.418 -151541.907
41 -38414.301 -308606.418
42 86268.023 -38414.301
43 -84183.615 86268.023
44 13486.942 -84183.615
45 -167216.843 13486.942
46 235540.637 -167216.843
47 -198863.700 235540.637
48 -46891.407 -198863.700
49 -190703.858 -46891.407
50 83533.225 -190703.858
51 -22273.982 83533.225
52 -142461.650 -22273.982
53 96411.623 -142461.650
54 -244021.200 96411.623
55 85560.439 -244021.200
56 166181.431 85560.439
57 40755.448 166181.431
58 -91572.997 40755.448
59 -269978.532 -91572.997
60 -71027.436 -269978.532
61 -129211.004 -71027.436
62 -69636.892 -129211.004
63 -274781.047 -69636.892
64 24301.778 -274781.047
65 96124.721 24301.778
66 -173218.164 96124.721
67 -38610.124 -173218.164
68 -107094.288 -38610.124
69 -92600.863 -107094.288
70 -226384.569 -92600.863
71 90369.202 -226384.569
72 -156511.488 90369.202
73 -93148.911 -156511.488
74 -125835.323 -93148.911
75 -148983.735 -125835.323
76 -135281.252 -148983.735
77 -129326.659 -135281.252
78 5806.934 -129326.659
79 16339.721 5806.934
80 -23503.635 16339.721
81 -95186.842 -23503.635
82 -155009.175 -95186.842
83 -25494.132 -155009.175
84 -59713.673 -25494.132
85 -200870.123 -59713.673
86 33247.147 -200870.123
87 -90999.522 33247.147
88 -120915.516 -90999.522
89 -70390.488 -120915.516
90 -57736.898 -70390.488
91 -106346.630 -57736.898
92 84020.761 -106346.630
93 -229284.273 84020.761
94 61131.895 -229284.273
95 -107166.188 61131.895
96 -34094.584 -107166.188
97 -2288.539 -34094.584
98 -100156.337 -2288.539
99 -110239.042 -100156.337
100 NA -110239.042
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3031951.861 -385354.276
[2,] 684521.405 3031951.861
[3,] -419917.413 684521.405
[4,] -735058.574 -419917.413
[5,] -54673.022 -735058.574
[6,] 876008.912 -54673.022
[7,] 446465.076 876008.912
[8,] -524497.192 446465.076
[9,] 559157.609 -524497.192
[10,] 366925.180 559157.609
[11,] 730410.155 366925.180
[12,] 675130.635 730410.155
[13,] -582281.337 675130.635
[14,] -186143.292 -582281.337
[15,] 545236.147 -186143.292
[16,] -256257.720 545236.147
[17,] -292351.579 -256257.720
[18,] -502111.672 -292351.579
[19,] -58892.047 -502111.672
[20,] 86204.203 -58892.047
[21,] -398109.843 86204.203
[22,] 75068.519 -398109.843
[23,] -212510.435 75068.519
[24,] -99474.932 -212510.435
[25,] 228372.697 -99474.932
[26,] -579685.791 228372.697
[27,] -228775.340 -579685.791
[28,] 517314.639 -228775.340
[29,] 341210.922 517314.639
[30,] 192414.104 341210.922
[31,] -160414.226 192414.104
[32,] 95629.064 -160414.226
[33,] 68514.934 95629.064
[34,] -136059.940 68514.934
[35,] -29514.627 -136059.940
[36,] 255437.451 -29514.627
[37,] 141881.057 255437.451
[38,] 222926.524 141881.057
[39,] -151541.907 222926.524
[40,] -308606.418 -151541.907
[41,] -38414.301 -308606.418
[42,] 86268.023 -38414.301
[43,] -84183.615 86268.023
[44,] 13486.942 -84183.615
[45,] -167216.843 13486.942
[46,] 235540.637 -167216.843
[47,] -198863.700 235540.637
[48,] -46891.407 -198863.700
[49,] -190703.858 -46891.407
[50,] 83533.225 -190703.858
[51,] -22273.982 83533.225
[52,] -142461.650 -22273.982
[53,] 96411.623 -142461.650
[54,] -244021.200 96411.623
[55,] 85560.439 -244021.200
[56,] 166181.431 85560.439
[57,] 40755.448 166181.431
[58,] -91572.997 40755.448
[59,] -269978.532 -91572.997
[60,] -71027.436 -269978.532
[61,] -129211.004 -71027.436
[62,] -69636.892 -129211.004
[63,] -274781.047 -69636.892
[64,] 24301.778 -274781.047
[65,] 96124.721 24301.778
[66,] -173218.164 96124.721
[67,] -38610.124 -173218.164
[68,] -107094.288 -38610.124
[69,] -92600.863 -107094.288
[70,] -226384.569 -92600.863
[71,] 90369.202 -226384.569
[72,] -156511.488 90369.202
[73,] -93148.911 -156511.488
[74,] -125835.323 -93148.911
[75,] -148983.735 -125835.323
[76,] -135281.252 -148983.735
[77,] -129326.659 -135281.252
[78,] 5806.934 -129326.659
[79,] 16339.721 5806.934
[80,] -23503.635 16339.721
[81,] -95186.842 -23503.635
[82,] -155009.175 -95186.842
[83,] -25494.132 -155009.175
[84,] -59713.673 -25494.132
[85,] -200870.123 -59713.673
[86,] 33247.147 -200870.123
[87,] -90999.522 33247.147
[88,] -120915.516 -90999.522
[89,] -70390.488 -120915.516
[90,] -57736.898 -70390.488
[91,] -106346.630 -57736.898
[92,] 84020.761 -106346.630
[93,] -229284.273 84020.761
[94,] 61131.895 -229284.273
[95,] -107166.188 61131.895
[96,] -34094.584 -107166.188
[97,] -2288.539 -34094.584
[98,] -100156.337 -2288.539
[99,] -110239.042 -100156.337
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3031951.861 -385354.276
2 684521.405 3031951.861
3 -419917.413 684521.405
4 -735058.574 -419917.413
5 -54673.022 -735058.574
6 876008.912 -54673.022
7 446465.076 876008.912
8 -524497.192 446465.076
9 559157.609 -524497.192
10 366925.180 559157.609
11 730410.155 366925.180
12 675130.635 730410.155
13 -582281.337 675130.635
14 -186143.292 -582281.337
15 545236.147 -186143.292
16 -256257.720 545236.147
17 -292351.579 -256257.720
18 -502111.672 -292351.579
19 -58892.047 -502111.672
20 86204.203 -58892.047
21 -398109.843 86204.203
22 75068.519 -398109.843
23 -212510.435 75068.519
24 -99474.932 -212510.435
25 228372.697 -99474.932
26 -579685.791 228372.697
27 -228775.340 -579685.791
28 517314.639 -228775.340
29 341210.922 517314.639
30 192414.104 341210.922
31 -160414.226 192414.104
32 95629.064 -160414.226
33 68514.934 95629.064
34 -136059.940 68514.934
35 -29514.627 -136059.940
36 255437.451 -29514.627
37 141881.057 255437.451
38 222926.524 141881.057
39 -151541.907 222926.524
40 -308606.418 -151541.907
41 -38414.301 -308606.418
42 86268.023 -38414.301
43 -84183.615 86268.023
44 13486.942 -84183.615
45 -167216.843 13486.942
46 235540.637 -167216.843
47 -198863.700 235540.637
48 -46891.407 -198863.700
49 -190703.858 -46891.407
50 83533.225 -190703.858
51 -22273.982 83533.225
52 -142461.650 -22273.982
53 96411.623 -142461.650
54 -244021.200 96411.623
55 85560.439 -244021.200
56 166181.431 85560.439
57 40755.448 166181.431
58 -91572.997 40755.448
59 -269978.532 -91572.997
60 -71027.436 -269978.532
61 -129211.004 -71027.436
62 -69636.892 -129211.004
63 -274781.047 -69636.892
64 24301.778 -274781.047
65 96124.721 24301.778
66 -173218.164 96124.721
67 -38610.124 -173218.164
68 -107094.288 -38610.124
69 -92600.863 -107094.288
70 -226384.569 -92600.863
71 90369.202 -226384.569
72 -156511.488 90369.202
73 -93148.911 -156511.488
74 -125835.323 -93148.911
75 -148983.735 -125835.323
76 -135281.252 -148983.735
77 -129326.659 -135281.252
78 5806.934 -129326.659
79 16339.721 5806.934
80 -23503.635 16339.721
81 -95186.842 -23503.635
82 -155009.175 -95186.842
83 -25494.132 -155009.175
84 -59713.673 -25494.132
85 -200870.123 -59713.673
86 33247.147 -200870.123
87 -90999.522 33247.147
88 -120915.516 -90999.522
89 -70390.488 -120915.516
90 -57736.898 -70390.488
91 -106346.630 -57736.898
92 84020.761 -106346.630
93 -229284.273 84020.761
94 61131.895 -229284.273
95 -107166.188 61131.895
96 -34094.584 -107166.188
97 -2288.539 -34094.584
98 -100156.337 -2288.539
99 -110239.042 -100156.337
> 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/74w3w1291364961.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/84w3w1291364961.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/94w3w1291364961.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/10fn2h1291364961.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/110n1n1291364961.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/124ohb1291364961.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/13tpwm1291364961.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/14lywp1291364961.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/15phcv1291364961.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/1638a41291364961.tab")
+ }
>
> try(system("convert tmp/1845n1291364961.ps tmp/1845n1291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/21dn81291364961.ps tmp/21dn81291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/31dn81291364961.ps tmp/31dn81291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/41dn81291364961.ps tmp/41dn81291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/51dn81291364961.ps tmp/51dn81291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/6u44t1291364961.ps tmp/6u44t1291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/74w3w1291364961.ps tmp/74w3w1291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/84w3w1291364961.ps tmp/84w3w1291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/94w3w1291364961.ps tmp/94w3w1291364961.png",intern=TRUE))
character(0)
> try(system("convert tmp/10fn2h1291364961.ps tmp/10fn2h1291364961.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.632 2.494 4.980