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(1845
+ ,162687
+ ,95
+ ,48
+ ,21
+ ,20465
+ ,0
+ ,1796
+ ,201906
+ ,62
+ ,58
+ ,20
+ ,33629
+ ,1
+ ,192
+ ,7215
+ ,18
+ ,0
+ ,0
+ ,1423
+ ,0
+ ,2444
+ ,146367
+ ,97
+ ,67
+ ,27
+ ,25629
+ ,0
+ ,3567
+ ,257045
+ ,139
+ ,83
+ ,31
+ ,54002
+ ,0
+ ,6917
+ ,524450
+ ,265
+ ,136
+ ,36
+ ,151036
+ ,1
+ ,1840
+ ,188294
+ ,58
+ ,65
+ ,23
+ ,33287
+ ,1
+ ,1740
+ ,195674
+ ,60
+ ,86
+ ,30
+ ,31172
+ ,0
+ ,2078
+ ,177020
+ ,44
+ ,62
+ ,30
+ ,28113
+ ,0
+ ,3097
+ ,325899
+ ,98
+ ,71
+ ,27
+ ,57803
+ ,1
+ ,1946
+ ,121844
+ ,75
+ ,50
+ ,24
+ ,49830
+ ,2
+ ,2370
+ ,203938
+ ,72
+ ,88
+ ,30
+ ,52143
+ ,0
+ ,1883
+ ,107394
+ ,105
+ ,50
+ ,22
+ ,21055
+ ,0
+ ,3198
+ ,220751
+ ,120
+ ,79
+ ,28
+ ,47007
+ ,4
+ ,1490
+ ,172905
+ ,62
+ ,56
+ ,18
+ ,28735
+ ,4
+ ,1573
+ ,156326
+ ,88
+ ,54
+ ,22
+ ,59147
+ ,3
+ ,1807
+ ,145178
+ ,58
+ ,81
+ ,37
+ ,78950
+ ,0
+ ,1309
+ ,89171
+ ,61
+ ,13
+ ,15
+ ,13497
+ ,5
+ ,2820
+ ,172624
+ ,88
+ ,74
+ ,34
+ ,46154
+ ,0
+ ,757
+ ,32443
+ ,26
+ ,14
+ ,18
+ ,53249
+ ,0
+ ,1162
+ ,87927
+ ,62
+ ,31
+ ,15
+ ,10726
+ ,0
+ ,2818
+ ,241285
+ ,103
+ ,99
+ ,30
+ ,83700
+ ,0
+ ,1760
+ ,195820
+ ,72
+ ,38
+ ,25
+ ,40400
+ ,1
+ ,2315
+ ,146946
+ ,56
+ ,59
+ ,34
+ ,33797
+ ,1
+ ,1994
+ ,159763
+ ,89
+ ,54
+ ,21
+ ,36205
+ ,1
+ ,1806
+ ,207078
+ ,34
+ ,63
+ ,21
+ ,30165
+ ,0
+ ,2152
+ ,212394
+ ,166
+ ,66
+ ,25
+ ,58534
+ ,0
+ ,1457
+ ,201536
+ ,95
+ ,90
+ ,31
+ ,44663
+ ,0
+ ,3000
+ ,394662
+ ,121
+ ,72
+ ,31
+ ,92556
+ ,0
+ ,2236
+ ,217892
+ ,46
+ ,61
+ ,20
+ ,40078
+ ,0
+ ,1684
+ ,182286
+ ,44
+ ,61
+ ,28
+ ,34711
+ ,0
+ ,1626
+ ,181740
+ ,47
+ ,61
+ ,22
+ ,31076
+ ,2
+ ,2257
+ ,137978
+ ,107
+ ,53
+ ,17
+ ,74608
+ ,4
+ ,3373
+ ,255929
+ ,130
+ ,118
+ ,25
+ ,58092
+ ,0
+ ,2571
+ ,236489
+ ,55
+ ,73
+ ,25
+ ,42009
+ ,1
+ ,1
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,2142
+ ,230761
+ ,64
+ ,54
+ ,31
+ ,36022
+ ,0
+ ,1878
+ ,132807
+ ,54
+ ,54
+ ,14
+ ,23333
+ ,3
+ ,2190
+ ,157118
+ ,49
+ ,46
+ ,35
+ ,53349
+ ,9
+ ,2186
+ ,253254
+ ,68
+ ,83
+ ,34
+ ,92596
+ ,0
+ ,2532
+ ,269329
+ ,71
+ ,106
+ ,22
+ ,49598
+ ,2
+ ,1823
+ ,161273
+ ,61
+ ,44
+ ,34
+ ,44093
+ ,0
+ ,1095
+ ,107181
+ ,33
+ ,27
+ ,23
+ ,84205
+ ,2
+ ,2162
+ ,195891
+ ,79
+ ,64
+ ,24
+ ,63369
+ ,1
+ ,1365
+ ,139667
+ ,51
+ ,71
+ ,26
+ ,60132
+ ,2
+ ,1244
+ ,171101
+ ,98
+ ,44
+ ,23
+ ,37403
+ ,2
+ ,756
+ ,81407
+ ,33
+ ,23
+ ,35
+ ,24460
+ ,1
+ ,2417
+ ,247563
+ ,104
+ ,78
+ ,24
+ ,46456
+ ,0
+ ,2327
+ ,239807
+ ,90
+ ,60
+ ,31
+ ,66616
+ ,1
+ ,2786
+ ,172743
+ ,59
+ ,73
+ ,30
+ ,41554
+ ,8
+ ,658
+ ,48188
+ ,28
+ ,12
+ ,22
+ ,22346
+ ,0
+ ,2012
+ ,169355
+ ,70
+ ,104
+ ,23
+ ,30874
+ ,0
+ ,2602
+ ,315622
+ ,76
+ ,83
+ ,27
+ ,68701
+ ,0
+ ,2071
+ ,241518
+ ,79
+ ,57
+ ,30
+ ,35728
+ ,0
+ ,1911
+ ,195583
+ ,59
+ ,67
+ ,33
+ ,29010
+ ,1
+ ,1775
+ ,159913
+ ,57
+ ,44
+ ,12
+ ,23110
+ ,8
+ ,1918
+ ,220241
+ ,69
+ ,53
+ ,26
+ ,38844
+ ,0
+ ,1046
+ ,101694
+ ,25
+ ,26
+ ,26
+ ,27084
+ ,1
+ ,1190
+ ,157258
+ ,68
+ ,67
+ ,23
+ ,35139
+ ,0
+ ,2890
+ ,202536
+ ,99
+ ,36
+ ,38
+ ,57476
+ ,10
+ ,1836
+ ,173505
+ ,64
+ ,56
+ ,32
+ ,33277
+ ,6
+ ,2254
+ ,150518
+ ,83
+ ,52
+ ,21
+ ,31141
+ ,0
+ ,1392
+ ,141491
+ ,64
+ ,54
+ ,22
+ ,61281
+ ,11
+ ,1325
+ ,125612
+ ,38
+ ,57
+ ,26
+ ,25820
+ ,3
+ ,1317
+ ,166049
+ ,36
+ ,27
+ ,28
+ ,23284
+ ,0
+ ,1525
+ ,124197
+ ,42
+ ,58
+ ,33
+ ,35378
+ ,0
+ ,2335
+ ,195043
+ ,71
+ ,76
+ ,36
+ ,74990
+ ,8
+ ,2897
+ ,138708
+ ,65
+ ,93
+ ,25
+ ,29653
+ ,2
+ ,1118
+ ,116552
+ ,40
+ ,59
+ ,25
+ ,64622
+ ,0
+ ,340
+ ,31970
+ ,15
+ ,5
+ ,21
+ ,4157
+ ,0
+ ,2977
+ ,258158
+ ,115
+ ,57
+ ,19
+ ,29245
+ ,3
+ ,1449
+ ,151184
+ ,78
+ ,42
+ ,12
+ ,50008
+ ,1
+ ,1550
+ ,135926
+ ,68
+ ,88
+ ,30
+ ,52338
+ ,2
+ ,1684
+ ,119629
+ ,72
+ ,53
+ ,21
+ ,13310
+ ,1
+ ,2728
+ ,171518
+ ,71
+ ,81
+ ,39
+ ,92901
+ ,0
+ ,1574
+ ,108949
+ ,45
+ ,35
+ ,32
+ ,10956
+ ,2
+ ,2413
+ ,183471
+ ,60
+ ,102
+ ,28
+ ,34241
+ ,1
+ ,2563
+ ,159966
+ ,98
+ ,71
+ ,29
+ ,75043
+ ,0
+ ,1079
+ ,93786
+ ,34
+ ,28
+ ,21
+ ,21152
+ ,0
+ ,1235
+ ,84971
+ ,72
+ ,34
+ ,31
+ ,42249
+ ,0
+ ,980
+ ,88882
+ ,76
+ ,54
+ ,26
+ ,42005
+ ,0
+ ,2246
+ ,304603
+ ,65
+ ,49
+ ,29
+ ,41152
+ ,0
+ ,1076
+ ,75101
+ ,30
+ ,30
+ ,23
+ ,14399
+ ,1
+ ,1637
+ ,145043
+ ,40
+ ,57
+ ,25
+ ,28263
+ ,0
+ ,1208
+ ,95827
+ ,48
+ ,54
+ ,22
+ ,17215
+ ,0
+ ,1865
+ ,173924
+ ,58
+ ,38
+ ,26
+ ,48140
+ ,0
+ ,2726
+ ,241957
+ ,237
+ ,63
+ ,33
+ ,62897
+ ,0
+ ,1208
+ ,115367
+ ,115
+ ,58
+ ,24
+ ,22883
+ ,0
+ ,1419
+ ,118408
+ ,64
+ ,46
+ ,24
+ ,41622
+ ,7
+ ,1609
+ ,164078
+ ,53
+ ,46
+ ,21
+ ,40715
+ ,0
+ ,1864
+ ,158931
+ ,41
+ ,51
+ ,28
+ ,65897
+ ,5
+ ,2412
+ ,184139
+ ,82
+ ,87
+ ,28
+ ,76542
+ ,1
+ ,1238
+ ,152856
+ ,58
+ ,39
+ ,25
+ ,37477
+ ,0
+ ,1462
+ ,144014
+ ,59
+ ,28
+ ,15
+ ,53216
+ ,0
+ ,973
+ ,62535
+ ,42
+ ,26
+ ,13
+ ,40911
+ ,0
+ ,2319
+ ,245196
+ ,117
+ ,52
+ ,36
+ ,57021
+ ,0
+ ,1890
+ ,199841
+ ,71
+ ,96
+ ,27
+ ,73116
+ ,0
+ ,223
+ ,19349
+ ,12
+ ,13
+ ,1
+ ,3895
+ ,0
+ ,2526
+ ,247280
+ ,108
+ ,43
+ ,24
+ ,46609
+ ,3
+ ,2072
+ ,159408
+ ,83
+ ,42
+ ,31
+ ,29351
+ ,0
+ ,778
+ ,72128
+ ,30
+ ,30
+ ,4
+ ,2325
+ ,0
+ ,1194
+ ,104253
+ ,26
+ ,59
+ ,21
+ ,31747
+ ,0
+ ,1424
+ ,151090
+ ,57
+ ,73
+ ,27
+ ,32665
+ ,0
+ ,1327
+ ,137382
+ ,65
+ ,39
+ ,23
+ ,19249
+ ,1
+ ,839
+ ,87448
+ ,42
+ ,36
+ ,12
+ ,15292
+ ,1
+ ,596
+ ,27676
+ ,22
+ ,2
+ ,16
+ ,5842
+ ,0
+ ,1671
+ ,165507
+ ,50
+ ,102
+ ,29
+ ,33994
+ ,0
+ ,1167
+ ,132148
+ ,37
+ ,30
+ ,26
+ ,13018
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1106
+ ,95778
+ ,34
+ ,46
+ ,25
+ ,98177
+ ,0
+ ,1148
+ ,109001
+ ,67
+ ,25
+ ,21
+ ,37941
+ ,0
+ ,1485
+ ,158833
+ ,46
+ ,59
+ ,24
+ ,31032
+ ,0
+ ,1526
+ ,147690
+ ,63
+ ,60
+ ,21
+ ,32683
+ ,1
+ ,962
+ ,89887
+ ,63
+ ,36
+ ,21
+ ,34545
+ ,0
+ ,78
+ ,3616
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1184
+ ,199005
+ ,45
+ ,45
+ ,23
+ ,27525
+ ,0
+ ,1671
+ ,160930
+ ,92
+ ,79
+ ,33
+ ,66856
+ ,0
+ ,2142
+ ,177948
+ ,102
+ ,30
+ ,32
+ ,28549
+ ,2
+ ,1015
+ ,136061
+ ,39
+ ,43
+ ,23
+ ,38610
+ ,0
+ ,778
+ ,43410
+ ,19
+ ,7
+ ,1
+ ,2781
+ ,0
+ ,1856
+ ,184277
+ ,74
+ ,80
+ ,29
+ ,41211
+ ,1
+ ,1056
+ ,108858
+ ,43
+ ,32
+ ,20
+ ,22698
+ ,0
+ ,2234
+ ,141744
+ ,58
+ ,81
+ ,33
+ ,41194
+ ,8
+ ,731
+ ,60493
+ ,40
+ ,3
+ ,12
+ ,32689
+ ,3
+ ,285
+ ,19764
+ ,12
+ ,10
+ ,2
+ ,5752
+ ,1
+ ,1872
+ ,177559
+ ,56
+ ,47
+ ,21
+ ,26757
+ ,3
+ ,1181
+ ,140281
+ ,35
+ ,35
+ ,28
+ ,22527
+ ,0
+ ,1725
+ ,164249
+ ,54
+ ,54
+ ,35
+ ,44810
+ ,0
+ ,256
+ ,11796
+ ,9
+ ,1
+ ,2
+ ,0
+ ,0
+ ,98
+ ,10674
+ ,9
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1435
+ ,151322
+ ,59
+ ,46
+ ,18
+ ,100674
+ ,0
+ ,41
+ ,6836
+ ,3
+ ,0
+ ,1
+ ,0
+ ,0
+ ,1930
+ ,174712
+ ,67
+ ,51
+ ,21
+ ,57786
+ ,6
+ ,42
+ ,5118
+ ,3
+ ,5
+ ,0
+ ,0
+ ,0
+ ,528
+ ,40248
+ ,16
+ ,8
+ ,4
+ ,5444
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1121
+ ,127628
+ ,50
+ ,38
+ ,29
+ ,28470
+ ,0
+ ,1305
+ ,88837
+ ,38
+ ,21
+ ,26
+ ,61849
+ ,0
+ ,81
+ ,7131
+ ,4
+ ,0
+ ,0
+ ,0
+ ,1
+ ,262
+ ,9056
+ ,15
+ ,0
+ ,4
+ ,2179
+ ,0
+ ,1099
+ ,87957
+ ,26
+ ,18
+ ,19
+ ,8019
+ ,1
+ ,1290
+ ,144470
+ ,53
+ ,53
+ ,22
+ ,39644
+ ,0
+ ,1248
+ ,111408
+ ,20
+ ,17
+ ,22
+ ,23494
+ ,1)
+ ,dim=c(7
+ ,144)
+ ,dimnames=list(c('Pageviews'
+ ,'Time_in_RFC'
+ ,'#Logins'
+ ,'blogs'
+ ,'reviews'
+ ,'Characters'
+ ,'Shared')
+ ,1:144))
> y <- array(NA,dim=c(7,144),dimnames=list(c('Pageviews','Time_in_RFC','#Logins','blogs','reviews','Characters','Shared'),1:144))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> 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
Time_in_RFC Pageviews #Logins blogs reviews Characters Shared
1 162687 1845 95 48 21 20465 0
2 201906 1796 62 58 20 33629 1
3 7215 192 18 0 0 1423 0
4 146367 2444 97 67 27 25629 0
5 257045 3567 139 83 31 54002 0
6 524450 6917 265 136 36 151036 1
7 188294 1840 58 65 23 33287 1
8 195674 1740 60 86 30 31172 0
9 177020 2078 44 62 30 28113 0
10 325899 3097 98 71 27 57803 1
11 121844 1946 75 50 24 49830 2
12 203938 2370 72 88 30 52143 0
13 107394 1883 105 50 22 21055 0
14 220751 3198 120 79 28 47007 4
15 172905 1490 62 56 18 28735 4
16 156326 1573 88 54 22 59147 3
17 145178 1807 58 81 37 78950 0
18 89171 1309 61 13 15 13497 5
19 172624 2820 88 74 34 46154 0
20 32443 757 26 14 18 53249 0
21 87927 1162 62 31 15 10726 0
22 241285 2818 103 99 30 83700 0
23 195820 1760 72 38 25 40400 1
24 146946 2315 56 59 34 33797 1
25 159763 1994 89 54 21 36205 1
26 207078 1806 34 63 21 30165 0
27 212394 2152 166 66 25 58534 0
28 201536 1457 95 90 31 44663 0
29 394662 3000 121 72 31 92556 0
30 217892 2236 46 61 20 40078 0
31 182286 1684 44 61 28 34711 0
32 181740 1626 47 61 22 31076 2
33 137978 2257 107 53 17 74608 4
34 255929 3373 130 118 25 58092 0
35 236489 2571 55 73 25 42009 1
36 0 1 1 0 0 0 0
37 230761 2142 64 54 31 36022 0
38 132807 1878 54 54 14 23333 3
39 157118 2190 49 46 35 53349 9
40 253254 2186 68 83 34 92596 0
41 269329 2532 71 106 22 49598 2
42 161273 1823 61 44 34 44093 0
43 107181 1095 33 27 23 84205 2
44 195891 2162 79 64 24 63369 1
45 139667 1365 51 71 26 60132 2
46 171101 1244 98 44 23 37403 2
47 81407 756 33 23 35 24460 1
48 247563 2417 104 78 24 46456 0
49 239807 2327 90 60 31 66616 1
50 172743 2786 59 73 30 41554 8
51 48188 658 28 12 22 22346 0
52 169355 2012 70 104 23 30874 0
53 315622 2602 76 83 27 68701 0
54 241518 2071 79 57 30 35728 0
55 195583 1911 59 67 33 29010 1
56 159913 1775 57 44 12 23110 8
57 220241 1918 69 53 26 38844 0
58 101694 1046 25 26 26 27084 1
59 157258 1190 68 67 23 35139 0
60 202536 2890 99 36 38 57476 10
61 173505 1836 64 56 32 33277 6
62 150518 2254 83 52 21 31141 0
63 141491 1392 64 54 22 61281 11
64 125612 1325 38 57 26 25820 3
65 166049 1317 36 27 28 23284 0
66 124197 1525 42 58 33 35378 0
67 195043 2335 71 76 36 74990 8
68 138708 2897 65 93 25 29653 2
69 116552 1118 40 59 25 64622 0
70 31970 340 15 5 21 4157 0
71 258158 2977 115 57 19 29245 3
72 151184 1449 78 42 12 50008 1
73 135926 1550 68 88 30 52338 2
74 119629 1684 72 53 21 13310 1
75 171518 2728 71 81 39 92901 0
76 108949 1574 45 35 32 10956 2
77 183471 2413 60 102 28 34241 1
78 159966 2563 98 71 29 75043 0
79 93786 1079 34 28 21 21152 0
80 84971 1235 72 34 31 42249 0
81 88882 980 76 54 26 42005 0
82 304603 2246 65 49 29 41152 0
83 75101 1076 30 30 23 14399 1
84 145043 1637 40 57 25 28263 0
85 95827 1208 48 54 22 17215 0
86 173924 1865 58 38 26 48140 0
87 241957 2726 237 63 33 62897 0
88 115367 1208 115 58 24 22883 0
89 118408 1419 64 46 24 41622 7
90 164078 1609 53 46 21 40715 0
91 158931 1864 41 51 28 65897 5
92 184139 2412 82 87 28 76542 1
93 152856 1238 58 39 25 37477 0
94 144014 1462 59 28 15 53216 0
95 62535 973 42 26 13 40911 0
96 245196 2319 117 52 36 57021 0
97 199841 1890 71 96 27 73116 0
98 19349 223 12 13 1 3895 0
99 247280 2526 108 43 24 46609 3
100 159408 2072 83 42 31 29351 0
101 72128 778 30 30 4 2325 0
102 104253 1194 26 59 21 31747 0
103 151090 1424 57 73 27 32665 0
104 137382 1327 65 39 23 19249 1
105 87448 839 42 36 12 15292 1
106 27676 596 22 2 16 5842 0
107 165507 1671 50 102 29 33994 0
108 132148 1167 37 30 26 13018 1
109 0 0 0 0 0 0 0
110 95778 1106 34 46 25 98177 0
111 109001 1148 67 25 21 37941 0
112 158833 1485 46 59 24 31032 0
113 147690 1526 63 60 21 32683 1
114 89887 962 63 36 21 34545 0
115 3616 78 5 0 0 0 0
116 0 0 0 0 0 0 0
117 199005 1184 45 45 23 27525 0
118 160930 1671 92 79 33 66856 0
119 177948 2142 102 30 32 28549 2
120 136061 1015 39 43 23 38610 0
121 43410 778 19 7 1 2781 0
122 184277 1856 74 80 29 41211 1
123 108858 1056 43 32 20 22698 0
124 141744 2234 58 81 33 41194 8
125 60493 731 40 3 12 32689 3
126 19764 285 12 10 2 5752 1
127 177559 1872 56 47 21 26757 3
128 140281 1181 35 35 28 22527 0
129 164249 1725 54 54 35 44810 0
130 11796 256 9 1 2 0 0
131 10674 98 9 0 0 0 0
132 151322 1435 59 46 18 100674 0
133 6836 41 3 0 1 0 0
134 174712 1930 67 51 21 57786 6
135 5118 42 3 5 0 0 0
136 40248 528 16 8 4 5444 1
137 0 0 0 0 0 0 0
138 127628 1121 50 38 29 28470 0
139 88837 1305 38 21 26 61849 0
140 7131 81 4 0 0 0 1
141 9056 262 15 0 4 2179 0
142 87957 1099 26 18 19 8019 1
143 144470 1290 53 53 22 39644 0
144 111408 1248 20 17 22 23494 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Pageviews `#Logins` blogs reviews Characters
5684.3637 58.8282 133.8772 337.1295 655.3391 0.2386
Shared
-2669.1603
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-95576 -18035 -3196 21711 129623
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5684.3637 7487.2776 0.759 0.4490
Pageviews 58.8282 7.5912 7.750 1.86e-12 ***
`#Logins` 133.8772 134.4994 0.995 0.3213
blogs 337.1295 183.8764 1.833 0.0689 .
reviews 655.3391 442.2489 1.482 0.1407
Characters 0.2386 0.1701 1.403 0.1630
Shared -2669.1603 1375.2007 -1.941 0.0543 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34850 on 137 degrees of freedom
Multiple R-squared: 0.8224, Adjusted R-squared: 0.8147
F-statistic: 105.8 on 6 and 137 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.3021709 6.043417e-01 6.978291e-01
[2,] 0.9115200 1.769600e-01 8.847999e-02
[3,] 0.8601633 2.796733e-01 1.398367e-01
[4,] 0.7971777 4.056445e-01 2.028223e-01
[5,] 0.8388912 3.222176e-01 1.611088e-01
[6,] 0.8192219 3.615563e-01 1.807781e-01
[7,] 0.7705606 4.588788e-01 2.294394e-01
[8,] 0.7494289 5.011421e-01 2.505711e-01
[9,] 0.6760047 6.479905e-01 3.239953e-01
[10,] 0.6970804 6.058392e-01 3.029196e-01
[11,] 0.6395245 7.209510e-01 3.604755e-01
[12,] 0.5655640 8.688720e-01 4.344360e-01
[13,] 0.5269057 9.461885e-01 4.730943e-01
[14,] 0.8057859 3.884282e-01 1.942141e-01
[15,] 0.7948877 4.102246e-01 2.051123e-01
[16,] 0.7433825 5.132349e-01 2.566175e-01
[17,] 0.7144103 5.711794e-01 2.855897e-01
[18,] 0.7776571 4.446859e-01 2.223429e-01
[19,] 0.7677202 4.645597e-01 2.322798e-01
[20,] 0.9979599 4.080118e-03 2.040059e-03
[21,] 0.9972123 5.575355e-03 2.787677e-03
[22,] 0.9965310 6.937921e-03 3.468961e-03
[23,] 0.9957175 8.565067e-03 4.282534e-03
[24,] 0.9982446 3.510745e-03 1.755372e-03
[25,] 0.9988213 2.357396e-03 1.178698e-03
[26,] 0.9983062 3.387698e-03 1.693849e-03
[27,] 0.9975393 4.921331e-03 2.460666e-03
[28,] 0.9981380 3.724057e-03 1.862028e-03
[29,] 0.9974219 5.156193e-03 2.578096e-03
[30,] 0.9961528 7.694328e-03 3.847164e-03
[31,] 0.9955030 8.994094e-03 4.497047e-03
[32,] 0.9957009 8.598220e-03 4.299110e-03
[33,] 0.9937057 1.258865e-02 6.294323e-03
[34,] 0.9916128 1.677443e-02 8.387215e-03
[35,] 0.9880624 2.387514e-02 1.193757e-02
[36,] 0.9844161 3.116789e-02 1.558395e-02
[37,] 0.9884914 2.301720e-02 1.150860e-02
[38,] 0.9839290 3.214191e-02 1.607096e-02
[39,] 0.9823272 3.534557e-02 1.767279e-02
[40,] 0.9810278 3.794448e-02 1.897224e-02
[41,] 0.9806780 3.864392e-02 1.932196e-02
[42,] 0.9765725 4.685492e-02 2.342746e-02
[43,] 0.9745899 5.082026e-02 2.541013e-02
[44,] 0.9939709 1.205828e-02 6.029139e-03
[45,] 0.9968515 6.297007e-03 3.148504e-03
[46,] 0.9960627 7.874561e-03 3.937281e-03
[47,] 0.9963336 7.332781e-03 3.666391e-03
[48,] 0.9975661 4.867773e-03 2.433887e-03
[49,] 0.9964243 7.151432e-03 3.575716e-03
[50,] 0.9959025 8.195055e-03 4.097528e-03
[51,] 0.9950192 9.961611e-03 4.980805e-03
[52,] 0.9935020 1.299591e-02 6.497956e-03
[53,] 0.9934623 1.307537e-02 6.537684e-03
[54,] 0.9921520 1.569607e-02 7.848035e-03
[55,] 0.9892610 2.147807e-02 1.073904e-02
[56,] 0.9915028 1.699437e-02 8.497187e-03
[57,] 0.9903358 1.932841e-02 9.664207e-03
[58,] 0.9870754 2.584912e-02 1.292456e-02
[59,] 0.9990442 1.911651e-03 9.558254e-04
[60,] 0.9987870 2.425989e-03 1.212994e-03
[61,] 0.9982419 3.516200e-03 1.758100e-03
[62,] 0.9979790 4.041917e-03 2.020959e-03
[63,] 0.9974341 5.131788e-03 2.565894e-03
[64,] 0.9968848 6.230426e-03 3.115213e-03
[65,] 0.9966190 6.762037e-03 3.381018e-03
[66,] 0.9995247 9.506760e-04 4.753380e-04
[67,] 0.9995176 9.648070e-04 4.824035e-04
[68,] 0.9996107 7.785601e-04 3.892801e-04
[69,] 0.9999778 4.432341e-05 2.216170e-05
[70,] 0.9999643 7.134187e-05 3.567094e-05
[71,] 0.9999733 5.337287e-05 2.668643e-05
[72,] 0.9999621 7.588934e-05 3.794467e-05
[73,] 0.9999999 1.933771e-07 9.668853e-08
[74,] 0.9999999 2.125443e-07 1.062721e-07
[75,] 0.9999998 3.863390e-07 1.931695e-07
[76,] 0.9999998 4.100076e-07 2.050038e-07
[77,] 0.9999996 8.298483e-07 4.149242e-07
[78,] 0.9999994 1.150256e-06 5.751282e-07
[79,] 0.9999994 1.133515e-06 5.667574e-07
[80,] 0.9999989 2.275456e-06 1.137728e-06
[81,] 0.9999981 3.762227e-06 1.881114e-06
[82,] 0.9999968 6.333117e-06 3.166558e-06
[83,] 0.9999985 2.957682e-06 1.478841e-06
[84,] 0.9999983 3.337167e-06 1.668583e-06
[85,] 0.9999969 6.259992e-06 3.129996e-06
[86,] 0.9999976 4.888172e-06 2.444086e-06
[87,] 0.9999963 7.304605e-06 3.652302e-06
[88,] 0.9999927 1.452175e-05 7.260876e-06
[89,] 0.9999863 2.748985e-05 1.374493e-05
[90,] 0.9999906 1.886651e-05 9.433253e-06
[91,] 0.9999930 1.396790e-05 6.983949e-06
[92,] 0.9999861 2.771870e-05 1.385935e-05
[93,] 0.9999802 3.966708e-05 1.983354e-05
[94,] 0.9999621 7.573040e-05 3.786520e-05
[95,] 0.9999309 1.381407e-04 6.907033e-05
[96,] 0.9998704 2.592450e-04 1.296225e-04
[97,] 0.9998853 2.293905e-04 1.146953e-04
[98,] 0.9998653 2.694211e-04 1.347105e-04
[99,] 0.9998117 3.766132e-04 1.883066e-04
[100,] 0.9996475 7.050303e-04 3.525151e-04
[101,] 0.9995644 8.712403e-04 4.356201e-04
[102,] 0.9992003 1.599308e-03 7.996542e-04
[103,] 0.9985777 2.844506e-03 1.422253e-03
[104,] 0.9975283 4.943387e-03 2.471694e-03
[105,] 0.9964553 7.089500e-03 3.544750e-03
[106,] 0.9940347 1.193063e-02 5.965317e-03
[107,] 0.9900716 1.985682e-02 9.928411e-03
[108,] 0.9998331 3.337868e-04 1.668934e-04
[109,] 0.9998977 2.046903e-04 1.023451e-04
[110,] 0.9998735 2.530463e-04 1.265231e-04
[111,] 0.9999065 1.869955e-04 9.349775e-05
[112,] 0.9999277 1.446185e-04 7.230924e-05
[113,] 0.9998887 2.225647e-04 1.112824e-04
[114,] 0.9997445 5.109291e-04 2.554646e-04
[115,] 0.9999897 2.069489e-05 1.034744e-05
[116,] 0.9999816 3.685919e-05 1.842959e-05
[117,] 0.9999595 8.102225e-05 4.051112e-05
[118,] 0.9998884 2.231033e-04 1.115517e-04
[119,] 0.9999089 1.822239e-04 9.111195e-05
[120,] 0.9998504 2.992659e-04 1.496330e-04
[121,] 0.9994131 1.173760e-03 5.868798e-04
[122,] 0.9982252 3.549595e-03 1.774798e-03
[123,] 0.9995240 9.520681e-04 4.760340e-04
[124,] 0.9976555 4.688935e-03 2.344467e-03
[125,] 0.9880504 2.389927e-02 1.194963e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1zeko1324572921.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/20yso1324572921.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/3toy01324572921.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/4bltg1324572921.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/59mf91324572921.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
919.38976 44251.41221 -12513.66548 -62475.97699 -38269.60329 -26433.57931
7 8 9 10 11 12
24342.15342 23505.56750 -4069.38700 72151.81637 -47495.66348 -12576.29381
13 14 15 16 17 18
-59418.21448 -34652.27622 44411.87677 7597.28229 -44964.92001 -5773.07229
19 20 21 22 23 24
-68977.67482 -50475.32819 -17256.22571 -16971.90085 40794.90159 -49989.10419
25 26 27 28 29 30
-13075.66083 48399.99673 5288.55207 36107.65643 129622.84625 31275.87965
31 32 33 34 35 36
24448.54824 37050.55557 -50938.60304 -35611.34523 23846.75505 -5877.06899
37 38 39 40 41 42
43383.80872 -15525.15516 -11110.59528 37512.48323 48538.31674 -7456.70072
43 44 45 46 47 48
-6265.02955 2689.79223 -3128.72455 45622.52738 -7026.83730 32659.86439
49 50 51 52 53 54
31412.95980 -37566.82852 -23748.25424 -21563.32573 84625.26554 56023.54559
55 56 57 58 59 60
21113.24687 35319.49311 48312.47631 1531.63116 26420.41803 -10476.36895
61 62 63 64 65 66
19469.50382 -37599.43850 27467.37901 2485.04484 45061.19614 -26443.46011
67 68 69 70 71 72
-3262.53975 -95576.49529 -11949.18398 -12163.65746 31308.58958 18529.78261
73 74 75 76 77 78
-26521.88759 -26897.52399 -79185.22158 -25401.35608 -30435.23666 -70459.95278
79 80 81 82 83 84
-8174.04131 -44863.12551 -29894.12982 112746.19528 -23851.67253 -4641.09956
85 86 87 88 89 90
-24077.55852 9425.09058 -13693.35986 -17518.81413 -1803.95811 17659.62831
91 92 93 94 95 96
182.74907 -37689.07232 28104.57646 12457.94247 -33057.46648 32698.28753
97 98 99 100 101 102
5963.28185 -7027.87541 45199.59345 -20757.74346 3369.05811 -16380.06574
103 104 105 106 107 108
3905.39657 14786.46201 5803.97635 -28568.73856 -6675.53097 25268.28990
109 110 111 112 113 114
-5684.36365 -34836.95935 -4430.31661 16607.96281 4681.24311 -14964.96345
115 116 117 118 119 120
-7326.34687 -5684.36365 80832.98230 -19583.07192 40.49702 26663.77043
121 122 123 124 125 126
-14265.09242 6362.35858 5984.08378 -40535.96349 -2216.86625 -7678.06149
127 128 129 130 131 132
26267.68337 24911.27651 -1976.09748 -11801.07766 -1980.41896 1997.27425
133 134 135 136 137 138
-2317.28925 17791.96550 -5124.42562 -2587.75145 -5684.36365 10695.18194
139 140 141 142 143 144
-37580.12642 -1184.79394 -17190.73115 -3624.14132 14058.09243 6543.76134
> postscript(file="/var/wessaorg/rcomp/tmp/64zsh1324572921.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 919.38976 NA
1 44251.41221 919.38976
2 -12513.66548 44251.41221
3 -62475.97699 -12513.66548
4 -38269.60329 -62475.97699
5 -26433.57931 -38269.60329
6 24342.15342 -26433.57931
7 23505.56750 24342.15342
8 -4069.38700 23505.56750
9 72151.81637 -4069.38700
10 -47495.66348 72151.81637
11 -12576.29381 -47495.66348
12 -59418.21448 -12576.29381
13 -34652.27622 -59418.21448
14 44411.87677 -34652.27622
15 7597.28229 44411.87677
16 -44964.92001 7597.28229
17 -5773.07229 -44964.92001
18 -68977.67482 -5773.07229
19 -50475.32819 -68977.67482
20 -17256.22571 -50475.32819
21 -16971.90085 -17256.22571
22 40794.90159 -16971.90085
23 -49989.10419 40794.90159
24 -13075.66083 -49989.10419
25 48399.99673 -13075.66083
26 5288.55207 48399.99673
27 36107.65643 5288.55207
28 129622.84625 36107.65643
29 31275.87965 129622.84625
30 24448.54824 31275.87965
31 37050.55557 24448.54824
32 -50938.60304 37050.55557
33 -35611.34523 -50938.60304
34 23846.75505 -35611.34523
35 -5877.06899 23846.75505
36 43383.80872 -5877.06899
37 -15525.15516 43383.80872
38 -11110.59528 -15525.15516
39 37512.48323 -11110.59528
40 48538.31674 37512.48323
41 -7456.70072 48538.31674
42 -6265.02955 -7456.70072
43 2689.79223 -6265.02955
44 -3128.72455 2689.79223
45 45622.52738 -3128.72455
46 -7026.83730 45622.52738
47 32659.86439 -7026.83730
48 31412.95980 32659.86439
49 -37566.82852 31412.95980
50 -23748.25424 -37566.82852
51 -21563.32573 -23748.25424
52 84625.26554 -21563.32573
53 56023.54559 84625.26554
54 21113.24687 56023.54559
55 35319.49311 21113.24687
56 48312.47631 35319.49311
57 1531.63116 48312.47631
58 26420.41803 1531.63116
59 -10476.36895 26420.41803
60 19469.50382 -10476.36895
61 -37599.43850 19469.50382
62 27467.37901 -37599.43850
63 2485.04484 27467.37901
64 45061.19614 2485.04484
65 -26443.46011 45061.19614
66 -3262.53975 -26443.46011
67 -95576.49529 -3262.53975
68 -11949.18398 -95576.49529
69 -12163.65746 -11949.18398
70 31308.58958 -12163.65746
71 18529.78261 31308.58958
72 -26521.88759 18529.78261
73 -26897.52399 -26521.88759
74 -79185.22158 -26897.52399
75 -25401.35608 -79185.22158
76 -30435.23666 -25401.35608
77 -70459.95278 -30435.23666
78 -8174.04131 -70459.95278
79 -44863.12551 -8174.04131
80 -29894.12982 -44863.12551
81 112746.19528 -29894.12982
82 -23851.67253 112746.19528
83 -4641.09956 -23851.67253
84 -24077.55852 -4641.09956
85 9425.09058 -24077.55852
86 -13693.35986 9425.09058
87 -17518.81413 -13693.35986
88 -1803.95811 -17518.81413
89 17659.62831 -1803.95811
90 182.74907 17659.62831
91 -37689.07232 182.74907
92 28104.57646 -37689.07232
93 12457.94247 28104.57646
94 -33057.46648 12457.94247
95 32698.28753 -33057.46648
96 5963.28185 32698.28753
97 -7027.87541 5963.28185
98 45199.59345 -7027.87541
99 -20757.74346 45199.59345
100 3369.05811 -20757.74346
101 -16380.06574 3369.05811
102 3905.39657 -16380.06574
103 14786.46201 3905.39657
104 5803.97635 14786.46201
105 -28568.73856 5803.97635
106 -6675.53097 -28568.73856
107 25268.28990 -6675.53097
108 -5684.36365 25268.28990
109 -34836.95935 -5684.36365
110 -4430.31661 -34836.95935
111 16607.96281 -4430.31661
112 4681.24311 16607.96281
113 -14964.96345 4681.24311
114 -7326.34687 -14964.96345
115 -5684.36365 -7326.34687
116 80832.98230 -5684.36365
117 -19583.07192 80832.98230
118 40.49702 -19583.07192
119 26663.77043 40.49702
120 -14265.09242 26663.77043
121 6362.35858 -14265.09242
122 5984.08378 6362.35858
123 -40535.96349 5984.08378
124 -2216.86625 -40535.96349
125 -7678.06149 -2216.86625
126 26267.68337 -7678.06149
127 24911.27651 26267.68337
128 -1976.09748 24911.27651
129 -11801.07766 -1976.09748
130 -1980.41896 -11801.07766
131 1997.27425 -1980.41896
132 -2317.28925 1997.27425
133 17791.96550 -2317.28925
134 -5124.42562 17791.96550
135 -2587.75145 -5124.42562
136 -5684.36365 -2587.75145
137 10695.18194 -5684.36365
138 -37580.12642 10695.18194
139 -1184.79394 -37580.12642
140 -17190.73115 -1184.79394
141 -3624.14132 -17190.73115
142 14058.09243 -3624.14132
143 6543.76134 14058.09243
144 NA 6543.76134
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 44251.41221 919.38976
[2,] -12513.66548 44251.41221
[3,] -62475.97699 -12513.66548
[4,] -38269.60329 -62475.97699
[5,] -26433.57931 -38269.60329
[6,] 24342.15342 -26433.57931
[7,] 23505.56750 24342.15342
[8,] -4069.38700 23505.56750
[9,] 72151.81637 -4069.38700
[10,] -47495.66348 72151.81637
[11,] -12576.29381 -47495.66348
[12,] -59418.21448 -12576.29381
[13,] -34652.27622 -59418.21448
[14,] 44411.87677 -34652.27622
[15,] 7597.28229 44411.87677
[16,] -44964.92001 7597.28229
[17,] -5773.07229 -44964.92001
[18,] -68977.67482 -5773.07229
[19,] -50475.32819 -68977.67482
[20,] -17256.22571 -50475.32819
[21,] -16971.90085 -17256.22571
[22,] 40794.90159 -16971.90085
[23,] -49989.10419 40794.90159
[24,] -13075.66083 -49989.10419
[25,] 48399.99673 -13075.66083
[26,] 5288.55207 48399.99673
[27,] 36107.65643 5288.55207
[28,] 129622.84625 36107.65643
[29,] 31275.87965 129622.84625
[30,] 24448.54824 31275.87965
[31,] 37050.55557 24448.54824
[32,] -50938.60304 37050.55557
[33,] -35611.34523 -50938.60304
[34,] 23846.75505 -35611.34523
[35,] -5877.06899 23846.75505
[36,] 43383.80872 -5877.06899
[37,] -15525.15516 43383.80872
[38,] -11110.59528 -15525.15516
[39,] 37512.48323 -11110.59528
[40,] 48538.31674 37512.48323
[41,] -7456.70072 48538.31674
[42,] -6265.02955 -7456.70072
[43,] 2689.79223 -6265.02955
[44,] -3128.72455 2689.79223
[45,] 45622.52738 -3128.72455
[46,] -7026.83730 45622.52738
[47,] 32659.86439 -7026.83730
[48,] 31412.95980 32659.86439
[49,] -37566.82852 31412.95980
[50,] -23748.25424 -37566.82852
[51,] -21563.32573 -23748.25424
[52,] 84625.26554 -21563.32573
[53,] 56023.54559 84625.26554
[54,] 21113.24687 56023.54559
[55,] 35319.49311 21113.24687
[56,] 48312.47631 35319.49311
[57,] 1531.63116 48312.47631
[58,] 26420.41803 1531.63116
[59,] -10476.36895 26420.41803
[60,] 19469.50382 -10476.36895
[61,] -37599.43850 19469.50382
[62,] 27467.37901 -37599.43850
[63,] 2485.04484 27467.37901
[64,] 45061.19614 2485.04484
[65,] -26443.46011 45061.19614
[66,] -3262.53975 -26443.46011
[67,] -95576.49529 -3262.53975
[68,] -11949.18398 -95576.49529
[69,] -12163.65746 -11949.18398
[70,] 31308.58958 -12163.65746
[71,] 18529.78261 31308.58958
[72,] -26521.88759 18529.78261
[73,] -26897.52399 -26521.88759
[74,] -79185.22158 -26897.52399
[75,] -25401.35608 -79185.22158
[76,] -30435.23666 -25401.35608
[77,] -70459.95278 -30435.23666
[78,] -8174.04131 -70459.95278
[79,] -44863.12551 -8174.04131
[80,] -29894.12982 -44863.12551
[81,] 112746.19528 -29894.12982
[82,] -23851.67253 112746.19528
[83,] -4641.09956 -23851.67253
[84,] -24077.55852 -4641.09956
[85,] 9425.09058 -24077.55852
[86,] -13693.35986 9425.09058
[87,] -17518.81413 -13693.35986
[88,] -1803.95811 -17518.81413
[89,] 17659.62831 -1803.95811
[90,] 182.74907 17659.62831
[91,] -37689.07232 182.74907
[92,] 28104.57646 -37689.07232
[93,] 12457.94247 28104.57646
[94,] -33057.46648 12457.94247
[95,] 32698.28753 -33057.46648
[96,] 5963.28185 32698.28753
[97,] -7027.87541 5963.28185
[98,] 45199.59345 -7027.87541
[99,] -20757.74346 45199.59345
[100,] 3369.05811 -20757.74346
[101,] -16380.06574 3369.05811
[102,] 3905.39657 -16380.06574
[103,] 14786.46201 3905.39657
[104,] 5803.97635 14786.46201
[105,] -28568.73856 5803.97635
[106,] -6675.53097 -28568.73856
[107,] 25268.28990 -6675.53097
[108,] -5684.36365 25268.28990
[109,] -34836.95935 -5684.36365
[110,] -4430.31661 -34836.95935
[111,] 16607.96281 -4430.31661
[112,] 4681.24311 16607.96281
[113,] -14964.96345 4681.24311
[114,] -7326.34687 -14964.96345
[115,] -5684.36365 -7326.34687
[116,] 80832.98230 -5684.36365
[117,] -19583.07192 80832.98230
[118,] 40.49702 -19583.07192
[119,] 26663.77043 40.49702
[120,] -14265.09242 26663.77043
[121,] 6362.35858 -14265.09242
[122,] 5984.08378 6362.35858
[123,] -40535.96349 5984.08378
[124,] -2216.86625 -40535.96349
[125,] -7678.06149 -2216.86625
[126,] 26267.68337 -7678.06149
[127,] 24911.27651 26267.68337
[128,] -1976.09748 24911.27651
[129,] -11801.07766 -1976.09748
[130,] -1980.41896 -11801.07766
[131,] 1997.27425 -1980.41896
[132,] -2317.28925 1997.27425
[133,] 17791.96550 -2317.28925
[134,] -5124.42562 17791.96550
[135,] -2587.75145 -5124.42562
[136,] -5684.36365 -2587.75145
[137,] 10695.18194 -5684.36365
[138,] -37580.12642 10695.18194
[139,] -1184.79394 -37580.12642
[140,] -17190.73115 -1184.79394
[141,] -3624.14132 -17190.73115
[142,] 14058.09243 -3624.14132
[143,] 6543.76134 14058.09243
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 44251.41221 919.38976
2 -12513.66548 44251.41221
3 -62475.97699 -12513.66548
4 -38269.60329 -62475.97699
5 -26433.57931 -38269.60329
6 24342.15342 -26433.57931
7 23505.56750 24342.15342
8 -4069.38700 23505.56750
9 72151.81637 -4069.38700
10 -47495.66348 72151.81637
11 -12576.29381 -47495.66348
12 -59418.21448 -12576.29381
13 -34652.27622 -59418.21448
14 44411.87677 -34652.27622
15 7597.28229 44411.87677
16 -44964.92001 7597.28229
17 -5773.07229 -44964.92001
18 -68977.67482 -5773.07229
19 -50475.32819 -68977.67482
20 -17256.22571 -50475.32819
21 -16971.90085 -17256.22571
22 40794.90159 -16971.90085
23 -49989.10419 40794.90159
24 -13075.66083 -49989.10419
25 48399.99673 -13075.66083
26 5288.55207 48399.99673
27 36107.65643 5288.55207
28 129622.84625 36107.65643
29 31275.87965 129622.84625
30 24448.54824 31275.87965
31 37050.55557 24448.54824
32 -50938.60304 37050.55557
33 -35611.34523 -50938.60304
34 23846.75505 -35611.34523
35 -5877.06899 23846.75505
36 43383.80872 -5877.06899
37 -15525.15516 43383.80872
38 -11110.59528 -15525.15516
39 37512.48323 -11110.59528
40 48538.31674 37512.48323
41 -7456.70072 48538.31674
42 -6265.02955 -7456.70072
43 2689.79223 -6265.02955
44 -3128.72455 2689.79223
45 45622.52738 -3128.72455
46 -7026.83730 45622.52738
47 32659.86439 -7026.83730
48 31412.95980 32659.86439
49 -37566.82852 31412.95980
50 -23748.25424 -37566.82852
51 -21563.32573 -23748.25424
52 84625.26554 -21563.32573
53 56023.54559 84625.26554
54 21113.24687 56023.54559
55 35319.49311 21113.24687
56 48312.47631 35319.49311
57 1531.63116 48312.47631
58 26420.41803 1531.63116
59 -10476.36895 26420.41803
60 19469.50382 -10476.36895
61 -37599.43850 19469.50382
62 27467.37901 -37599.43850
63 2485.04484 27467.37901
64 45061.19614 2485.04484
65 -26443.46011 45061.19614
66 -3262.53975 -26443.46011
67 -95576.49529 -3262.53975
68 -11949.18398 -95576.49529
69 -12163.65746 -11949.18398
70 31308.58958 -12163.65746
71 18529.78261 31308.58958
72 -26521.88759 18529.78261
73 -26897.52399 -26521.88759
74 -79185.22158 -26897.52399
75 -25401.35608 -79185.22158
76 -30435.23666 -25401.35608
77 -70459.95278 -30435.23666
78 -8174.04131 -70459.95278
79 -44863.12551 -8174.04131
80 -29894.12982 -44863.12551
81 112746.19528 -29894.12982
82 -23851.67253 112746.19528
83 -4641.09956 -23851.67253
84 -24077.55852 -4641.09956
85 9425.09058 -24077.55852
86 -13693.35986 9425.09058
87 -17518.81413 -13693.35986
88 -1803.95811 -17518.81413
89 17659.62831 -1803.95811
90 182.74907 17659.62831
91 -37689.07232 182.74907
92 28104.57646 -37689.07232
93 12457.94247 28104.57646
94 -33057.46648 12457.94247
95 32698.28753 -33057.46648
96 5963.28185 32698.28753
97 -7027.87541 5963.28185
98 45199.59345 -7027.87541
99 -20757.74346 45199.59345
100 3369.05811 -20757.74346
101 -16380.06574 3369.05811
102 3905.39657 -16380.06574
103 14786.46201 3905.39657
104 5803.97635 14786.46201
105 -28568.73856 5803.97635
106 -6675.53097 -28568.73856
107 25268.28990 -6675.53097
108 -5684.36365 25268.28990
109 -34836.95935 -5684.36365
110 -4430.31661 -34836.95935
111 16607.96281 -4430.31661
112 4681.24311 16607.96281
113 -14964.96345 4681.24311
114 -7326.34687 -14964.96345
115 -5684.36365 -7326.34687
116 80832.98230 -5684.36365
117 -19583.07192 80832.98230
118 40.49702 -19583.07192
119 26663.77043 40.49702
120 -14265.09242 26663.77043
121 6362.35858 -14265.09242
122 5984.08378 6362.35858
123 -40535.96349 5984.08378
124 -2216.86625 -40535.96349
125 -7678.06149 -2216.86625
126 26267.68337 -7678.06149
127 24911.27651 26267.68337
128 -1976.09748 24911.27651
129 -11801.07766 -1976.09748
130 -1980.41896 -11801.07766
131 1997.27425 -1980.41896
132 -2317.28925 1997.27425
133 17791.96550 -2317.28925
134 -5124.42562 17791.96550
135 -2587.75145 -5124.42562
136 -5684.36365 -2587.75145
137 10695.18194 -5684.36365
138 -37580.12642 10695.18194
139 -1184.79394 -37580.12642
140 -17190.73115 -1184.79394
141 -3624.14132 -17190.73115
142 14058.09243 -3624.14132
143 6543.76134 14058.09243
> 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/7t8lh1324572921.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/8sbcr1324572921.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/9qwgq1324572921.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/10v8fo1324572921.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/11xdp81324572921.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/12yip81324572921.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/1355h91324572921.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/144ary1324572921.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/15jcfb1324572921.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/16or3e1324572921.tab")
+ }
>
> try(system("convert tmp/1zeko1324572921.ps tmp/1zeko1324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/20yso1324572921.ps tmp/20yso1324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/3toy01324572921.ps tmp/3toy01324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/4bltg1324572921.ps tmp/4bltg1324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/59mf91324572921.ps tmp/59mf91324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/64zsh1324572921.ps tmp/64zsh1324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/7t8lh1324572921.ps tmp/7t8lh1324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/8sbcr1324572921.ps tmp/8sbcr1324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qwgq1324572921.ps tmp/9qwgq1324572921.png",intern=TRUE))
character(0)
> try(system("convert tmp/10v8fo1324572921.ps tmp/10v8fo1324572921.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.870 0.745 5.628