R version 2.13.0 (2011-04-13)
Copyright (C) 2011 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(158258
+ ,48
+ ,20465
+ ,37
+ ,186739
+ ,53
+ ,33629
+ ,43
+ ,7215
+ ,0
+ ,1423
+ ,0
+ ,122689
+ ,49
+ ,25629
+ ,54
+ ,226968
+ ,76
+ ,54002
+ ,86
+ ,494047
+ ,125
+ ,151036
+ ,181
+ ,171007
+ ,59
+ ,33287
+ ,42
+ ,174432
+ ,76
+ ,31172
+ ,59
+ ,149604
+ ,55
+ ,28113
+ ,46
+ ,275702
+ ,67
+ ,57803
+ ,77
+ ,121844
+ ,50
+ ,49830
+ ,49
+ ,176637
+ ,73
+ ,52143
+ ,79
+ ,92070
+ ,41
+ ,21055
+ ,37
+ ,208880
+ ,79
+ ,47007
+ ,92
+ ,157095
+ ,51
+ ,28735
+ ,31
+ ,147893
+ ,54
+ ,59147
+ ,28
+ ,134175
+ ,75
+ ,78950
+ ,103
+ ,68818
+ ,1
+ ,13497
+ ,2
+ ,149555
+ ,73
+ ,46154
+ ,48
+ ,27997
+ ,13
+ ,53249
+ ,25
+ ,69866
+ ,19
+ ,10726
+ ,16
+ ,227357
+ ,89
+ ,83700
+ ,106
+ ,188137
+ ,37
+ ,40400
+ ,35
+ ,127994
+ ,48
+ ,33797
+ ,33
+ ,143682
+ ,50
+ ,36205
+ ,45
+ ,164820
+ ,45
+ ,30165
+ ,64
+ ,187214
+ ,59
+ ,58534
+ ,73
+ ,176178
+ ,79
+ ,44663
+ ,78
+ ,351374
+ ,60
+ ,92556
+ ,63
+ ,192399
+ ,52
+ ,40078
+ ,69
+ ,165257
+ ,50
+ ,34711
+ ,36
+ ,173687
+ ,60
+ ,31076
+ ,41
+ ,126338
+ ,53
+ ,74608
+ ,59
+ ,224762
+ ,76
+ ,58092
+ ,33
+ ,219428
+ ,63
+ ,42009
+ ,76
+ ,0
+ ,0
+ ,0
+ ,0
+ ,208669
+ ,53
+ ,36022
+ ,27
+ ,99706
+ ,44
+ ,23333
+ ,44
+ ,136733
+ ,36
+ ,53349
+ ,43
+ ,249965
+ ,83
+ ,92596
+ ,104
+ ,232951
+ ,105
+ ,49598
+ ,120
+ ,143748
+ ,37
+ ,44093
+ ,44
+ ,94332
+ ,25
+ ,84205
+ ,71
+ ,189893
+ ,63
+ ,63369
+ ,78
+ ,114811
+ ,55
+ ,60132
+ ,106
+ ,156861
+ ,41
+ ,37403
+ ,61
+ ,81293
+ ,23
+ ,24460
+ ,53
+ ,204965
+ ,63
+ ,46456
+ ,51
+ ,223771
+ ,54
+ ,66616
+ ,46
+ ,160254
+ ,68
+ ,41554
+ ,55
+ ,48188
+ ,12
+ ,22346
+ ,14
+ ,143776
+ ,84
+ ,30874
+ ,44
+ ,286674
+ ,66
+ ,68701
+ ,113
+ ,234829
+ ,56
+ ,35728
+ ,55
+ ,195583
+ ,67
+ ,29010
+ ,46
+ ,145942
+ ,40
+ ,23110
+ ,39
+ ,203260
+ ,53
+ ,38844
+ ,51
+ ,93764
+ ,26
+ ,27084
+ ,31
+ ,151913
+ ,67
+ ,35139
+ ,36
+ ,190487
+ ,36
+ ,57476
+ ,47
+ ,143389
+ ,50
+ ,33277
+ ,53
+ ,124825
+ ,48
+ ,31141
+ ,38
+ ,124234
+ ,46
+ ,61281
+ ,52
+ ,111501
+ ,53
+ ,25820
+ ,37
+ ,153813
+ ,27
+ ,23284
+ ,11
+ ,97548
+ ,38
+ ,35378
+ ,45
+ ,178613
+ ,68
+ ,74990
+ ,59
+ ,138708
+ ,93
+ ,29653
+ ,82
+ ,111869
+ ,57
+ ,64622
+ ,49
+ ,31970
+ ,5
+ ,4157
+ ,6
+ ,224494
+ ,53
+ ,29245
+ ,81
+ ,116999
+ ,36
+ ,50008
+ ,56
+ ,113504
+ ,72
+ ,52338
+ ,105
+ ,105932
+ ,49
+ ,13310
+ ,46
+ ,159167
+ ,74
+ ,92901
+ ,46
+ ,90204
+ ,13
+ ,10956
+ ,2
+ ,165210
+ ,82
+ ,34241
+ ,51
+ ,156752
+ ,71
+ ,75043
+ ,95
+ ,69233
+ ,17
+ ,21152
+ ,18
+ ,84971
+ ,34
+ ,42249
+ ,55
+ ,80506
+ ,54
+ ,42005
+ ,48
+ ,267162
+ ,43
+ ,41152
+ ,48
+ ,62974
+ ,26
+ ,14399
+ ,39
+ ,119802
+ ,44
+ ,28263
+ ,40
+ ,75132
+ ,35
+ ,17215
+ ,36
+ ,154426
+ ,32
+ ,48140
+ ,60
+ ,222914
+ ,55
+ ,62897
+ ,114
+ ,115019
+ ,58
+ ,22883
+ ,39
+ ,99114
+ ,44
+ ,41622
+ ,45
+ ,149326
+ ,39
+ ,40715
+ ,59
+ ,144425
+ ,48
+ ,65897
+ ,59
+ ,159599
+ ,72
+ ,76542
+ ,93
+ ,151465
+ ,39
+ ,37477
+ ,35
+ ,133686
+ ,28
+ ,53216
+ ,47
+ ,58059
+ ,24
+ ,40911
+ ,36
+ ,234131
+ ,49
+ ,57021
+ ,59
+ ,193233
+ ,95
+ ,73116
+ ,79
+ ,19349
+ ,13
+ ,3895
+ ,14
+ ,205449
+ ,32
+ ,46609
+ ,42
+ ,151538
+ ,41
+ ,29351
+ ,41
+ ,59117
+ ,24
+ ,2325
+ ,8
+ ,58280
+ ,41
+ ,31747
+ ,41
+ ,126653
+ ,57
+ ,32665
+ ,24
+ ,112265
+ ,28
+ ,19249
+ ,22
+ ,83829
+ ,34
+ ,15292
+ ,18
+ ,27676
+ ,2
+ ,5842
+ ,1
+ ,134211
+ ,80
+ ,33994
+ ,53
+ ,117451
+ ,18
+ ,13018
+ ,6
+ ,0
+ ,0
+ ,0
+ ,0
+ ,85610
+ ,46
+ ,98177
+ ,49
+ ,107205
+ ,25
+ ,37941
+ ,33
+ ,144664
+ ,51
+ ,31032
+ ,50
+ ,136540
+ ,59
+ ,32683
+ ,64
+ ,71894
+ ,36
+ ,34545
+ ,53
+ ,3616
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,167611
+ ,36
+ ,27525
+ ,48
+ ,138047
+ ,68
+ ,66856
+ ,90
+ ,152826
+ ,28
+ ,28549
+ ,46
+ ,113245
+ ,36
+ ,38610
+ ,29
+ ,43410
+ ,7
+ ,2781
+ ,1
+ ,175762
+ ,70
+ ,41211
+ ,64
+ ,90591
+ ,30
+ ,22698
+ ,29
+ ,114942
+ ,55
+ ,41194
+ ,27
+ ,60493
+ ,3
+ ,32689
+ ,4
+ ,19764
+ ,10
+ ,5752
+ ,10
+ ,164062
+ ,46
+ ,26757
+ ,47
+ ,125970
+ ,34
+ ,22527
+ ,44
+ ,151495
+ ,50
+ ,44810
+ ,51
+ ,11796
+ ,1
+ ,0
+ ,0
+ ,10674
+ ,0
+ ,0
+ ,0
+ ,138547
+ ,35
+ ,100674
+ ,38
+ ,6836
+ ,0
+ ,0
+ ,0
+ ,153278
+ ,48
+ ,57786
+ ,57
+ ,5118
+ ,5
+ ,0
+ ,0
+ ,40248
+ ,8
+ ,5444
+ ,6
+ ,0
+ ,0
+ ,0
+ ,0
+ ,117954
+ ,35
+ ,28470
+ ,22
+ ,88837
+ ,21
+ ,61849
+ ,34
+ ,7131
+ ,0
+ ,0
+ ,0
+ ,8812
+ ,0
+ ,2179
+ ,10
+ ,68916
+ ,15
+ ,8019
+ ,16
+ ,132697
+ ,50
+ ,39644
+ ,93
+ ,100681
+ ,17
+ ,23494
+ ,22)
+ ,dim=c(4
+ ,144)
+ ,dimnames=list(c('TimeSpent'
+ ,'BlogComput'
+ ,'CharaComp'
+ ,'Blogscomp')
+ ,1:144))
> y <- array(NA,dim=c(4,144),dimnames=list(c('TimeSpent','BlogComput','CharaComp','Blogscomp'),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 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
TimeSpent BlogComput CharaComp Blogscomp
1 158258 48 20465 37
2 186739 53 33629 43
3 7215 0 1423 0
4 122689 49 25629 54
5 226968 76 54002 86
6 494047 125 151036 181
7 171007 59 33287 42
8 174432 76 31172 59
9 149604 55 28113 46
10 275702 67 57803 77
11 121844 50 49830 49
12 176637 73 52143 79
13 92070 41 21055 37
14 208880 79 47007 92
15 157095 51 28735 31
16 147893 54 59147 28
17 134175 75 78950 103
18 68818 1 13497 2
19 149555 73 46154 48
20 27997 13 53249 25
21 69866 19 10726 16
22 227357 89 83700 106
23 188137 37 40400 35
24 127994 48 33797 33
25 143682 50 36205 45
26 164820 45 30165 64
27 187214 59 58534 73
28 176178 79 44663 78
29 351374 60 92556 63
30 192399 52 40078 69
31 165257 50 34711 36
32 173687 60 31076 41
33 126338 53 74608 59
34 224762 76 58092 33
35 219428 63 42009 76
36 0 0 0 0
37 208669 53 36022 27
38 99706 44 23333 44
39 136733 36 53349 43
40 249965 83 92596 104
41 232951 105 49598 120
42 143748 37 44093 44
43 94332 25 84205 71
44 189893 63 63369 78
45 114811 55 60132 106
46 156861 41 37403 61
47 81293 23 24460 53
48 204965 63 46456 51
49 223771 54 66616 46
50 160254 68 41554 55
51 48188 12 22346 14
52 143776 84 30874 44
53 286674 66 68701 113
54 234829 56 35728 55
55 195583 67 29010 46
56 145942 40 23110 39
57 203260 53 38844 51
58 93764 26 27084 31
59 151913 67 35139 36
60 190487 36 57476 47
61 143389 50 33277 53
62 124825 48 31141 38
63 124234 46 61281 52
64 111501 53 25820 37
65 153813 27 23284 11
66 97548 38 35378 45
67 178613 68 74990 59
68 138708 93 29653 82
69 111869 57 64622 49
70 31970 5 4157 6
71 224494 53 29245 81
72 116999 36 50008 56
73 113504 72 52338 105
74 105932 49 13310 46
75 159167 74 92901 46
76 90204 13 10956 2
77 165210 82 34241 51
78 156752 71 75043 95
79 69233 17 21152 18
80 84971 34 42249 55
81 80506 54 42005 48
82 267162 43 41152 48
83 62974 26 14399 39
84 119802 44 28263 40
85 75132 35 17215 36
86 154426 32 48140 60
87 222914 55 62897 114
88 115019 58 22883 39
89 99114 44 41622 45
90 149326 39 40715 59
91 144425 48 65897 59
92 159599 72 76542 93
93 151465 39 37477 35
94 133686 28 53216 47
95 58059 24 40911 36
96 234131 49 57021 59
97 193233 95 73116 79
98 19349 13 3895 14
99 205449 32 46609 42
100 151538 41 29351 41
101 59117 24 2325 8
102 58280 41 31747 41
103 126653 57 32665 24
104 112265 28 19249 22
105 83829 34 15292 18
106 27676 2 5842 1
107 134211 80 33994 53
108 117451 18 13018 6
109 0 0 0 0
110 85610 46 98177 49
111 107205 25 37941 33
112 144664 51 31032 50
113 136540 59 32683 64
114 71894 36 34545 53
115 3616 0 0 0
116 0 0 0 0
117 167611 36 27525 48
118 138047 68 66856 90
119 152826 28 28549 46
120 113245 36 38610 29
121 43410 7 2781 1
122 175762 70 41211 64
123 90591 30 22698 29
124 114942 55 41194 27
125 60493 3 32689 4
126 19764 10 5752 10
127 164062 46 26757 47
128 125970 34 22527 44
129 151495 50 44810 51
130 11796 1 0 0
131 10674 0 0 0
132 138547 35 100674 38
133 6836 0 0 0
134 153278 48 57786 57
135 5118 5 0 0
136 40248 8 5444 6
137 0 0 0 0
138 117954 35 28470 22
139 88837 21 61849 34
140 7131 0 0 0
141 8812 0 2179 10
142 68916 15 8019 16
143 132697 50 39644 93
144 100681 17 23494 22
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) BlogComput CharaComp Blogscomp
2.388e+04 1.426e+03 7.243e-01 3.987e+02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-94916 -23883 -3901 26280 149766
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.388e+04 7.396e+03 3.229 0.00155 **
BlogComput 1.426e+03 2.495e+02 5.717 6.3e-08 ***
CharaComp 7.243e-01 2.203e-01 3.288 0.00128 **
Blogscomp 3.987e+02 2.336e+02 1.706 0.09014 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 43010 on 140 degrees of freedom
Multiple R-squared: 0.67, Adjusted R-squared: 0.6629
F-statistic: 94.73 on 3 and 140 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.11229466 2.245893e-01 8.877053e-01
[2,] 0.08203232 1.640646e-01 9.179677e-01
[3,] 0.03407956 6.815912e-02 9.659204e-01
[4,] 0.08898177 1.779635e-01 9.110182e-01
[5,] 0.30368708 6.073742e-01 6.963129e-01
[6,] 0.35964574 7.192915e-01 6.403543e-01
[7,] 0.28615498 5.723100e-01 7.138450e-01
[8,] 0.21127271 4.225454e-01 7.887273e-01
[9,] 0.15308638 3.061728e-01 8.469136e-01
[10,] 0.16078271 3.215654e-01 8.392173e-01
[11,] 0.73047647 5.390471e-01 2.695235e-01
[12,] 0.74000767 5.199847e-01 2.599923e-01
[13,] 0.72763693 5.447261e-01 2.723631e-01
[14,] 0.77598395 4.480321e-01 2.240160e-01
[15,] 0.72453381 5.509324e-01 2.754662e-01
[16,] 0.71811914 5.637617e-01 2.818809e-01
[17,] 0.79501732 4.099654e-01 2.049827e-01
[18,] 0.74345493 5.130901e-01 2.565451e-01
[19,] 0.68650015 6.269997e-01 3.134998e-01
[20,] 0.64334659 7.133068e-01 3.566534e-01
[21,] 0.58167006 8.366599e-01 4.183299e-01
[22,] 0.55504835 8.899033e-01 4.449516e-01
[23,] 0.90366993 1.926601e-01 9.633007e-02
[24,] 0.89539106 2.092179e-01 1.046089e-01
[25,] 0.87555138 2.488972e-01 1.244486e-01
[26,] 0.85107150 2.978570e-01 1.489285e-01
[27,] 0.89905394 2.018921e-01 1.009461e-01
[28,] 0.88193732 2.361254e-01 1.180627e-01
[29,] 0.87984092 2.403182e-01 1.201591e-01
[30,] 0.85598718 2.880256e-01 1.440128e-01
[31,] 0.89015300 2.196940e-01 1.098470e-01
[32,] 0.86896450 2.620710e-01 1.310355e-01
[33,] 0.83921855 3.215629e-01 1.607815e-01
[34,] 0.81746179 3.650764e-01 1.825382e-01
[35,] 0.79202553 4.159489e-01 2.079745e-01
[36,] 0.75645587 4.870883e-01 2.435441e-01
[37,] 0.78525258 4.294948e-01 2.147474e-01
[38,] 0.74669816 5.066037e-01 2.533018e-01
[39,] 0.78545144 4.290971e-01 2.145486e-01
[40,] 0.76700348 4.659930e-01 2.329965e-01
[41,] 0.73140329 5.371934e-01 2.685967e-01
[42,] 0.71383342 5.723332e-01 2.861666e-01
[43,] 0.73021056 5.395789e-01 2.697894e-01
[44,] 0.70208965 5.958207e-01 2.979103e-01
[45,] 0.66051400 6.789720e-01 3.394860e-01
[46,] 0.69231326 6.153735e-01 3.076867e-01
[47,] 0.79274760 4.145048e-01 2.072524e-01
[48,] 0.88257476 2.348505e-01 1.174252e-01
[49,] 0.87933157 2.413369e-01 1.206684e-01
[50,] 0.87119884 2.576023e-01 1.288012e-01
[51,] 0.89234001 2.153200e-01 1.076600e-01
[52,] 0.86769607 2.646079e-01 1.323039e-01
[53,] 0.84936206 3.012759e-01 1.506379e-01
[54,] 0.86871051 2.625790e-01 1.312895e-01
[55,] 0.84252171 3.149566e-01 1.574783e-01
[56,] 0.81415069 3.716986e-01 1.858493e-01
[57,] 0.80510178 3.897964e-01 1.948982e-01
[58,] 0.78004645 4.399071e-01 2.199535e-01
[59,] 0.84297299 3.140540e-01 1.570270e-01
[60,] 0.82188404 3.562319e-01 1.781160e-01
[61,] 0.81129562 3.774088e-01 1.887044e-01
[62,] 0.85081981 2.983604e-01 1.491802e-01
[63,] 0.87966198 2.406760e-01 1.203380e-01
[64,] 0.85412640 2.917472e-01 1.458736e-01
[65,] 0.90880136 1.823973e-01 9.119864e-02
[66,] 0.89075810 2.184838e-01 1.092419e-01
[67,] 0.94823911 1.035218e-01 5.176089e-02
[68,] 0.93519704 1.296059e-01 6.480296e-02
[69,] 0.94423592 1.115282e-01 5.576408e-02
[70,] 0.94269879 1.146024e-01 5.730121e-02
[71,] 0.92967475 1.406505e-01 7.032525e-02
[72,] 0.94142396 1.171521e-01 5.857604e-02
[73,] 0.92573386 1.485323e-01 7.426614e-02
[74,] 0.92430951 1.513810e-01 7.569049e-02
[75,] 0.94557950 1.088410e-01 5.442050e-02
[76,] 0.99785002 4.299959e-03 2.149979e-03
[77,] 0.99729497 5.410061e-03 2.705030e-03
[78,] 0.99605283 7.894339e-03 3.947170e-03
[79,] 0.99497242 1.005517e-02 5.027584e-03
[80,] 0.99376589 1.246823e-02 6.234113e-03
[81,] 0.99250229 1.499542e-02 7.497709e-03
[82,] 0.99004671 1.990659e-02 9.953293e-03
[83,] 0.98840637 2.318726e-02 1.159363e-02
[84,] 0.98516469 2.967062e-02 1.483531e-02
[85,] 0.98026308 3.947384e-02 1.973692e-02
[86,] 0.98354296 3.291408e-02 1.645704e-02
[87,] 0.98265395 3.469210e-02 1.734605e-02
[88,] 0.97764383 4.471234e-02 2.235617e-02
[89,] 0.97750291 4.499419e-02 2.249709e-02
[90,] 0.99340933 1.318134e-02 6.590672e-03
[91,] 0.99285841 1.428318e-02 7.141588e-03
[92,] 0.99188979 1.622043e-02 8.110213e-03
[93,] 0.99916904 1.661916e-03 8.309582e-04
[94,] 0.99920040 1.599209e-03 7.996043e-04
[95,] 0.99870797 2.584051e-03 1.292025e-03
[96,] 0.99932186 1.356273e-03 6.781367e-04
[97,] 0.99889272 2.214563e-03 1.107281e-03
[98,] 0.99869533 2.609339e-03 1.304669e-03
[99,] 0.99789205 4.215894e-03 2.107947e-03
[100,] 0.99664454 6.710925e-03 3.355463e-03
[101,] 0.99790577 4.188464e-03 2.094232e-03
[102,] 0.99904448 1.911039e-03 9.555196e-04
[103,] 0.99865051 2.698977e-03 1.349489e-03
[104,] 0.99974011 5.197751e-04 2.598876e-04
[105,] 0.99958281 8.343748e-04 4.171874e-04
[106,] 0.99926770 1.464598e-03 7.322989e-04
[107,] 0.99890205 2.195902e-03 1.097951e-03
[108,] 0.99922577 1.548455e-03 7.742275e-04
[109,] 0.99876715 2.465697e-03 1.232849e-03
[110,] 0.99821427 3.571459e-03 1.785730e-03
[111,] 0.99941539 1.169219e-03 5.846093e-04
[112,] 0.99993674 1.265223e-04 6.326115e-05
[113,] 0.99999201 1.598607e-05 7.993037e-06
[114,] 0.99997975 4.050496e-05 2.025248e-05
[115,] 0.99995930 8.139837e-05 4.069918e-05
[116,] 0.99991374 1.725279e-04 8.626395e-05
[117,] 0.99979412 4.117671e-04 2.058835e-04
[118,] 0.99997740 4.520807e-05 2.260404e-05
[119,] 0.99998393 3.214528e-05 1.607264e-05
[120,] 0.99997851 4.298195e-05 2.149098e-05
[121,] 0.99996427 7.146609e-05 3.573304e-05
[122,] 0.99995379 9.242565e-05 4.621282e-05
[123,] 0.99986455 2.709098e-04 1.354549e-04
[124,] 0.99957901 8.419892e-04 4.209946e-04
[125,] 0.99873734 2.525320e-03 1.262660e-03
[126,] 0.99693678 6.126431e-03 3.063215e-03
[127,] 0.99177477 1.645047e-02 8.225234e-03
[128,] 0.98034469 3.931063e-02 1.965531e-02
[129,] 0.97369744 5.260512e-02 2.630256e-02
[130,] 0.93113532 1.377294e-01 6.886468e-02
[131,] 0.87346985 2.530603e-01 1.265302e-01
> postscript(file="/var/wessaorg/rcomp/tmp/1b2ga1324389497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/2uxh31324389497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/37bwl1324389497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/49u841324389497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/5oydr1324389497.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
36347.2570 45770.5055 -17698.6790 -11165.5820 21299.3824 110340.2905
7 8 9 10 11 12
22128.1699 -3936.1336 8582.7306 83703.2034 -28973.1002 -20616.0860
13 14 15 16 17 18
-20285.2621 1607.8002 27307.5881 -7005.3556 -94915.5191 32935.2221
19 20 21 22 23 24
-31001.5336 -62962.3055 4738.9475 -26335.7882 68271.2219 -1978.9727
25 26 27 28 29 30
4328.6489 29397.6907 7689.3168 -23815.0971 149766.3804 37820.1829
31 32 33 34 35 36
30573.7592 25382.2222 -50691.7172 37259.8750 44972.5386 -23882.9460
37 38 39 40 41 42
72345.7413 -21368.2914 5724.6012 -817.4565 -24439.5895 17619.2924
43 44 45 46 47 48
-54501.7602 -831.6427 -73322.5094 23096.3957 -14237.0489 37254.9335
49 50 51 52 53 54
56286.6654 -12630.6060 -14575.6975 -39805.3256 73855.6908 83277.8275
55 56 57 58 59 60
36798.5590 32727.0213 55324.7946 825.4710 -7324.2981 54894.6142
61 62 63 64 65 66
2967.2222 -5217.4363 -30368.9974 -21419.1730 70174.0560 -24092.8832
67 68 69 70 71 72
-20085.2148 -71973.1087 -59645.3479 -4446.5854 71551.8838 -16771.9791
73 74 75 76 77 78
-92829.3988 -15810.1741 -55878.9591 39048.3245 -20748.5587 -60614.7622
79 80 81 82 83 84
-1391.0823 -39928.9396 -69948.9747 133012.2060 -23965.5900 -3248.6335
85 86 87 88 89 90
-25486.4230 26117.9202 29588.4078 -23701.7146 -35606.3697 16811.9505
91 92 93 94 95 96
-19164.4088 -59482.3428 30864.2218 12588.2543 -44036.0153 75544.6950
97 98 99 100 101 102
-50586.2672 -31476.0575 85425.7803 31578.9859 -3866.2010 -63414.5279
103 104 105 106 107 108
-11747.1531 25737.3683 -6794.5024 -3689.4296 -49513.7293 56076.4953
109 110 111 112 113 114
-23882.9460 -94522.1884 7031.1315 5638.2240 -20671.8728 -49480.5579
115 116 117 118 119 120
-20266.9460 -23882.9460 53314.5999 -67117.9419 49994.1602 -1506.1268
121 122 123 124 125 126
7131.1687 -3314.3475 -4077.7407 -27979.7748 7059.1655 -26533.1488
127 128 129 130 131 132
36459.3522 19740.7254 3516.7543 -13513.0661 -13208.9460 -23321.2685
133 134 135 136 137 138
-17046.9460 -3638.9814 -25895.5462 -1379.1685 -23882.9460 14764.4076
139 140 141 142 143 144
-23348.5218 -16751.9460 -20635.8889 11454.2105 -28283.0792 26765.8740
> postscript(file="/var/wessaorg/rcomp/tmp/69j5x1324389497.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 36347.2570 NA
1 45770.5055 36347.2570
2 -17698.6790 45770.5055
3 -11165.5820 -17698.6790
4 21299.3824 -11165.5820
5 110340.2905 21299.3824
6 22128.1699 110340.2905
7 -3936.1336 22128.1699
8 8582.7306 -3936.1336
9 83703.2034 8582.7306
10 -28973.1002 83703.2034
11 -20616.0860 -28973.1002
12 -20285.2621 -20616.0860
13 1607.8002 -20285.2621
14 27307.5881 1607.8002
15 -7005.3556 27307.5881
16 -94915.5191 -7005.3556
17 32935.2221 -94915.5191
18 -31001.5336 32935.2221
19 -62962.3055 -31001.5336
20 4738.9475 -62962.3055
21 -26335.7882 4738.9475
22 68271.2219 -26335.7882
23 -1978.9727 68271.2219
24 4328.6489 -1978.9727
25 29397.6907 4328.6489
26 7689.3168 29397.6907
27 -23815.0971 7689.3168
28 149766.3804 -23815.0971
29 37820.1829 149766.3804
30 30573.7592 37820.1829
31 25382.2222 30573.7592
32 -50691.7172 25382.2222
33 37259.8750 -50691.7172
34 44972.5386 37259.8750
35 -23882.9460 44972.5386
36 72345.7413 -23882.9460
37 -21368.2914 72345.7413
38 5724.6012 -21368.2914
39 -817.4565 5724.6012
40 -24439.5895 -817.4565
41 17619.2924 -24439.5895
42 -54501.7602 17619.2924
43 -831.6427 -54501.7602
44 -73322.5094 -831.6427
45 23096.3957 -73322.5094
46 -14237.0489 23096.3957
47 37254.9335 -14237.0489
48 56286.6654 37254.9335
49 -12630.6060 56286.6654
50 -14575.6975 -12630.6060
51 -39805.3256 -14575.6975
52 73855.6908 -39805.3256
53 83277.8275 73855.6908
54 36798.5590 83277.8275
55 32727.0213 36798.5590
56 55324.7946 32727.0213
57 825.4710 55324.7946
58 -7324.2981 825.4710
59 54894.6142 -7324.2981
60 2967.2222 54894.6142
61 -5217.4363 2967.2222
62 -30368.9974 -5217.4363
63 -21419.1730 -30368.9974
64 70174.0560 -21419.1730
65 -24092.8832 70174.0560
66 -20085.2148 -24092.8832
67 -71973.1087 -20085.2148
68 -59645.3479 -71973.1087
69 -4446.5854 -59645.3479
70 71551.8838 -4446.5854
71 -16771.9791 71551.8838
72 -92829.3988 -16771.9791
73 -15810.1741 -92829.3988
74 -55878.9591 -15810.1741
75 39048.3245 -55878.9591
76 -20748.5587 39048.3245
77 -60614.7622 -20748.5587
78 -1391.0823 -60614.7622
79 -39928.9396 -1391.0823
80 -69948.9747 -39928.9396
81 133012.2060 -69948.9747
82 -23965.5900 133012.2060
83 -3248.6335 -23965.5900
84 -25486.4230 -3248.6335
85 26117.9202 -25486.4230
86 29588.4078 26117.9202
87 -23701.7146 29588.4078
88 -35606.3697 -23701.7146
89 16811.9505 -35606.3697
90 -19164.4088 16811.9505
91 -59482.3428 -19164.4088
92 30864.2218 -59482.3428
93 12588.2543 30864.2218
94 -44036.0153 12588.2543
95 75544.6950 -44036.0153
96 -50586.2672 75544.6950
97 -31476.0575 -50586.2672
98 85425.7803 -31476.0575
99 31578.9859 85425.7803
100 -3866.2010 31578.9859
101 -63414.5279 -3866.2010
102 -11747.1531 -63414.5279
103 25737.3683 -11747.1531
104 -6794.5024 25737.3683
105 -3689.4296 -6794.5024
106 -49513.7293 -3689.4296
107 56076.4953 -49513.7293
108 -23882.9460 56076.4953
109 -94522.1884 -23882.9460
110 7031.1315 -94522.1884
111 5638.2240 7031.1315
112 -20671.8728 5638.2240
113 -49480.5579 -20671.8728
114 -20266.9460 -49480.5579
115 -23882.9460 -20266.9460
116 53314.5999 -23882.9460
117 -67117.9419 53314.5999
118 49994.1602 -67117.9419
119 -1506.1268 49994.1602
120 7131.1687 -1506.1268
121 -3314.3475 7131.1687
122 -4077.7407 -3314.3475
123 -27979.7748 -4077.7407
124 7059.1655 -27979.7748
125 -26533.1488 7059.1655
126 36459.3522 -26533.1488
127 19740.7254 36459.3522
128 3516.7543 19740.7254
129 -13513.0661 3516.7543
130 -13208.9460 -13513.0661
131 -23321.2685 -13208.9460
132 -17046.9460 -23321.2685
133 -3638.9814 -17046.9460
134 -25895.5462 -3638.9814
135 -1379.1685 -25895.5462
136 -23882.9460 -1379.1685
137 14764.4076 -23882.9460
138 -23348.5218 14764.4076
139 -16751.9460 -23348.5218
140 -20635.8889 -16751.9460
141 11454.2105 -20635.8889
142 -28283.0792 11454.2105
143 26765.8740 -28283.0792
144 NA 26765.8740
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 45770.5055 36347.2570
[2,] -17698.6790 45770.5055
[3,] -11165.5820 -17698.6790
[4,] 21299.3824 -11165.5820
[5,] 110340.2905 21299.3824
[6,] 22128.1699 110340.2905
[7,] -3936.1336 22128.1699
[8,] 8582.7306 -3936.1336
[9,] 83703.2034 8582.7306
[10,] -28973.1002 83703.2034
[11,] -20616.0860 -28973.1002
[12,] -20285.2621 -20616.0860
[13,] 1607.8002 -20285.2621
[14,] 27307.5881 1607.8002
[15,] -7005.3556 27307.5881
[16,] -94915.5191 -7005.3556
[17,] 32935.2221 -94915.5191
[18,] -31001.5336 32935.2221
[19,] -62962.3055 -31001.5336
[20,] 4738.9475 -62962.3055
[21,] -26335.7882 4738.9475
[22,] 68271.2219 -26335.7882
[23,] -1978.9727 68271.2219
[24,] 4328.6489 -1978.9727
[25,] 29397.6907 4328.6489
[26,] 7689.3168 29397.6907
[27,] -23815.0971 7689.3168
[28,] 149766.3804 -23815.0971
[29,] 37820.1829 149766.3804
[30,] 30573.7592 37820.1829
[31,] 25382.2222 30573.7592
[32,] -50691.7172 25382.2222
[33,] 37259.8750 -50691.7172
[34,] 44972.5386 37259.8750
[35,] -23882.9460 44972.5386
[36,] 72345.7413 -23882.9460
[37,] -21368.2914 72345.7413
[38,] 5724.6012 -21368.2914
[39,] -817.4565 5724.6012
[40,] -24439.5895 -817.4565
[41,] 17619.2924 -24439.5895
[42,] -54501.7602 17619.2924
[43,] -831.6427 -54501.7602
[44,] -73322.5094 -831.6427
[45,] 23096.3957 -73322.5094
[46,] -14237.0489 23096.3957
[47,] 37254.9335 -14237.0489
[48,] 56286.6654 37254.9335
[49,] -12630.6060 56286.6654
[50,] -14575.6975 -12630.6060
[51,] -39805.3256 -14575.6975
[52,] 73855.6908 -39805.3256
[53,] 83277.8275 73855.6908
[54,] 36798.5590 83277.8275
[55,] 32727.0213 36798.5590
[56,] 55324.7946 32727.0213
[57,] 825.4710 55324.7946
[58,] -7324.2981 825.4710
[59,] 54894.6142 -7324.2981
[60,] 2967.2222 54894.6142
[61,] -5217.4363 2967.2222
[62,] -30368.9974 -5217.4363
[63,] -21419.1730 -30368.9974
[64,] 70174.0560 -21419.1730
[65,] -24092.8832 70174.0560
[66,] -20085.2148 -24092.8832
[67,] -71973.1087 -20085.2148
[68,] -59645.3479 -71973.1087
[69,] -4446.5854 -59645.3479
[70,] 71551.8838 -4446.5854
[71,] -16771.9791 71551.8838
[72,] -92829.3988 -16771.9791
[73,] -15810.1741 -92829.3988
[74,] -55878.9591 -15810.1741
[75,] 39048.3245 -55878.9591
[76,] -20748.5587 39048.3245
[77,] -60614.7622 -20748.5587
[78,] -1391.0823 -60614.7622
[79,] -39928.9396 -1391.0823
[80,] -69948.9747 -39928.9396
[81,] 133012.2060 -69948.9747
[82,] -23965.5900 133012.2060
[83,] -3248.6335 -23965.5900
[84,] -25486.4230 -3248.6335
[85,] 26117.9202 -25486.4230
[86,] 29588.4078 26117.9202
[87,] -23701.7146 29588.4078
[88,] -35606.3697 -23701.7146
[89,] 16811.9505 -35606.3697
[90,] -19164.4088 16811.9505
[91,] -59482.3428 -19164.4088
[92,] 30864.2218 -59482.3428
[93,] 12588.2543 30864.2218
[94,] -44036.0153 12588.2543
[95,] 75544.6950 -44036.0153
[96,] -50586.2672 75544.6950
[97,] -31476.0575 -50586.2672
[98,] 85425.7803 -31476.0575
[99,] 31578.9859 85425.7803
[100,] -3866.2010 31578.9859
[101,] -63414.5279 -3866.2010
[102,] -11747.1531 -63414.5279
[103,] 25737.3683 -11747.1531
[104,] -6794.5024 25737.3683
[105,] -3689.4296 -6794.5024
[106,] -49513.7293 -3689.4296
[107,] 56076.4953 -49513.7293
[108,] -23882.9460 56076.4953
[109,] -94522.1884 -23882.9460
[110,] 7031.1315 -94522.1884
[111,] 5638.2240 7031.1315
[112,] -20671.8728 5638.2240
[113,] -49480.5579 -20671.8728
[114,] -20266.9460 -49480.5579
[115,] -23882.9460 -20266.9460
[116,] 53314.5999 -23882.9460
[117,] -67117.9419 53314.5999
[118,] 49994.1602 -67117.9419
[119,] -1506.1268 49994.1602
[120,] 7131.1687 -1506.1268
[121,] -3314.3475 7131.1687
[122,] -4077.7407 -3314.3475
[123,] -27979.7748 -4077.7407
[124,] 7059.1655 -27979.7748
[125,] -26533.1488 7059.1655
[126,] 36459.3522 -26533.1488
[127,] 19740.7254 36459.3522
[128,] 3516.7543 19740.7254
[129,] -13513.0661 3516.7543
[130,] -13208.9460 -13513.0661
[131,] -23321.2685 -13208.9460
[132,] -17046.9460 -23321.2685
[133,] -3638.9814 -17046.9460
[134,] -25895.5462 -3638.9814
[135,] -1379.1685 -25895.5462
[136,] -23882.9460 -1379.1685
[137,] 14764.4076 -23882.9460
[138,] -23348.5218 14764.4076
[139,] -16751.9460 -23348.5218
[140,] -20635.8889 -16751.9460
[141,] 11454.2105 -20635.8889
[142,] -28283.0792 11454.2105
[143,] 26765.8740 -28283.0792
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 45770.5055 36347.2570
2 -17698.6790 45770.5055
3 -11165.5820 -17698.6790
4 21299.3824 -11165.5820
5 110340.2905 21299.3824
6 22128.1699 110340.2905
7 -3936.1336 22128.1699
8 8582.7306 -3936.1336
9 83703.2034 8582.7306
10 -28973.1002 83703.2034
11 -20616.0860 -28973.1002
12 -20285.2621 -20616.0860
13 1607.8002 -20285.2621
14 27307.5881 1607.8002
15 -7005.3556 27307.5881
16 -94915.5191 -7005.3556
17 32935.2221 -94915.5191
18 -31001.5336 32935.2221
19 -62962.3055 -31001.5336
20 4738.9475 -62962.3055
21 -26335.7882 4738.9475
22 68271.2219 -26335.7882
23 -1978.9727 68271.2219
24 4328.6489 -1978.9727
25 29397.6907 4328.6489
26 7689.3168 29397.6907
27 -23815.0971 7689.3168
28 149766.3804 -23815.0971
29 37820.1829 149766.3804
30 30573.7592 37820.1829
31 25382.2222 30573.7592
32 -50691.7172 25382.2222
33 37259.8750 -50691.7172
34 44972.5386 37259.8750
35 -23882.9460 44972.5386
36 72345.7413 -23882.9460
37 -21368.2914 72345.7413
38 5724.6012 -21368.2914
39 -817.4565 5724.6012
40 -24439.5895 -817.4565
41 17619.2924 -24439.5895
42 -54501.7602 17619.2924
43 -831.6427 -54501.7602
44 -73322.5094 -831.6427
45 23096.3957 -73322.5094
46 -14237.0489 23096.3957
47 37254.9335 -14237.0489
48 56286.6654 37254.9335
49 -12630.6060 56286.6654
50 -14575.6975 -12630.6060
51 -39805.3256 -14575.6975
52 73855.6908 -39805.3256
53 83277.8275 73855.6908
54 36798.5590 83277.8275
55 32727.0213 36798.5590
56 55324.7946 32727.0213
57 825.4710 55324.7946
58 -7324.2981 825.4710
59 54894.6142 -7324.2981
60 2967.2222 54894.6142
61 -5217.4363 2967.2222
62 -30368.9974 -5217.4363
63 -21419.1730 -30368.9974
64 70174.0560 -21419.1730
65 -24092.8832 70174.0560
66 -20085.2148 -24092.8832
67 -71973.1087 -20085.2148
68 -59645.3479 -71973.1087
69 -4446.5854 -59645.3479
70 71551.8838 -4446.5854
71 -16771.9791 71551.8838
72 -92829.3988 -16771.9791
73 -15810.1741 -92829.3988
74 -55878.9591 -15810.1741
75 39048.3245 -55878.9591
76 -20748.5587 39048.3245
77 -60614.7622 -20748.5587
78 -1391.0823 -60614.7622
79 -39928.9396 -1391.0823
80 -69948.9747 -39928.9396
81 133012.2060 -69948.9747
82 -23965.5900 133012.2060
83 -3248.6335 -23965.5900
84 -25486.4230 -3248.6335
85 26117.9202 -25486.4230
86 29588.4078 26117.9202
87 -23701.7146 29588.4078
88 -35606.3697 -23701.7146
89 16811.9505 -35606.3697
90 -19164.4088 16811.9505
91 -59482.3428 -19164.4088
92 30864.2218 -59482.3428
93 12588.2543 30864.2218
94 -44036.0153 12588.2543
95 75544.6950 -44036.0153
96 -50586.2672 75544.6950
97 -31476.0575 -50586.2672
98 85425.7803 -31476.0575
99 31578.9859 85425.7803
100 -3866.2010 31578.9859
101 -63414.5279 -3866.2010
102 -11747.1531 -63414.5279
103 25737.3683 -11747.1531
104 -6794.5024 25737.3683
105 -3689.4296 -6794.5024
106 -49513.7293 -3689.4296
107 56076.4953 -49513.7293
108 -23882.9460 56076.4953
109 -94522.1884 -23882.9460
110 7031.1315 -94522.1884
111 5638.2240 7031.1315
112 -20671.8728 5638.2240
113 -49480.5579 -20671.8728
114 -20266.9460 -49480.5579
115 -23882.9460 -20266.9460
116 53314.5999 -23882.9460
117 -67117.9419 53314.5999
118 49994.1602 -67117.9419
119 -1506.1268 49994.1602
120 7131.1687 -1506.1268
121 -3314.3475 7131.1687
122 -4077.7407 -3314.3475
123 -27979.7748 -4077.7407
124 7059.1655 -27979.7748
125 -26533.1488 7059.1655
126 36459.3522 -26533.1488
127 19740.7254 36459.3522
128 3516.7543 19740.7254
129 -13513.0661 3516.7543
130 -13208.9460 -13513.0661
131 -23321.2685 -13208.9460
132 -17046.9460 -23321.2685
133 -3638.9814 -17046.9460
134 -25895.5462 -3638.9814
135 -1379.1685 -25895.5462
136 -23882.9460 -1379.1685
137 14764.4076 -23882.9460
138 -23348.5218 14764.4076
139 -16751.9460 -23348.5218
140 -20635.8889 -16751.9460
141 11454.2105 -20635.8889
142 -28283.0792 11454.2105
143 26765.8740 -28283.0792
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/7ivkd1324389497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/8gm2s1324389497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/9pj3k1324389497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/wessaorg/rcomp/tmp/10hkoo1324389497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/11wka51324389497.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12ei931324389497.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13hmuq1324389497.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/1460oo1324389497.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/15v92c1324389497.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/16w54l1324389497.tab")
+ }
>
> try(system("convert tmp/1b2ga1324389497.ps tmp/1b2ga1324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/2uxh31324389497.ps tmp/2uxh31324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/37bwl1324389497.ps tmp/37bwl1324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/49u841324389497.ps tmp/49u841324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/5oydr1324389497.ps tmp/5oydr1324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/69j5x1324389497.ps tmp/69j5x1324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ivkd1324389497.ps tmp/7ivkd1324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/8gm2s1324389497.ps tmp/8gm2s1324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/9pj3k1324389497.ps tmp/9pj3k1324389497.png",intern=TRUE))
character(0)
> try(system("convert tmp/10hkoo1324389497.ps tmp/10hkoo1324389497.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.548 0.608 5.187