R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-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(1826
+ ,161442
+ ,592
+ ,48
+ ,93
+ ,1728
+ ,189695
+ ,524
+ ,53
+ ,60
+ ,192
+ ,7215
+ ,72
+ ,0
+ ,18
+ ,2295
+ ,129098
+ ,645
+ ,51
+ ,95
+ ,3509
+ ,245678
+ ,1185
+ ,79
+ ,137
+ ,6861
+ ,515038
+ ,1945
+ ,136
+ ,263
+ ,1801
+ ,183078
+ ,585
+ ,62
+ ,57
+ ,1681
+ ,185559
+ ,470
+ ,83
+ ,59
+ ,1897
+ ,154581
+ ,612
+ ,55
+ ,44
+ ,2974
+ ,298001
+ ,992
+ ,67
+ ,96
+ ,1946
+ ,121844
+ ,634
+ ,50
+ ,75
+ ,2363
+ ,203796
+ ,741
+ ,88
+ ,71
+ ,1850
+ ,104738
+ ,674
+ ,47
+ ,101
+ ,3189
+ ,220490
+ ,1081
+ ,79
+ ,120
+ ,1486
+ ,170952
+ ,419
+ ,56
+ ,61
+ ,1567
+ ,154647
+ ,469
+ ,54
+ ,88
+ ,1759
+ ,142025
+ ,432
+ ,81
+ ,58
+ ,1247
+ ,79030
+ ,361
+ ,6
+ ,61
+ ,2779
+ ,167047
+ ,877
+ ,74
+ ,87
+ ,727
+ ,27997
+ ,221
+ ,13
+ ,25
+ ,1117
+ ,84588
+ ,377
+ ,31
+ ,61
+ ,2809
+ ,241227
+ ,847
+ ,99
+ ,101
+ ,1760
+ ,195820
+ ,642
+ ,38
+ ,72
+ ,2279
+ ,142530
+ ,693
+ ,59
+ ,56
+ ,1937
+ ,157178
+ ,611
+ ,54
+ ,87
+ ,1800
+ ,204256
+ ,654
+ ,63
+ ,33
+ ,2146
+ ,212298
+ ,690
+ ,66
+ ,166
+ ,1453
+ ,201403
+ ,365
+ ,90
+ ,95
+ ,2741
+ ,354924
+ ,907
+ ,60
+ ,118
+ ,2112
+ ,192399
+ ,882
+ ,52
+ ,44
+ ,1684
+ ,182286
+ ,490
+ ,61
+ ,44
+ ,1617
+ ,181590
+ ,548
+ ,60
+ ,46
+ ,2233
+ ,134868
+ ,726
+ ,53
+ ,106
+ ,3122
+ ,235002
+ ,935
+ ,76
+ ,125
+ ,2511
+ ,228872
+ ,824
+ ,70
+ ,54
+ ,1
+ ,0
+ ,0
+ ,0
+ ,1
+ ,2137
+ ,230360
+ ,997
+ ,54
+ ,64
+ ,1669
+ ,100129
+ ,539
+ ,44
+ ,51
+ ,2137
+ ,145864
+ ,515
+ ,42
+ ,49
+ ,2176
+ ,252386
+ ,806
+ ,83
+ ,67
+ ,2390
+ ,242379
+ ,753
+ ,105
+ ,71
+ ,1783
+ ,156399
+ ,665
+ ,42
+ ,60
+ ,1049
+ ,103623
+ ,387
+ ,25
+ ,33
+ ,2161
+ ,195891
+ ,804
+ ,64
+ ,78
+ ,1364
+ ,139654
+ ,419
+ ,71
+ ,51
+ ,1228
+ ,167934
+ ,330
+ ,44
+ ,96
+ ,745
+ ,81293
+ ,212
+ ,23
+ ,32
+ ,2410
+ ,246211
+ ,783
+ ,78
+ ,104
+ ,2289
+ ,233155
+ ,740
+ ,59
+ ,89
+ ,2639
+ ,160344
+ ,938
+ ,68
+ ,59
+ ,658
+ ,48188
+ ,205
+ ,12
+ ,28
+ ,1917
+ ,161922
+ ,492
+ ,99
+ ,69
+ ,2583
+ ,311044
+ ,824
+ ,80
+ ,75
+ ,2026
+ ,235223
+ ,680
+ ,56
+ ,79
+ ,1911
+ ,195583
+ ,691
+ ,67
+ ,59
+ ,1751
+ ,155574
+ ,540
+ ,44
+ ,57
+ ,1852
+ ,208834
+ ,487
+ ,53
+ ,67
+ ,1044
+ ,101687
+ ,328
+ ,26
+ ,25
+ ,1177
+ ,151985
+ ,421
+ ,67
+ ,66
+ ,2878
+ ,201027
+ ,965
+ ,36
+ ,99
+ ,1830
+ ,172600
+ ,538
+ ,56
+ ,63
+ ,2191
+ ,144556
+ ,811
+ ,51
+ ,82
+ ,1331
+ ,129561
+ ,362
+ ,46
+ ,61
+ ,1307
+ ,122204
+ ,460
+ ,57
+ ,38
+ ,1256
+ ,160930
+ ,416
+ ,27
+ ,35
+ ,1378
+ ,109798
+ ,437
+ ,45
+ ,42
+ ,2311
+ ,192811
+ ,499
+ ,72
+ ,71
+ ,2897
+ ,138708
+ ,887
+ ,93
+ ,65
+ ,1103
+ ,114408
+ ,267
+ ,59
+ ,38
+ ,340
+ ,31970
+ ,101
+ ,5
+ ,15
+ ,2900
+ ,245432
+ ,1058
+ ,56
+ ,113
+ ,1367
+ ,142907
+ ,426
+ ,40
+ ,74
+ ,1441
+ ,113612
+ ,480
+ ,72
+ ,68
+ ,1681
+ ,119537
+ ,474
+ ,53
+ ,72
+ ,2655
+ ,162215
+ ,673
+ ,81
+ ,68
+ ,1499
+ ,100098
+ ,413
+ ,27
+ ,44
+ ,2302
+ ,174768
+ ,677
+ ,94
+ ,60
+ ,2540
+ ,158459
+ ,820
+ ,71
+ ,97
+ ,1053
+ ,90743
+ ,330
+ ,25
+ ,33
+ ,1234
+ ,84971
+ ,395
+ ,34
+ ,71
+ ,927
+ ,80545
+ ,217
+ ,54
+ ,68
+ ,2176
+ ,287191
+ ,818
+ ,49
+ ,64
+ ,984
+ ,67006
+ ,301
+ ,26
+ ,29
+ ,1551
+ ,134091
+ ,513
+ ,48
+ ,40
+ ,1204
+ ,95803
+ ,392
+ ,54
+ ,47
+ ,1858
+ ,173833
+ ,572
+ ,38
+ ,58
+ ,2716
+ ,241469
+ ,669
+ ,63
+ ,237
+ ,1207
+ ,115367
+ ,284
+ ,58
+ ,114
+ ,1392
+ ,115603
+ ,443
+ ,44
+ ,63
+ ,1525
+ ,155537
+ ,614
+ ,45
+ ,53
+ ,1829
+ ,153133
+ ,672
+ ,49
+ ,41
+ ,2383
+ ,179228
+ ,701
+ ,75
+ ,82
+ ,1233
+ ,151517
+ ,415
+ ,39
+ ,57
+ ,1366
+ ,133686
+ ,505
+ ,28
+ ,59
+ ,953
+ ,61350
+ ,388
+ ,24
+ ,41
+ ,2319
+ ,245196
+ ,730
+ ,52
+ ,117
+ ,1857
+ ,195576
+ ,563
+ ,96
+ ,70
+ ,223
+ ,19349
+ ,67
+ ,13
+ ,12
+ ,2505
+ ,245422
+ ,869
+ ,43
+ ,108
+ ,2055
+ ,157961
+ ,849
+ ,42
+ ,83
+ ,747
+ ,66802
+ ,292
+ ,28
+ ,30
+ ,1062
+ ,91762
+ ,338
+ ,54
+ ,24
+ ,1422
+ ,151077
+ ,435
+ ,73
+ ,57
+ ,1319
+ ,136847
+ ,334
+ ,39
+ ,64
+ ,823
+ ,85338
+ ,223
+ ,36
+ ,40
+ ,596
+ ,27676
+ ,194
+ ,2
+ ,22
+ ,1644
+ ,162934
+ ,407
+ ,96
+ ,49
+ ,1130
+ ,122417
+ ,268
+ ,29
+ ,37
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1082
+ ,91529
+ ,332
+ ,46
+ ,32
+ ,1135
+ ,107205
+ ,371
+ ,25
+ ,67
+ ,1367
+ ,144664
+ ,465
+ ,51
+ ,45
+ ,1506
+ ,146445
+ ,447
+ ,60
+ ,63
+ ,910
+ ,84940
+ ,301
+ ,36
+ ,61
+ ,78
+ ,3616
+ ,14
+ ,0
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1130
+ ,183088
+ ,388
+ ,40
+ ,44
+ ,1635
+ ,153780
+ ,589
+ ,74
+ ,90
+ ,2122
+ ,176586
+ ,591
+ ,30
+ ,101
+ ,970
+ ,128944
+ ,299
+ ,41
+ ,39
+ ,778
+ ,43410
+ ,292
+ ,7
+ ,19
+ ,1752
+ ,175774
+ ,530
+ ,70
+ ,73
+ ,1050
+ ,108656
+ ,297
+ ,32
+ ,43
+ ,2180
+ ,140243
+ ,614
+ ,81
+ ,56
+ ,731
+ ,60493
+ ,174
+ ,3
+ ,40
+ ,285
+ ,19764
+ ,75
+ ,10
+ ,12
+ ,1834
+ ,164062
+ ,565
+ ,46
+ ,56
+ ,1167
+ ,138469
+ ,382
+ ,35
+ ,34
+ ,1646
+ ,155367
+ ,544
+ ,54
+ ,54
+ ,256
+ ,11796
+ ,79
+ ,1
+ ,9
+ ,98
+ ,10674
+ ,33
+ ,0
+ ,9
+ ,1409
+ ,144927
+ ,480
+ ,39
+ ,58
+ ,41
+ ,6836
+ ,11
+ ,0
+ ,3
+ ,1824
+ ,162563
+ ,626
+ ,48
+ ,63
+ ,42
+ ,5118
+ ,6
+ ,5
+ ,3
+ ,528
+ ,40248
+ ,183
+ ,8
+ ,16
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1114
+ ,127476
+ ,342
+ ,38
+ ,50
+ ,1305
+ ,88837
+ ,269
+ ,21
+ ,38
+ ,81
+ ,7131
+ ,27
+ ,0
+ ,4
+ ,261
+ ,9056
+ ,99
+ ,0
+ ,14
+ ,1062
+ ,87305
+ ,291
+ ,18
+ ,26
+ ,1279
+ ,142829
+ ,324
+ ,53
+ ,53
+ ,1148
+ ,100681
+ ,414
+ ,17
+ ,20)
+ ,dim=c(5
+ ,144)
+ ,dimnames=list(c('pageviews'
+ ,'timeinrfc'
+ ,'compendiumviews'
+ ,'bloggedcomputations'
+ ,'logins')
+ ,1:144))
> y <- array(NA,dim=c(5,144),dimnames=list(c('pageviews','timeinrfc','compendiumviews','bloggedcomputations','logins'),1:144))
> 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 = '2'
> #'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
> 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
timeinrfc pageviews compendiumviews bloggedcomputations logins
1 161442 1826 592 48 93
2 189695 1728 524 53 60
3 7215 192 72 0 18
4 129098 2295 645 51 95
5 245678 3509 1185 79 137
6 515038 6861 1945 136 263
7 183078 1801 585 62 57
8 185559 1681 470 83 59
9 154581 1897 612 55 44
10 298001 2974 992 67 96
11 121844 1946 634 50 75
12 203796 2363 741 88 71
13 104738 1850 674 47 101
14 220490 3189 1081 79 120
15 170952 1486 419 56 61
16 154647 1567 469 54 88
17 142025 1759 432 81 58
18 79030 1247 361 6 61
19 167047 2779 877 74 87
20 27997 727 221 13 25
21 84588 1117 377 31 61
22 241227 2809 847 99 101
23 195820 1760 642 38 72
24 142530 2279 693 59 56
25 157178 1937 611 54 87
26 204256 1800 654 63 33
27 212298 2146 690 66 166
28 201403 1453 365 90 95
29 354924 2741 907 60 118
30 192399 2112 882 52 44
31 182286 1684 490 61 44
32 181590 1617 548 60 46
33 134868 2233 726 53 106
34 235002 3122 935 76 125
35 228872 2511 824 70 54
36 0 1 0 0 1
37 230360 2137 997 54 64
38 100129 1669 539 44 51
39 145864 2137 515 42 49
40 252386 2176 806 83 67
41 242379 2390 753 105 71
42 156399 1783 665 42 60
43 103623 1049 387 25 33
44 195891 2161 804 64 78
45 139654 1364 419 71 51
46 167934 1228 330 44 96
47 81293 745 212 23 32
48 246211 2410 783 78 104
49 233155 2289 740 59 89
50 160344 2639 938 68 59
51 48188 658 205 12 28
52 161922 1917 492 99 69
53 311044 2583 824 80 75
54 235223 2026 680 56 79
55 195583 1911 691 67 59
56 155574 1751 540 44 57
57 208834 1852 487 53 67
58 101687 1044 328 26 25
59 151985 1177 421 67 66
60 201027 2878 965 36 99
61 172600 1830 538 56 63
62 144556 2191 811 51 82
63 129561 1331 362 46 61
64 122204 1307 460 57 38
65 160930 1256 416 27 35
66 109798 1378 437 45 42
67 192811 2311 499 72 71
68 138708 2897 887 93 65
69 114408 1103 267 59 38
70 31970 340 101 5 15
71 245432 2900 1058 56 113
72 142907 1367 426 40 74
73 113612 1441 480 72 68
74 119537 1681 474 53 72
75 162215 2655 673 81 68
76 100098 1499 413 27 44
77 174768 2302 677 94 60
78 158459 2540 820 71 97
79 90743 1053 330 25 33
80 84971 1234 395 34 71
81 80545 927 217 54 68
82 287191 2176 818 49 64
83 67006 984 301 26 29
84 134091 1551 513 48 40
85 95803 1204 392 54 47
86 173833 1858 572 38 58
87 241469 2716 669 63 237
88 115367 1207 284 58 114
89 115603 1392 443 44 63
90 155537 1525 614 45 53
91 153133 1829 672 49 41
92 179228 2383 701 75 82
93 151517 1233 415 39 57
94 133686 1366 505 28 59
95 61350 953 388 24 41
96 245196 2319 730 52 117
97 195576 1857 563 96 70
98 19349 223 67 13 12
99 245422 2505 869 43 108
100 157961 2055 849 42 83
101 66802 747 292 28 30
102 91762 1062 338 54 24
103 151077 1422 435 73 57
104 136847 1319 334 39 64
105 85338 823 223 36 40
106 27676 596 194 2 22
107 162934 1644 407 96 49
108 122417 1130 268 29 37
109 0 0 0 0 0
110 91529 1082 332 46 32
111 107205 1135 371 25 67
112 144664 1367 465 51 45
113 146445 1506 447 60 63
114 84940 910 301 36 61
115 3616 78 14 0 5
116 0 0 0 0 0
117 183088 1130 388 40 44
118 153780 1635 589 74 90
119 176586 2122 591 30 101
120 128944 970 299 41 39
121 43410 778 292 7 19
122 175774 1752 530 70 73
123 108656 1050 297 32 43
124 140243 2180 614 81 56
125 60493 731 174 3 40
126 19764 285 75 10 12
127 164062 1834 565 46 56
128 138469 1167 382 35 34
129 155367 1646 544 54 54
130 11796 256 79 1 9
131 10674 98 33 0 9
132 144927 1409 480 39 58
133 6836 41 11 0 3
134 162563 1824 626 48 63
135 5118 42 6 5 3
136 40248 528 183 8 16
137 0 0 0 0 0
138 127476 1114 342 38 50
139 88837 1305 269 21 38
140 7131 81 27 0 4
141 9056 261 99 0 14
142 87305 1062 291 18 26
143 142829 1279 324 53 53
144 100681 1148 414 17 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) pageviews compendiumviews
8168.55 12.03 121.33
bloggedcomputations logins
714.28 324.41
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-99460 -16589 -2344 16083 122584
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8168.55 5880.77 1.389 0.16705
pageviews 12.03 15.17 0.793 0.42910
compendiumviews 121.33 37.98 3.194 0.00173 **
bloggedcomputations 714.28 169.27 4.220 4.39e-05 ***
logins 324.41 129.33 2.508 0.01328 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 32770 on 139 degrees of freedom
Multiple R-squared: 0.829, Adjusted R-squared: 0.8241
F-statistic: 168.4 on 4 and 139 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.7400418 5.199164e-01 2.599582e-01
[2,] 0.6207004 7.585992e-01 3.792996e-01
[3,] 0.7954419 4.091163e-01 2.045581e-01
[4,] 0.8104592 3.790816e-01 1.895408e-01
[5,] 0.7859845 4.280310e-01 2.140155e-01
[6,] 0.7608720 4.782559e-01 2.391280e-01
[7,] 0.7484213 5.031575e-01 2.515787e-01
[8,] 0.7485250 5.029500e-01 2.514750e-01
[9,] 0.7209599 5.580803e-01 2.790401e-01
[10,] 0.7713540 4.572921e-01 2.286460e-01
[11,] 0.7054072 5.891856e-01 2.945928e-01
[12,] 0.8369242 3.261515e-01 1.630758e-01
[13,] 0.8187999 3.624002e-01 1.812001e-01
[14,] 0.7706817 4.586365e-01 2.293183e-01
[15,] 0.7133275 5.733450e-01 2.866725e-01
[16,] 0.8311433 3.377134e-01 1.688567e-01
[17,] 0.8423509 3.152982e-01 1.576491e-01
[18,] 0.8009661 3.980677e-01 1.990339e-01
[19,] 0.8186147 3.627706e-01 1.813853e-01
[20,] 0.7993270 4.013461e-01 2.006730e-01
[21,] 0.7850496 4.299007e-01 2.149504e-01
[22,] 0.9971127 5.774624e-03 2.887312e-03
[23,] 0.9955110 8.978007e-03 4.489004e-03
[24,] 0.9954899 9.020173e-03 4.510086e-03
[25,] 0.9946419 1.071622e-02 5.358108e-03
[26,] 0.9972064 5.587242e-03 2.793621e-03
[27,] 0.9962128 7.574421e-03 3.787211e-03
[28,] 0.9949695 1.006107e-02 5.030535e-03
[29,] 0.9926023 1.479544e-02 7.397721e-03
[30,] 0.9898900 2.022010e-02 1.011005e-02
[31,] 0.9909334 1.813319e-02 9.066596e-03
[32,] 0.9875255 2.494902e-02 1.247451e-02
[33,] 0.9872844 2.543118e-02 1.271559e-02
[34,] 0.9835846 3.283071e-02 1.641536e-02
[35,] 0.9773376 4.532486e-02 2.266243e-02
[36,] 0.9703068 5.938637e-02 2.969318e-02
[37,] 0.9609487 7.810255e-02 3.905128e-02
[38,] 0.9500081 9.998382e-02 4.999191e-02
[39,] 0.9613614 7.727718e-02 3.863859e-02
[40,] 0.9517416 9.651688e-02 4.825844e-02
[41,] 0.9442234 1.115532e-01 5.577662e-02
[42,] 0.9473790 1.052421e-01 5.262105e-02
[43,] 0.9728511 5.429778e-02 2.714889e-02
[44,] 0.9645311 7.093789e-02 3.546895e-02
[45,] 0.9626975 7.460493e-02 3.730247e-02
[46,] 0.9945812 1.083770e-02 5.418850e-03
[47,] 0.9971748 5.650316e-03 2.825158e-03
[48,] 0.9962577 7.484627e-03 3.742314e-03
[49,] 0.9948583 1.028348e-02 5.141741e-03
[50,] 0.9978195 4.361003e-03 2.180502e-03
[51,] 0.9970423 5.915331e-03 2.957665e-03
[52,] 0.9960716 7.856776e-03 3.928388e-03
[53,] 0.9951115 9.777098e-03 4.888549e-03
[54,] 0.9936971 1.260580e-02 6.302898e-03
[55,] 0.9962605 7.479003e-03 3.739502e-03
[56,] 0.9948138 1.037247e-02 5.186234e-03
[57,] 0.9930260 1.394807e-02 6.974036e-03
[58,] 0.9966309 6.738170e-03 3.369085e-03
[59,] 0.9954613 9.077405e-03 4.538703e-03
[60,] 0.9947702 1.045956e-02 5.229781e-03
[61,] 0.9998600 2.800822e-04 1.400411e-04
[62,] 0.9997973 4.053554e-04 2.026777e-04
[63,] 0.9996783 6.433978e-04 3.216989e-04
[64,] 0.9995539 8.922777e-04 4.461389e-04
[65,] 0.9993657 1.268554e-03 6.342772e-04
[66,] 0.9995199 9.601899e-04 4.800949e-04
[67,] 0.9994696 1.060728e-03 5.303642e-04
[68,] 0.9996699 6.601150e-04 3.300575e-04
[69,] 0.9995562 8.876177e-04 4.438089e-04
[70,] 0.9995889 8.221827e-04 4.110914e-04
[71,] 0.9999622 7.566517e-05 3.783259e-05
[72,] 0.9999363 1.274380e-04 6.371900e-05
[73,] 0.9999449 1.102757e-04 5.513784e-05
[74,] 0.9999245 1.510289e-04 7.551445e-05
[75,] 0.9999995 9.395389e-07 4.697694e-07
[76,] 0.9999993 1.303992e-06 6.519961e-07
[77,] 0.9999988 2.440807e-06 1.220403e-06
[78,] 0.9999986 2.704630e-06 1.352315e-06
[79,] 0.9999980 3.941206e-06 1.970603e-06
[80,] 0.9999978 4.491949e-06 2.245974e-06
[81,] 0.9999985 3.080416e-06 1.540208e-06
[82,] 0.9999980 4.087444e-06 2.043722e-06
[83,] 0.9999967 6.686243e-06 3.343122e-06
[84,] 0.9999938 1.242114e-05 6.210569e-06
[85,] 0.9999964 7.286145e-06 3.643073e-06
[86,] 0.9999968 6.365008e-06 3.182504e-06
[87,] 0.9999942 1.154818e-05 5.774089e-06
[88,] 0.9999951 9.804907e-06 4.902453e-06
[89,] 0.9999950 1.002635e-05 5.013175e-06
[90,] 0.9999904 1.923685e-05 9.618426e-06
[91,] 0.9999827 3.458864e-05 1.729432e-05
[92,] 0.9999830 3.407859e-05 1.703930e-05
[93,] 0.9999856 2.870736e-05 1.435368e-05
[94,] 0.9999759 4.824959e-05 2.412479e-05
[95,] 0.9999613 7.745638e-05 3.872819e-05
[96,] 0.9999273 1.454507e-04 7.272535e-05
[97,] 0.9998904 2.191817e-04 1.095909e-04
[98,] 0.9997997 4.006773e-04 2.003387e-04
[99,] 0.9997510 4.980208e-04 2.490104e-04
[100,] 0.9995538 8.924885e-04 4.462443e-04
[101,] 0.9996241 7.518358e-04 3.759179e-04
[102,] 0.9993348 1.330491e-03 6.652456e-04
[103,] 0.9989806 2.038840e-03 1.019420e-03
[104,] 0.9982802 3.439680e-03 1.719840e-03
[105,] 0.9972552 5.489503e-03 2.744751e-03
[106,] 0.9954264 9.147270e-03 4.573635e-03
[107,] 0.9943748 1.125038e-02 5.625192e-03
[108,] 0.9910679 1.786412e-02 8.932062e-03
[109,] 0.9859502 2.809970e-02 1.404985e-02
[110,] 0.9994692 1.061677e-03 5.308384e-04
[111,] 0.9998685 2.630833e-04 1.315416e-04
[112,] 0.9998214 3.571764e-04 1.785882e-04
[113,] 0.9998828 2.343061e-04 1.171530e-04
[114,] 0.9998711 2.577989e-04 1.288995e-04
[115,] 0.9997062 5.875323e-04 2.937661e-04
[116,] 0.9994029 1.194271e-03 5.971354e-04
[117,] 0.9999977 4.680933e-06 2.340466e-06
[118,] 0.9999966 6.818129e-06 3.409064e-06
[119,] 0.9999928 1.431897e-05 7.159483e-06
[120,] 0.9999759 4.829553e-05 2.414777e-05
[121,] 0.9999936 1.271186e-05 6.355932e-06
[122,] 0.9999948 1.047771e-05 5.238857e-06
[123,] 0.9999787 4.268097e-05 2.134049e-05
[124,] 0.9999157 1.685608e-04 8.428042e-05
[125,] 0.9998107 3.785031e-04 1.892516e-04
[126,] 0.9992225 1.554968e-03 7.774840e-04
[127,] 0.9997573 4.853176e-04 2.426588e-04
[128,] 0.9984522 3.095622e-03 1.547811e-03
[129,] 0.9920639 1.587212e-02 7.936062e-03
> postscript(file="/var/www/rcomp/tmp/1ofmr1324500753.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/rcomp/tmp/23nmi1324500753.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/rcomp/tmp/3eoa01324500753.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/rcomp/tmp/40fwf1324500753.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/rcomp/tmp/5nlb71324500753.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 = 144
Frequency = 1
1 2 3 4 5 6
-4985.2292 39831.8827 -17839.4354 -52195.5512 -49369.4847 5849.7103
7 8 9 10 11 12
19479.8617 21709.5104 -4231.1079 54681.1113 -46712.4445 -8606.1620
13 14 15 16 17 18
-73808.2903 -52573.0008 34273.7964 3596.8773 -16399.5779 -12020.8818
19 20 21 22 23 24
-62053.2650 -33130.7256 -24696.6777 -6993.0218 38075.8344 -37457.1338
25 26 27 28 29 30
-15229.5404 39369.5699 -6409.7296 36358.4507 122584.2201 382.7033
31 32 33 34 35 36
36554.0357 29692.5275 -60504.3991 -19019.4476 22990.1879 -8504.9970
37 38 39 40 41 42
16172.8861 -41495.8807 3596.4312 39216.6926 16053.2111 -3376.7692
43 44 45 46 47 48
7312.5034 -6852.3778 -3026.0763 42376.1347 11626.9946 24584.4943
49 50 51 52 53 54
36639.3551 -61103.5518 -10427.0041 -22109.4299 90340.3159 54539.2313
55 56 57 58 59 60
13579.6857 10894.5120 59697.0435 14476.2763 9303.6119 -16692.2650
61 62 63 64 65 66
16694.6739 -51409.7666 8806.8089 -10547.5104 56532.4048 -13743.6197
67 68 69 70 71 72
21825.4168 -99459.8593 6100.0107 -982.2902 -2663.2031 14022.6462
73 74 75 76 77 78
-43625.2338 -27586.8359 -39477.4113 -9779.6233 -29851.9647 -61950.4266
79 80 81 82 83 84
1300.2936 -33292.6055 -25739.2981 97824.3753 -17504.3464 -2247.7937
85 86 87 88 89 90
-28235.2679 27944.4742 -2440.6317 -20196.1534 -14933.4445 5182.0494
91 92 93 94 95 96
-6881.8037 -22844.4783 31809.1538 8665.9424 -35807.5498 45449.0831
97 98 99 100 101 102
5470.4713 -12810.9787 35919.7508 -34874.6388 -15517.2039 -16554.0196
103 104 105 106 107 108
2382.6028 23661.2271 1517.7746 -19768.9866 1132.2000 35415.4891
109 110 111 112 113 114
-8168.5518 -13180.7803 770.8970 12598.5618 2622.8817 -16203.7368
115 116 117 118 119 120
-8811.9278 -8168.5518 71398.7133 -27582.6708 16979.6684 30886.5255
121 122 123 124 125 126
-20713.9182 8534.0083 15009.3021 -44681.6142 7296.3543 -11969.9269
127 128 129 130 131 132
14246.2229 33877.9351 5296.2393 -12672.5313 -5597.5660 14890.1292
133 134 135 136 137 138
-4133.8420 1766.8784 -8828.6034 -7383.2034 -8168.5518 21042.6252
139 140 141 142 143 144
4997.9702 -6585.9363 -18807.1211 9756.7545 24906.5539 9834.7085
> postscript(file="/var/www/rcomp/tmp/6y6jv1324500753.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 = 144
Frequency = 1
lag(myerror, k = 1) myerror
0 -4985.2292 NA
1 39831.8827 -4985.2292
2 -17839.4354 39831.8827
3 -52195.5512 -17839.4354
4 -49369.4847 -52195.5512
5 5849.7103 -49369.4847
6 19479.8617 5849.7103
7 21709.5104 19479.8617
8 -4231.1079 21709.5104
9 54681.1113 -4231.1079
10 -46712.4445 54681.1113
11 -8606.1620 -46712.4445
12 -73808.2903 -8606.1620
13 -52573.0008 -73808.2903
14 34273.7964 -52573.0008
15 3596.8773 34273.7964
16 -16399.5779 3596.8773
17 -12020.8818 -16399.5779
18 -62053.2650 -12020.8818
19 -33130.7256 -62053.2650
20 -24696.6777 -33130.7256
21 -6993.0218 -24696.6777
22 38075.8344 -6993.0218
23 -37457.1338 38075.8344
24 -15229.5404 -37457.1338
25 39369.5699 -15229.5404
26 -6409.7296 39369.5699
27 36358.4507 -6409.7296
28 122584.2201 36358.4507
29 382.7033 122584.2201
30 36554.0357 382.7033
31 29692.5275 36554.0357
32 -60504.3991 29692.5275
33 -19019.4476 -60504.3991
34 22990.1879 -19019.4476
35 -8504.9970 22990.1879
36 16172.8861 -8504.9970
37 -41495.8807 16172.8861
38 3596.4312 -41495.8807
39 39216.6926 3596.4312
40 16053.2111 39216.6926
41 -3376.7692 16053.2111
42 7312.5034 -3376.7692
43 -6852.3778 7312.5034
44 -3026.0763 -6852.3778
45 42376.1347 -3026.0763
46 11626.9946 42376.1347
47 24584.4943 11626.9946
48 36639.3551 24584.4943
49 -61103.5518 36639.3551
50 -10427.0041 -61103.5518
51 -22109.4299 -10427.0041
52 90340.3159 -22109.4299
53 54539.2313 90340.3159
54 13579.6857 54539.2313
55 10894.5120 13579.6857
56 59697.0435 10894.5120
57 14476.2763 59697.0435
58 9303.6119 14476.2763
59 -16692.2650 9303.6119
60 16694.6739 -16692.2650
61 -51409.7666 16694.6739
62 8806.8089 -51409.7666
63 -10547.5104 8806.8089
64 56532.4048 -10547.5104
65 -13743.6197 56532.4048
66 21825.4168 -13743.6197
67 -99459.8593 21825.4168
68 6100.0107 -99459.8593
69 -982.2902 6100.0107
70 -2663.2031 -982.2902
71 14022.6462 -2663.2031
72 -43625.2338 14022.6462
73 -27586.8359 -43625.2338
74 -39477.4113 -27586.8359
75 -9779.6233 -39477.4113
76 -29851.9647 -9779.6233
77 -61950.4266 -29851.9647
78 1300.2936 -61950.4266
79 -33292.6055 1300.2936
80 -25739.2981 -33292.6055
81 97824.3753 -25739.2981
82 -17504.3464 97824.3753
83 -2247.7937 -17504.3464
84 -28235.2679 -2247.7937
85 27944.4742 -28235.2679
86 -2440.6317 27944.4742
87 -20196.1534 -2440.6317
88 -14933.4445 -20196.1534
89 5182.0494 -14933.4445
90 -6881.8037 5182.0494
91 -22844.4783 -6881.8037
92 31809.1538 -22844.4783
93 8665.9424 31809.1538
94 -35807.5498 8665.9424
95 45449.0831 -35807.5498
96 5470.4713 45449.0831
97 -12810.9787 5470.4713
98 35919.7508 -12810.9787
99 -34874.6388 35919.7508
100 -15517.2039 -34874.6388
101 -16554.0196 -15517.2039
102 2382.6028 -16554.0196
103 23661.2271 2382.6028
104 1517.7746 23661.2271
105 -19768.9866 1517.7746
106 1132.2000 -19768.9866
107 35415.4891 1132.2000
108 -8168.5518 35415.4891
109 -13180.7803 -8168.5518
110 770.8970 -13180.7803
111 12598.5618 770.8970
112 2622.8817 12598.5618
113 -16203.7368 2622.8817
114 -8811.9278 -16203.7368
115 -8168.5518 -8811.9278
116 71398.7133 -8168.5518
117 -27582.6708 71398.7133
118 16979.6684 -27582.6708
119 30886.5255 16979.6684
120 -20713.9182 30886.5255
121 8534.0083 -20713.9182
122 15009.3021 8534.0083
123 -44681.6142 15009.3021
124 7296.3543 -44681.6142
125 -11969.9269 7296.3543
126 14246.2229 -11969.9269
127 33877.9351 14246.2229
128 5296.2393 33877.9351
129 -12672.5313 5296.2393
130 -5597.5660 -12672.5313
131 14890.1292 -5597.5660
132 -4133.8420 14890.1292
133 1766.8784 -4133.8420
134 -8828.6034 1766.8784
135 -7383.2034 -8828.6034
136 -8168.5518 -7383.2034
137 21042.6252 -8168.5518
138 4997.9702 21042.6252
139 -6585.9363 4997.9702
140 -18807.1211 -6585.9363
141 9756.7545 -18807.1211
142 24906.5539 9756.7545
143 9834.7085 24906.5539
144 NA 9834.7085
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 39831.8827 -4985.2292
[2,] -17839.4354 39831.8827
[3,] -52195.5512 -17839.4354
[4,] -49369.4847 -52195.5512
[5,] 5849.7103 -49369.4847
[6,] 19479.8617 5849.7103
[7,] 21709.5104 19479.8617
[8,] -4231.1079 21709.5104
[9,] 54681.1113 -4231.1079
[10,] -46712.4445 54681.1113
[11,] -8606.1620 -46712.4445
[12,] -73808.2903 -8606.1620
[13,] -52573.0008 -73808.2903
[14,] 34273.7964 -52573.0008
[15,] 3596.8773 34273.7964
[16,] -16399.5779 3596.8773
[17,] -12020.8818 -16399.5779
[18,] -62053.2650 -12020.8818
[19,] -33130.7256 -62053.2650
[20,] -24696.6777 -33130.7256
[21,] -6993.0218 -24696.6777
[22,] 38075.8344 -6993.0218
[23,] -37457.1338 38075.8344
[24,] -15229.5404 -37457.1338
[25,] 39369.5699 -15229.5404
[26,] -6409.7296 39369.5699
[27,] 36358.4507 -6409.7296
[28,] 122584.2201 36358.4507
[29,] 382.7033 122584.2201
[30,] 36554.0357 382.7033
[31,] 29692.5275 36554.0357
[32,] -60504.3991 29692.5275
[33,] -19019.4476 -60504.3991
[34,] 22990.1879 -19019.4476
[35,] -8504.9970 22990.1879
[36,] 16172.8861 -8504.9970
[37,] -41495.8807 16172.8861
[38,] 3596.4312 -41495.8807
[39,] 39216.6926 3596.4312
[40,] 16053.2111 39216.6926
[41,] -3376.7692 16053.2111
[42,] 7312.5034 -3376.7692
[43,] -6852.3778 7312.5034
[44,] -3026.0763 -6852.3778
[45,] 42376.1347 -3026.0763
[46,] 11626.9946 42376.1347
[47,] 24584.4943 11626.9946
[48,] 36639.3551 24584.4943
[49,] -61103.5518 36639.3551
[50,] -10427.0041 -61103.5518
[51,] -22109.4299 -10427.0041
[52,] 90340.3159 -22109.4299
[53,] 54539.2313 90340.3159
[54,] 13579.6857 54539.2313
[55,] 10894.5120 13579.6857
[56,] 59697.0435 10894.5120
[57,] 14476.2763 59697.0435
[58,] 9303.6119 14476.2763
[59,] -16692.2650 9303.6119
[60,] 16694.6739 -16692.2650
[61,] -51409.7666 16694.6739
[62,] 8806.8089 -51409.7666
[63,] -10547.5104 8806.8089
[64,] 56532.4048 -10547.5104
[65,] -13743.6197 56532.4048
[66,] 21825.4168 -13743.6197
[67,] -99459.8593 21825.4168
[68,] 6100.0107 -99459.8593
[69,] -982.2902 6100.0107
[70,] -2663.2031 -982.2902
[71,] 14022.6462 -2663.2031
[72,] -43625.2338 14022.6462
[73,] -27586.8359 -43625.2338
[74,] -39477.4113 -27586.8359
[75,] -9779.6233 -39477.4113
[76,] -29851.9647 -9779.6233
[77,] -61950.4266 -29851.9647
[78,] 1300.2936 -61950.4266
[79,] -33292.6055 1300.2936
[80,] -25739.2981 -33292.6055
[81,] 97824.3753 -25739.2981
[82,] -17504.3464 97824.3753
[83,] -2247.7937 -17504.3464
[84,] -28235.2679 -2247.7937
[85,] 27944.4742 -28235.2679
[86,] -2440.6317 27944.4742
[87,] -20196.1534 -2440.6317
[88,] -14933.4445 -20196.1534
[89,] 5182.0494 -14933.4445
[90,] -6881.8037 5182.0494
[91,] -22844.4783 -6881.8037
[92,] 31809.1538 -22844.4783
[93,] 8665.9424 31809.1538
[94,] -35807.5498 8665.9424
[95,] 45449.0831 -35807.5498
[96,] 5470.4713 45449.0831
[97,] -12810.9787 5470.4713
[98,] 35919.7508 -12810.9787
[99,] -34874.6388 35919.7508
[100,] -15517.2039 -34874.6388
[101,] -16554.0196 -15517.2039
[102,] 2382.6028 -16554.0196
[103,] 23661.2271 2382.6028
[104,] 1517.7746 23661.2271
[105,] -19768.9866 1517.7746
[106,] 1132.2000 -19768.9866
[107,] 35415.4891 1132.2000
[108,] -8168.5518 35415.4891
[109,] -13180.7803 -8168.5518
[110,] 770.8970 -13180.7803
[111,] 12598.5618 770.8970
[112,] 2622.8817 12598.5618
[113,] -16203.7368 2622.8817
[114,] -8811.9278 -16203.7368
[115,] -8168.5518 -8811.9278
[116,] 71398.7133 -8168.5518
[117,] -27582.6708 71398.7133
[118,] 16979.6684 -27582.6708
[119,] 30886.5255 16979.6684
[120,] -20713.9182 30886.5255
[121,] 8534.0083 -20713.9182
[122,] 15009.3021 8534.0083
[123,] -44681.6142 15009.3021
[124,] 7296.3543 -44681.6142
[125,] -11969.9269 7296.3543
[126,] 14246.2229 -11969.9269
[127,] 33877.9351 14246.2229
[128,] 5296.2393 33877.9351
[129,] -12672.5313 5296.2393
[130,] -5597.5660 -12672.5313
[131,] 14890.1292 -5597.5660
[132,] -4133.8420 14890.1292
[133,] 1766.8784 -4133.8420
[134,] -8828.6034 1766.8784
[135,] -7383.2034 -8828.6034
[136,] -8168.5518 -7383.2034
[137,] 21042.6252 -8168.5518
[138,] 4997.9702 21042.6252
[139,] -6585.9363 4997.9702
[140,] -18807.1211 -6585.9363
[141,] 9756.7545 -18807.1211
[142,] 24906.5539 9756.7545
[143,] 9834.7085 24906.5539
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 39831.8827 -4985.2292
2 -17839.4354 39831.8827
3 -52195.5512 -17839.4354
4 -49369.4847 -52195.5512
5 5849.7103 -49369.4847
6 19479.8617 5849.7103
7 21709.5104 19479.8617
8 -4231.1079 21709.5104
9 54681.1113 -4231.1079
10 -46712.4445 54681.1113
11 -8606.1620 -46712.4445
12 -73808.2903 -8606.1620
13 -52573.0008 -73808.2903
14 34273.7964 -52573.0008
15 3596.8773 34273.7964
16 -16399.5779 3596.8773
17 -12020.8818 -16399.5779
18 -62053.2650 -12020.8818
19 -33130.7256 -62053.2650
20 -24696.6777 -33130.7256
21 -6993.0218 -24696.6777
22 38075.8344 -6993.0218
23 -37457.1338 38075.8344
24 -15229.5404 -37457.1338
25 39369.5699 -15229.5404
26 -6409.7296 39369.5699
27 36358.4507 -6409.7296
28 122584.2201 36358.4507
29 382.7033 122584.2201
30 36554.0357 382.7033
31 29692.5275 36554.0357
32 -60504.3991 29692.5275
33 -19019.4476 -60504.3991
34 22990.1879 -19019.4476
35 -8504.9970 22990.1879
36 16172.8861 -8504.9970
37 -41495.8807 16172.8861
38 3596.4312 -41495.8807
39 39216.6926 3596.4312
40 16053.2111 39216.6926
41 -3376.7692 16053.2111
42 7312.5034 -3376.7692
43 -6852.3778 7312.5034
44 -3026.0763 -6852.3778
45 42376.1347 -3026.0763
46 11626.9946 42376.1347
47 24584.4943 11626.9946
48 36639.3551 24584.4943
49 -61103.5518 36639.3551
50 -10427.0041 -61103.5518
51 -22109.4299 -10427.0041
52 90340.3159 -22109.4299
53 54539.2313 90340.3159
54 13579.6857 54539.2313
55 10894.5120 13579.6857
56 59697.0435 10894.5120
57 14476.2763 59697.0435
58 9303.6119 14476.2763
59 -16692.2650 9303.6119
60 16694.6739 -16692.2650
61 -51409.7666 16694.6739
62 8806.8089 -51409.7666
63 -10547.5104 8806.8089
64 56532.4048 -10547.5104
65 -13743.6197 56532.4048
66 21825.4168 -13743.6197
67 -99459.8593 21825.4168
68 6100.0107 -99459.8593
69 -982.2902 6100.0107
70 -2663.2031 -982.2902
71 14022.6462 -2663.2031
72 -43625.2338 14022.6462
73 -27586.8359 -43625.2338
74 -39477.4113 -27586.8359
75 -9779.6233 -39477.4113
76 -29851.9647 -9779.6233
77 -61950.4266 -29851.9647
78 1300.2936 -61950.4266
79 -33292.6055 1300.2936
80 -25739.2981 -33292.6055
81 97824.3753 -25739.2981
82 -17504.3464 97824.3753
83 -2247.7937 -17504.3464
84 -28235.2679 -2247.7937
85 27944.4742 -28235.2679
86 -2440.6317 27944.4742
87 -20196.1534 -2440.6317
88 -14933.4445 -20196.1534
89 5182.0494 -14933.4445
90 -6881.8037 5182.0494
91 -22844.4783 -6881.8037
92 31809.1538 -22844.4783
93 8665.9424 31809.1538
94 -35807.5498 8665.9424
95 45449.0831 -35807.5498
96 5470.4713 45449.0831
97 -12810.9787 5470.4713
98 35919.7508 -12810.9787
99 -34874.6388 35919.7508
100 -15517.2039 -34874.6388
101 -16554.0196 -15517.2039
102 2382.6028 -16554.0196
103 23661.2271 2382.6028
104 1517.7746 23661.2271
105 -19768.9866 1517.7746
106 1132.2000 -19768.9866
107 35415.4891 1132.2000
108 -8168.5518 35415.4891
109 -13180.7803 -8168.5518
110 770.8970 -13180.7803
111 12598.5618 770.8970
112 2622.8817 12598.5618
113 -16203.7368 2622.8817
114 -8811.9278 -16203.7368
115 -8168.5518 -8811.9278
116 71398.7133 -8168.5518
117 -27582.6708 71398.7133
118 16979.6684 -27582.6708
119 30886.5255 16979.6684
120 -20713.9182 30886.5255
121 8534.0083 -20713.9182
122 15009.3021 8534.0083
123 -44681.6142 15009.3021
124 7296.3543 -44681.6142
125 -11969.9269 7296.3543
126 14246.2229 -11969.9269
127 33877.9351 14246.2229
128 5296.2393 33877.9351
129 -12672.5313 5296.2393
130 -5597.5660 -12672.5313
131 14890.1292 -5597.5660
132 -4133.8420 14890.1292
133 1766.8784 -4133.8420
134 -8828.6034 1766.8784
135 -7383.2034 -8828.6034
136 -8168.5518 -7383.2034
137 21042.6252 -8168.5518
138 4997.9702 21042.6252
139 -6585.9363 4997.9702
140 -18807.1211 -6585.9363
141 9756.7545 -18807.1211
142 24906.5539 9756.7545
143 9834.7085 24906.5539
> 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/rcomp/tmp/7dqb21324500753.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/rcomp/tmp/85iku1324500753.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/rcomp/tmp/9y7l11324500753.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/rcomp/tmp/10u8k91324500753.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/11wuax1324500753.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/rcomp/tmp/12a6cy1324500753.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/rcomp/tmp/13so5q1324500753.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/rcomp/tmp/14upl81324500753.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/rcomp/tmp/15fxak1324500753.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/rcomp/tmp/16guee1324500753.tab")
+ }
>
> try(system("convert tmp/1ofmr1324500753.ps tmp/1ofmr1324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/23nmi1324500753.ps tmp/23nmi1324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/3eoa01324500753.ps tmp/3eoa01324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/40fwf1324500753.ps tmp/40fwf1324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/5nlb71324500753.ps tmp/5nlb71324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/6y6jv1324500753.ps tmp/6y6jv1324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/7dqb21324500753.ps tmp/7dqb21324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/85iku1324500753.ps tmp/85iku1324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/9y7l11324500753.ps tmp/9y7l11324500753.png",intern=TRUE))
character(0)
> try(system("convert tmp/10u8k91324500753.ps tmp/10u8k91324500753.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.080 0.290 5.373