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(0
+ ,26
+ ,41.41
+ ,43
+ ,100
+ ,93
+ ,-1
+ ,30
+ ,64.16
+ ,102
+ ,116
+ ,115
+ ,1
+ ,14
+ ,29.56
+ ,33
+ ,46
+ ,37
+ ,-4
+ ,35
+ ,41.42
+ ,56
+ ,128
+ ,95
+ ,2
+ ,28
+ ,42.46
+ ,59
+ ,97
+ ,90
+ ,-4
+ ,39
+ ,50.88
+ ,91
+ ,149
+ ,138
+ ,2
+ ,27
+ ,39.79
+ ,67
+ ,105
+ ,104
+ ,-4
+ ,29
+ ,36.27
+ ,67
+ ,109
+ ,107
+ ,-3
+ ,31
+ ,88.17
+ ,116
+ ,117
+ ,82
+ ,2
+ ,38
+ ,35.67
+ ,32
+ ,145
+ ,120
+ ,2
+ ,37
+ ,90.17
+ ,113
+ ,136
+ ,133
+ ,-2
+ ,31
+ ,54.40
+ ,111
+ ,116
+ ,98
+ ,0
+ ,39
+ ,70.69
+ ,120
+ ,150
+ ,117
+ ,-2
+ ,12
+ ,32.95
+ ,54
+ ,48
+ ,43
+ ,-3
+ ,17
+ ,27.25
+ ,55
+ ,66
+ ,47
+ ,0
+ ,17
+ ,23.36
+ ,17
+ ,66
+ ,63
+ ,0
+ ,47
+ ,90.22
+ ,158
+ ,181
+ ,168
+ ,0
+ ,34
+ ,48.53
+ ,123
+ ,129
+ ,120
+ ,-1
+ ,33
+ ,62.12
+ ,105
+ ,125
+ ,120
+ ,3
+ ,36
+ ,90.31
+ ,84
+ ,136
+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,100.64
+ ,76
+ ,125
+ ,110
+ ,2
+ ,33
+ ,42.31
+ ,62
+ ,122
+ ,98
+ ,3
+ ,20
+ ,31.28
+ ,46
+ ,78
+ ,73
+ ,0
+ ,42
+ ,67.64
+ ,133
+ ,155
+ ,110
+ ,3
+ ,36
+ ,36.80
+ ,71
+ ,136
+ ,98
+ ,6
+ ,30
+ ,50.45
+ ,47
+ ,110
+ ,73
+ ,3
+ ,39
+ ,77.21
+ ,115
+ ,149
+ ,133
+ ,5
+ ,28
+ ,64.81
+ ,92
+ ,107
+ ,102
+ ,2
+ ,40
+ ,50.61
+ ,77
+ ,155
+ ,138
+ ,3
+ ,43
+ ,47.92
+ ,46
+ ,165
+ ,139
+ ,5
+ ,40
+ ,97.67
+ ,95
+ ,150
+ ,141
+ ,3
+ ,32
+ ,55.41
+ ,87
+ ,118
+ ,105)
+ ,dim=c(6
+ ,85)
+ ,dimnames=list(c('totaal'
+ ,'compendiumsreviewed'
+ ,'timeinhours'
+ ,'bloggedcomputations'
+ ,'feedbackmessagesp1'
+ ,'feedbackmessagesp120')
+ ,1:85))
> y <- array(NA,dim=c(6,85),dimnames=list(c('totaal','compendiumsreviewed','timeinhours','bloggedcomputations','feedbackmessagesp1','feedbackmessagesp120'),1:85))
> 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
totaal compendiumsreviewed timeinhours bloggedcomputations
1 0 26 41.41 43
2 -1 30 64.16 102
3 1 14 29.56 33
4 -4 35 41.42 56
5 2 28 42.46 59
6 -4 39 50.88 91
7 2 27 39.79 67
8 -4 29 36.27 67
9 -3 31 88.17 116
10 2 38 35.67 32
11 2 37 90.17 113
12 -2 31 54.40 111
13 0 39 70.69 120
14 -2 12 32.95 54
15 -3 17 27.25 55
16 0 17 23.36 17
17 0 47 90.22 158
18 0 34 48.53 123
19 -1 33 62.12 105
20 3 36 90.31 84
21 -2 32 73.82 96
22 2 29 60.82 76
23 0 21 94.88 94
24 -3 29 54.60 41
25 2 35 53.71 100
26 3 37 41.24 135
27 -1 29 67.52 58
28 -3 28 45.21 68
29 -3 20 37.04 56
30 0 22 28.20 59
31 0 33 67.99 98
32 2 31 63.68 63
33 -2 18 25.69 25
34 -3 37 75.52 109
35 3 32 26.45 37
36 4 30 49.81 108
37 -4 44 48.15 86
38 4 40 71.91 104
39 -3 30 74.90 106
40 -2 28 57.27 75
41 0 38 86.52 128
42 -2 32 57.55 56
43 2 40 54.16 66
44 4 33 76.54 116
45 -4 40 51.25 64
46 0 15 15.04 37
47 2 30 58.59 79
48 4 34 39.93 105
49 2 33 50.58 124
50 -1 24 27.18 25
51 0 17 30.12 22
52 1 12 16.50 29
53 0 31 65.77 77
54 2 44 67.79 101
55 0 21 23.77 37
56 3 30 27.99 83
57 0 32 42.35 106
58 1 13 18.19 16
59 2 20 21.20 29
60 -2 17 8.61 5
61 -4 22 41.83 27
62 4 33 81.78 107
63 0 17 26.82 42
64 0 28 46.52 69
65 1 41 62.52 93
66 0 39 62.31 131
67 0 17 27.26 15
68 2 17 33.85 37
69 1 17 8.83 0
70 0 38 65.89 78
71 4 30 36.98 44
72 1 30 95.64 80
73 3 31 48.45 73
74 2 34 100.64 76
75 2 33 42.31 62
76 3 20 31.28 46
77 0 42 67.64 133
78 3 36 36.80 71
79 6 30 50.45 47
80 3 39 77.21 115
81 5 28 64.81 92
82 2 40 50.61 77
83 3 43 47.92 46
84 5 40 97.67 95
85 3 32 55.41 87
feedbackmessagesp1 feedbackmessagesp120
1 100 93
2 116 115
3 46 37
4 128 95
5 97 90
6 149 138
7 105 104
8 109 107
9 117 82
10 145 120
11 136 133
12 116 98
13 150 117
14 48 43
15 66 47
16 66 63
17 181 168
18 129 120
19 125 120
20 136 126
21 124 120
22 108 96
23 80 78
24 111 99
25 87 71
26 141 129
27 112 104
28 108 107
29 78 56
30 88 87
31 124 115
32 120 119
33 71 55
34 147 86
35 111 48
36 116 103
37 166 148
38 139 124
39 115 93
40 107 99
41 146 129
42 123 114
43 155 151
44 127 115
45 151 140
46 55 30
47 115 94
48 132 120
49 124 118
50 87 66
51 68 65
52 41 24
53 116 71
54 166 164
55 78 36
56 119 93
57 123 83
58 51 46
59 76 68
60 68 41
61 83 71
62 127 124
63 54 38
64 104 72
65 158 139
66 144 132
67 68 48
68 64 52
69 66 47
70 140 123
71 99 90
72 108 108
73 118 114
74 125 110
75 122 98
76 78 73
77 155 110
78 136 98
79 110 73
80 149 133
81 107 102
82 155 138
83 165 139
84 150 141
85 118 105
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) compendiumsreviewed timeinhours
-0.6044925 0.3106862 -0.0002217
bloggedcomputations feedbackmessagesp1 feedbackmessagesp120
-0.0006316 -0.0883012 0.0189472
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.1469 -1.5734 0.1163 1.7204 5.6548
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.6044925 1.0138175 -0.596 0.5527
compendiumsreviewed 0.3106862 0.1677295 1.852 0.0677 .
timeinhours -0.0002217 0.0185430 -0.012 0.9905
bloggedcomputations -0.0006316 0.0125830 -0.050 0.9601
feedbackmessagesp1 -0.0883012 0.0492087 -1.794 0.0766 .
feedbackmessagesp120 0.0189472 0.0212546 0.891 0.3754
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.458 on 79 degrees of freedom
Multiple R-squared: 0.06285, Adjusted R-squared: 0.003537
F-statistic: 1.06 on 5 and 79 DF, p-value: 0.3891
> 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.6551503 0.68969948 0.344849741
[2,] 0.6407445 0.71851109 0.359255546
[3,] 0.5160068 0.96798633 0.483993164
[4,] 0.6195469 0.76090613 0.380453063
[5,] 0.7290449 0.54191018 0.270955088
[6,] 0.6516091 0.69678187 0.348390937
[7,] 0.5715459 0.85690821 0.428454105
[8,] 0.4733059 0.94661185 0.526694077
[9,] 0.4153402 0.83068033 0.584659837
[10,] 0.4160093 0.83201852 0.583990741
[11,] 0.3493854 0.69877072 0.650614641
[12,] 0.2902172 0.58043446 0.709782770
[13,] 0.3096321 0.61926411 0.690367945
[14,] 0.2804700 0.56093994 0.719530031
[15,] 0.2289081 0.45781617 0.771091915
[16,] 0.3016651 0.60333024 0.698334882
[17,] 0.2800275 0.56005502 0.719972489
[18,] 0.4047494 0.80949881 0.595250597
[19,] 0.3463186 0.69263717 0.653681417
[20,] 0.4054336 0.81086714 0.594566431
[21,] 0.3822280 0.76445602 0.617771989
[22,] 0.3269438 0.65388753 0.673056236
[23,] 0.2757831 0.55156622 0.724216888
[24,] 0.2453680 0.49073606 0.754631972
[25,] 0.2077327 0.41546539 0.792267304
[26,] 0.1882636 0.37652729 0.811736357
[27,] 0.3069309 0.61386181 0.693069096
[28,] 0.4351615 0.87032305 0.564838474
[29,] 0.6372728 0.72545430 0.362727152
[30,] 0.6405290 0.71894199 0.359470997
[31,] 0.7135044 0.57299119 0.286495594
[32,] 0.7395752 0.52084956 0.260424782
[33,] 0.7235049 0.55299020 0.276495101
[34,] 0.7532038 0.49359245 0.246796226
[35,] 0.7205006 0.55899876 0.279499381
[36,] 0.7631989 0.47360213 0.236801064
[37,] 0.9361239 0.12775222 0.063876111
[38,] 0.9153126 0.16937489 0.084687447
[39,] 0.9021089 0.19578215 0.097891075
[40,] 0.9194919 0.16101619 0.080508095
[41,] 0.8945606 0.21087888 0.105439440
[42,] 0.8813833 0.23723332 0.118616661
[43,] 0.8557533 0.28849348 0.144246741
[44,] 0.8202678 0.35946439 0.179732195
[45,] 0.7774610 0.44507793 0.222538964
[46,] 0.7475880 0.50482408 0.252412039
[47,] 0.6910197 0.61796053 0.308980263
[48,] 0.6962077 0.60758455 0.303792273
[49,] 0.6320791 0.73584177 0.367920883
[50,] 0.5708427 0.85831458 0.429157292
[51,] 0.5210345 0.95793102 0.478965508
[52,] 0.5060829 0.98783427 0.493917135
[53,] 0.8454034 0.30919329 0.154596643
[54,] 0.8462425 0.30751505 0.153757526
[55,] 0.8188089 0.36238227 0.181191133
[56,] 0.7932447 0.41351060 0.206755298
[57,] 0.7489181 0.50216373 0.251081863
[58,] 0.7498772 0.50024563 0.250122813
[59,] 0.7486278 0.50274448 0.251372239
[60,] 0.6892778 0.62144430 0.310722152
[61,] 0.7613197 0.47736052 0.238680262
[62,] 0.7958963 0.40820749 0.204103745
[63,] 0.7984580 0.40308396 0.201541982
[64,] 0.8004197 0.39916055 0.199580274
[65,] 0.7076085 0.58478292 0.292391460
[66,] 0.9545309 0.09093819 0.045469097
[67,] 0.9102851 0.17942983 0.089714914
[68,] 0.9913354 0.01732923 0.008664617
> postscript(file="/var/www/rcomp/tmp/1q8ex1323520589.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/2fumf1323520589.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/37uio1323520589.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/41tfg1323520589.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/5rep21323520589.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 = 85
Frequency = 1
1 2 3 4 5 6
-0.36897202 -1.57342675 0.64309414 -4.72239450 0.81193173 -4.90133893
7 8 9 10 11 12
1.56822784 -4.75756163 -3.15638845 1.35655529 0.68946038 -2.55849070
13 14 15 16 17 18
-0.39243816 -1.65859914 -2.69902883 -0.02704664 -1.07856469 -0.75319376
19 20 21 22 23 24
-1.80406765 2.11449183 -2.58477265 1.37368415 -0.25329073 -3.44173848
25 26 27 28 29 30
-1.85749760 2.20980045 -1.43457130 -3.53256276 -2.73919476 -0.06498285
31 32 33 34 35 36
-0.80075247 1.36856494 -1.73907983 -2.45448332 2.58374103 3.65454700
37 38 39 40 41 42
-5.14688391 2.18309698 -3.23998213 -2.46219123 -0.65376028 -2.58826198
43 44 45 46 47 48
1.05640655 3.47741567 -5.09028780 0.25905603 1.72040126 3.49843440
49 50 51 52 53 54
1.15496676 -1.39846571 0.11631836 1.06385141 -0.06586955 0.56378995
55 56 57 58 59 60
0.31412009 3.08829447 0.02730960 1.21150365 1.83627137 -1.44445586
61 62 63 64 65 66
-4.22052256 3.30236866 -0.59642495 -0.22169422 0.25689688 -1.20136401
67 68 69 70 71 72
0.43336518 2.01972770 1.26214942 -1.10603843 2.35647293 -0.15412087
73 74 75 76 77 78
2.28963717 1.06494341 1.31631575 2.93111004 -0.74282588 2.62493701
79 80 81 82 83 84
5.65477018 2.21439349 4.49337612 1.30888021 2.22071118 3.83233615
85
2.15986118
> postscript(file="/var/www/rcomp/tmp/60v0v1323520589.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 = 85
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.36897202 NA
1 -1.57342675 -0.36897202
2 0.64309414 -1.57342675
3 -4.72239450 0.64309414
4 0.81193173 -4.72239450
5 -4.90133893 0.81193173
6 1.56822784 -4.90133893
7 -4.75756163 1.56822784
8 -3.15638845 -4.75756163
9 1.35655529 -3.15638845
10 0.68946038 1.35655529
11 -2.55849070 0.68946038
12 -0.39243816 -2.55849070
13 -1.65859914 -0.39243816
14 -2.69902883 -1.65859914
15 -0.02704664 -2.69902883
16 -1.07856469 -0.02704664
17 -0.75319376 -1.07856469
18 -1.80406765 -0.75319376
19 2.11449183 -1.80406765
20 -2.58477265 2.11449183
21 1.37368415 -2.58477265
22 -0.25329073 1.37368415
23 -3.44173848 -0.25329073
24 -1.85749760 -3.44173848
25 2.20980045 -1.85749760
26 -1.43457130 2.20980045
27 -3.53256276 -1.43457130
28 -2.73919476 -3.53256276
29 -0.06498285 -2.73919476
30 -0.80075247 -0.06498285
31 1.36856494 -0.80075247
32 -1.73907983 1.36856494
33 -2.45448332 -1.73907983
34 2.58374103 -2.45448332
35 3.65454700 2.58374103
36 -5.14688391 3.65454700
37 2.18309698 -5.14688391
38 -3.23998213 2.18309698
39 -2.46219123 -3.23998213
40 -0.65376028 -2.46219123
41 -2.58826198 -0.65376028
42 1.05640655 -2.58826198
43 3.47741567 1.05640655
44 -5.09028780 3.47741567
45 0.25905603 -5.09028780
46 1.72040126 0.25905603
47 3.49843440 1.72040126
48 1.15496676 3.49843440
49 -1.39846571 1.15496676
50 0.11631836 -1.39846571
51 1.06385141 0.11631836
52 -0.06586955 1.06385141
53 0.56378995 -0.06586955
54 0.31412009 0.56378995
55 3.08829447 0.31412009
56 0.02730960 3.08829447
57 1.21150365 0.02730960
58 1.83627137 1.21150365
59 -1.44445586 1.83627137
60 -4.22052256 -1.44445586
61 3.30236866 -4.22052256
62 -0.59642495 3.30236866
63 -0.22169422 -0.59642495
64 0.25689688 -0.22169422
65 -1.20136401 0.25689688
66 0.43336518 -1.20136401
67 2.01972770 0.43336518
68 1.26214942 2.01972770
69 -1.10603843 1.26214942
70 2.35647293 -1.10603843
71 -0.15412087 2.35647293
72 2.28963717 -0.15412087
73 1.06494341 2.28963717
74 1.31631575 1.06494341
75 2.93111004 1.31631575
76 -0.74282588 2.93111004
77 2.62493701 -0.74282588
78 5.65477018 2.62493701
79 2.21439349 5.65477018
80 4.49337612 2.21439349
81 1.30888021 4.49337612
82 2.22071118 1.30888021
83 3.83233615 2.22071118
84 2.15986118 3.83233615
85 NA 2.15986118
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.57342675 -0.36897202
[2,] 0.64309414 -1.57342675
[3,] -4.72239450 0.64309414
[4,] 0.81193173 -4.72239450
[5,] -4.90133893 0.81193173
[6,] 1.56822784 -4.90133893
[7,] -4.75756163 1.56822784
[8,] -3.15638845 -4.75756163
[9,] 1.35655529 -3.15638845
[10,] 0.68946038 1.35655529
[11,] -2.55849070 0.68946038
[12,] -0.39243816 -2.55849070
[13,] -1.65859914 -0.39243816
[14,] -2.69902883 -1.65859914
[15,] -0.02704664 -2.69902883
[16,] -1.07856469 -0.02704664
[17,] -0.75319376 -1.07856469
[18,] -1.80406765 -0.75319376
[19,] 2.11449183 -1.80406765
[20,] -2.58477265 2.11449183
[21,] 1.37368415 -2.58477265
[22,] -0.25329073 1.37368415
[23,] -3.44173848 -0.25329073
[24,] -1.85749760 -3.44173848
[25,] 2.20980045 -1.85749760
[26,] -1.43457130 2.20980045
[27,] -3.53256276 -1.43457130
[28,] -2.73919476 -3.53256276
[29,] -0.06498285 -2.73919476
[30,] -0.80075247 -0.06498285
[31,] 1.36856494 -0.80075247
[32,] -1.73907983 1.36856494
[33,] -2.45448332 -1.73907983
[34,] 2.58374103 -2.45448332
[35,] 3.65454700 2.58374103
[36,] -5.14688391 3.65454700
[37,] 2.18309698 -5.14688391
[38,] -3.23998213 2.18309698
[39,] -2.46219123 -3.23998213
[40,] -0.65376028 -2.46219123
[41,] -2.58826198 -0.65376028
[42,] 1.05640655 -2.58826198
[43,] 3.47741567 1.05640655
[44,] -5.09028780 3.47741567
[45,] 0.25905603 -5.09028780
[46,] 1.72040126 0.25905603
[47,] 3.49843440 1.72040126
[48,] 1.15496676 3.49843440
[49,] -1.39846571 1.15496676
[50,] 0.11631836 -1.39846571
[51,] 1.06385141 0.11631836
[52,] -0.06586955 1.06385141
[53,] 0.56378995 -0.06586955
[54,] 0.31412009 0.56378995
[55,] 3.08829447 0.31412009
[56,] 0.02730960 3.08829447
[57,] 1.21150365 0.02730960
[58,] 1.83627137 1.21150365
[59,] -1.44445586 1.83627137
[60,] -4.22052256 -1.44445586
[61,] 3.30236866 -4.22052256
[62,] -0.59642495 3.30236866
[63,] -0.22169422 -0.59642495
[64,] 0.25689688 -0.22169422
[65,] -1.20136401 0.25689688
[66,] 0.43336518 -1.20136401
[67,] 2.01972770 0.43336518
[68,] 1.26214942 2.01972770
[69,] -1.10603843 1.26214942
[70,] 2.35647293 -1.10603843
[71,] -0.15412087 2.35647293
[72,] 2.28963717 -0.15412087
[73,] 1.06494341 2.28963717
[74,] 1.31631575 1.06494341
[75,] 2.93111004 1.31631575
[76,] -0.74282588 2.93111004
[77,] 2.62493701 -0.74282588
[78,] 5.65477018 2.62493701
[79,] 2.21439349 5.65477018
[80,] 4.49337612 2.21439349
[81,] 1.30888021 4.49337612
[82,] 2.22071118 1.30888021
[83,] 3.83233615 2.22071118
[84,] 2.15986118 3.83233615
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.57342675 -0.36897202
2 0.64309414 -1.57342675
3 -4.72239450 0.64309414
4 0.81193173 -4.72239450
5 -4.90133893 0.81193173
6 1.56822784 -4.90133893
7 -4.75756163 1.56822784
8 -3.15638845 -4.75756163
9 1.35655529 -3.15638845
10 0.68946038 1.35655529
11 -2.55849070 0.68946038
12 -0.39243816 -2.55849070
13 -1.65859914 -0.39243816
14 -2.69902883 -1.65859914
15 -0.02704664 -2.69902883
16 -1.07856469 -0.02704664
17 -0.75319376 -1.07856469
18 -1.80406765 -0.75319376
19 2.11449183 -1.80406765
20 -2.58477265 2.11449183
21 1.37368415 -2.58477265
22 -0.25329073 1.37368415
23 -3.44173848 -0.25329073
24 -1.85749760 -3.44173848
25 2.20980045 -1.85749760
26 -1.43457130 2.20980045
27 -3.53256276 -1.43457130
28 -2.73919476 -3.53256276
29 -0.06498285 -2.73919476
30 -0.80075247 -0.06498285
31 1.36856494 -0.80075247
32 -1.73907983 1.36856494
33 -2.45448332 -1.73907983
34 2.58374103 -2.45448332
35 3.65454700 2.58374103
36 -5.14688391 3.65454700
37 2.18309698 -5.14688391
38 -3.23998213 2.18309698
39 -2.46219123 -3.23998213
40 -0.65376028 -2.46219123
41 -2.58826198 -0.65376028
42 1.05640655 -2.58826198
43 3.47741567 1.05640655
44 -5.09028780 3.47741567
45 0.25905603 -5.09028780
46 1.72040126 0.25905603
47 3.49843440 1.72040126
48 1.15496676 3.49843440
49 -1.39846571 1.15496676
50 0.11631836 -1.39846571
51 1.06385141 0.11631836
52 -0.06586955 1.06385141
53 0.56378995 -0.06586955
54 0.31412009 0.56378995
55 3.08829447 0.31412009
56 0.02730960 3.08829447
57 1.21150365 0.02730960
58 1.83627137 1.21150365
59 -1.44445586 1.83627137
60 -4.22052256 -1.44445586
61 3.30236866 -4.22052256
62 -0.59642495 3.30236866
63 -0.22169422 -0.59642495
64 0.25689688 -0.22169422
65 -1.20136401 0.25689688
66 0.43336518 -1.20136401
67 2.01972770 0.43336518
68 1.26214942 2.01972770
69 -1.10603843 1.26214942
70 2.35647293 -1.10603843
71 -0.15412087 2.35647293
72 2.28963717 -0.15412087
73 1.06494341 2.28963717
74 1.31631575 1.06494341
75 2.93111004 1.31631575
76 -0.74282588 2.93111004
77 2.62493701 -0.74282588
78 5.65477018 2.62493701
79 2.21439349 5.65477018
80 4.49337612 2.21439349
81 1.30888021 4.49337612
82 2.22071118 1.30888021
83 3.83233615 2.22071118
84 2.15986118 3.83233615
> 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/7l8mh1323520589.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/87aly1323520589.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/9izvx1323520589.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/10thd11323520589.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/11cwqd1323520589.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/12q5uh1323520589.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/13kjjk1323520589.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/14fkf11323520589.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/15t1i11323520589.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/16b4zu1323520589.tab")
+ }
>
> try(system("convert tmp/1q8ex1323520589.ps tmp/1q8ex1323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/2fumf1323520589.ps tmp/2fumf1323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/37uio1323520589.ps tmp/37uio1323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/41tfg1323520589.ps tmp/41tfg1323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/5rep21323520589.ps tmp/5rep21323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/60v0v1323520589.ps tmp/60v0v1323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/7l8mh1323520589.ps tmp/7l8mh1323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/87aly1323520589.ps tmp/87aly1323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/9izvx1323520589.ps tmp/9izvx1323520589.png",intern=TRUE))
character(0)
> try(system("convert tmp/10thd11323520589.ps tmp/10thd11323520589.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.79 0.31 5.07