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(63031
+ ,68
+ ,13
+ ,5
+ ,20
+ ,10345
+ ,66751
+ ,17
+ ,26
+ ,7
+ ,21
+ ,17607
+ ,7176
+ ,1
+ ,0
+ ,0
+ ,0
+ ,1423
+ ,78306
+ ,114
+ ,37
+ ,12
+ ,28
+ ,20050
+ ,137944
+ ,95
+ ,47
+ ,15
+ ,59
+ ,21212
+ ,261308
+ ,148
+ ,80
+ ,16
+ ,58
+ ,93979
+ ,69266
+ ,56
+ ,21
+ ,12
+ ,36
+ ,15524
+ ,80226
+ ,26
+ ,36
+ ,13
+ ,50
+ ,16182
+ ,73226
+ ,63
+ ,35
+ ,15
+ ,29
+ ,19238
+ ,178519
+ ,96
+ ,40
+ ,13
+ ,48
+ ,28909
+ ,66476
+ ,74
+ ,35
+ ,6
+ ,24
+ ,22357
+ ,98606
+ ,65
+ ,46
+ ,16
+ ,44
+ ,25560
+ ,50001
+ ,40
+ ,20
+ ,7
+ ,16
+ ,9954
+ ,91093
+ ,173
+ ,24
+ ,12
+ ,46
+ ,18490
+ ,73884
+ ,28
+ ,19
+ ,9
+ ,35
+ ,17777
+ ,72961
+ ,55
+ ,15
+ ,10
+ ,35
+ ,25268
+ ,69388
+ ,58
+ ,48
+ ,16
+ ,63
+ ,37525
+ ,15629
+ ,25
+ ,0
+ ,5
+ ,15
+ ,6023
+ ,71693
+ ,103
+ ,38
+ ,20
+ ,62
+ ,25042
+ ,19920
+ ,29
+ ,12
+ ,7
+ ,12
+ ,35713
+ ,39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339
+ ,55
+ ,26
+ ,14
+ ,54
+ ,16170
+ ,11796
+ ,22
+ ,1
+ ,2
+ ,1
+ ,0
+ ,7627
+ ,7
+ ,0
+ ,0
+ ,0
+ ,0
+ ,68998
+ ,21
+ ,12
+ ,9
+ ,21
+ ,20539
+ ,6836
+ ,5
+ ,0
+ ,1
+ ,0
+ ,0
+ ,33365
+ ,21
+ ,17
+ ,3
+ ,3
+ ,10056
+ ,5118
+ ,1
+ ,5
+ ,0
+ ,0
+ ,0
+ ,20898
+ ,22
+ ,4
+ ,2
+ ,3
+ ,2418
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,42690
+ ,31
+ ,6
+ ,12
+ ,44
+ ,11806
+ ,14507
+ ,25
+ ,0
+ ,14
+ ,19
+ ,15924
+ ,7131
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4194
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,21416
+ ,20
+ ,15
+ ,4
+ ,12
+ ,7084
+ ,30591
+ ,29
+ ,0
+ ,7
+ ,24
+ ,14831
+ ,42419
+ ,33
+ ,12
+ ,10
+ ,26
+ ,6585)
+ ,dim=c(6
+ ,144)
+ ,dimnames=list(c('time'
+ ,'comp'
+ ,'blog'
+ ,'review'
+ ,'fbm'
+ ,'charac')
+ ,1:144))
> y <- array(NA,dim=c(6,144),dimnames=list(c('time','comp','blog','review','fbm','charac'),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 = '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
time comp blog review fbm charac t
1 63031 68 13 5 20 10345 1
2 66751 17 26 7 21 17607 2
3 7176 1 0 0 0 1423 3
4 78306 114 37 12 28 20050 4
5 137944 95 47 15 59 21212 5
6 261308 148 80 16 58 93979 6
7 69266 56 21 12 36 15524 7
8 80226 26 36 13 50 16182 8
9 73226 63 35 15 29 19238 9
10 178519 96 40 13 48 28909 10
11 66476 74 35 6 24 22357 11
12 98606 65 46 16 44 25560 12
13 50001 40 20 7 16 9954 13
14 91093 173 24 12 46 18490 14
15 73884 28 19 9 35 17777 15
16 72961 55 15 10 35 25268 16
17 69388 58 48 16 63 37525 17
18 15629 25 0 5 15 6023 18
19 71693 103 38 20 62 25042 19
20 19920 29 12 7 12 35713 20
21 39403 31 10 13 33 7039 21
22 99933 43 51 13 44 40841 22
23 56088 74 4 11 29 9214 23
24 62006 99 24 9 26 17446 24
25 81665 25 39 10 31 10295 25
26 65223 69 19 7 22 13206 26
27 88794 62 23 13 46 26093 27
28 90642 25 39 15 39 20744 28
29 203699 38 37 13 45 68013 29
30 99340 57 20 7 23 12840 30
31 56695 52 20 14 41 12672 31
32 108143 91 41 11 32 10872 32
33 58313 48 26 3 12 21325 33
34 29101 52 0 8 18 24542 34
35 113060 35 31 12 41 16401 35
36 0 0 0 0 0 0 36
37 65773 31 8 12 32 12821 37
38 67047 107 35 8 24 14662 38
39 41953 242 3 20 54 22190 39
40 109835 41 47 18 71 37929 40
41 86584 57 42 9 32 18009 41
42 59588 32 11 14 53 11076 42
43 40064 17 10 7 24 24981 43
44 70227 36 26 13 35 30691 44
45 60437 29 27 11 42 29164 45
46 47000 22 0 11 33 13985 46
47 40295 21 15 14 30 7588 47
48 103397 41 32 9 36 20023 48
49 78982 64 13 12 48 25524 49
50 60206 71 24 11 31 14717 50
51 39887 28 10 17 34 6832 51
52 49791 36 14 10 30 9624 52
53 129283 45 24 11 43 24300 53
54 104816 22 29 12 41 21790 54
55 101395 27 40 17 66 16493 55
56 72824 38 22 6 20 9269 56
57 76018 26 27 8 23 20105 57
58 33891 41 8 12 30 11216 58
59 62164 21 27 13 49 15569 59
60 28266 28 0 14 37 21799 60
61 35093 36 0 17 61 3772 61
62 35252 58 17 8 25 6057 62
63 36977 65 7 9 28 20828 63
64 42406 29 18 9 25 9976 64
65 56353 21 7 9 29 14055 65
66 58817 19 24 15 53 17455 66
67 76053 55 18 16 55 39553 67
68 70872 119 39 13 33 14818 68
69 42372 34 17 12 37 17065 69
70 19144 25 0 10 27 1536 70
71 114177 113 39 9 26 11938 71
72 53544 46 20 3 2 24589 72
73 51379 28 29 12 46 21332 73
74 40756 63 27 8 15 13229 74
75 46956 52 23 17 63 11331 75
76 17799 35 0 9 28 853 76
77 71154 32 31 8 24 19821 77
78 58305 45 19 9 31 34666 78
79 27454 42 12 12 25 15051 79
80 34323 28 23 5 7 27969 80
81 44761 32 33 14 35 17897 81
82 113862 32 21 14 42 6031 82
83 35027 27 17 10 10 7153 83
84 62396 69 27 12 33 13365 84
85 29613 30 14 10 28 11197 85
86 65559 48 12 12 25 25291 86
87 110811 57 21 17 62 28994 87
88 27883 36 14 11 29 10461 88
89 40181 20 14 10 30 16415 89
90 53398 54 22 11 36 8495 90
91 56435 26 25 7 17 18318 91
92 77283 58 36 10 34 25143 92
93 71738 35 10 11 37 20471 93
94 48503 28 16 5 20 14561 94
95 25214 8 12 6 7 16902 95
96 119424 96 20 14 46 12994 96
97 79201 50 38 13 43 29697 97
98 19349 15 13 1 0 3895 98
99 78760 65 12 13 45 9807 99
100 54133 33 11 9 26 10711 100
101 21623 7 8 1 1 2325 101
102 25497 17 22 6 16 19000 102
103 69535 55 14 12 29 22418 103
104 30709 32 7 9 21 7872 104
105 37043 22 14 9 19 5650 105
106 24716 41 2 12 10 3979 106
107 54865 50 35 10 39 14956 107
108 27246 7 5 2 7 3738 108
109 0 0 0 0 0 0 109
110 38814 26 34 8 11 10586 110
111 27646 22 12 7 28 18122 111
112 65373 26 34 11 27 17899 112
113 43021 37 30 14 46 10913 113
114 43116 29 21 4 9 18060 114
115 3058 0 0 0 0 0 115
116 0 0 0 0 0 0 116
117 96347 42 28 13 49 15452 117
118 48626 51 16 17 27 33996 118
119 73073 77 12 13 31 8877 119
120 45266 32 14 12 46 18708 120
121 43410 63 7 1 3 2781 121
122 83842 50 41 12 41 20854 122
123 39296 18 21 6 15 8179 123
124 38490 37 28 11 21 7139 124
125 39841 23 1 8 23 13798 125
126 19764 19 10 2 4 5619 126
127 59975 39 31 12 41 13050 127
128 64589 38 7 12 46 11297 128
129 63339 55 26 14 54 16170 129
130 11796 22 1 2 1 0 130
131 7627 7 0 0 0 0 131
132 68998 21 12 9 21 20539 132
133 6836 5 0 1 0 0 133
134 33365 21 17 3 3 10056 134
135 5118 1 5 0 0 0 135
136 20898 22 4 2 3 2418 136
137 0 0 0 0 0 0 137
138 42690 31 6 12 44 11806 138
139 14507 25 0 14 19 15924 139
140 7131 0 0 0 0 0 140
141 4194 4 0 0 0 0 141
142 21416 20 15 4 12 7084 142
143 30591 29 0 7 24 14831 143
144 42419 33 12 10 26 6585 144
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) comp blog review fbm charac
11489.3212 158.3053 998.6408 -1782.2059 886.6306 0.9654
t
-52.6499
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-61891 -11248 -1515 9052 68383
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 11489.3212 6404.9954 1.794 0.075050 .
comp 158.3053 60.8326 2.602 0.010279 *
blog 998.6408 161.4131 6.187 6.65e-09 ***
review -1782.2059 803.9855 -2.217 0.028292 *
fbm 886.6306 228.8360 3.875 0.000165 ***
charac 0.9654 0.1850 5.219 6.52e-07 ***
t -52.6499 46.5112 -1.132 0.259618
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 19990 on 137 degrees of freedom
Multiple R-squared: 0.7331, Adjusted R-squared: 0.7214
F-statistic: 62.72 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.7481460 5.037080e-01 2.518540e-01
[2,] 0.8982917 2.034165e-01 1.017083e-01
[3,] 0.8279832 3.440336e-01 1.720168e-01
[4,] 0.7523985 4.952030e-01 2.476015e-01
[5,] 0.8391379 3.217243e-01 1.608621e-01
[6,] 0.7691565 4.616871e-01 2.308435e-01
[7,] 0.7065267 5.869466e-01 2.934733e-01
[8,] 0.9812351 3.752975e-02 1.876488e-02
[9,] 0.9709318 5.813644e-02 2.906822e-02
[10,] 0.9745145 5.097095e-02 2.548547e-02
[11,] 0.9775674 4.486524e-02 2.243262e-02
[12,] 0.9807995 3.840103e-02 1.920052e-02
[13,] 0.9740190 5.196201e-02 2.598101e-02
[14,] 0.9806225 3.875496e-02 1.937748e-02
[15,] 0.9726797 5.464066e-02 2.732033e-02
[16,] 0.9813901 3.721977e-02 1.860988e-02
[17,] 0.9761554 4.768921e-02 2.384460e-02
[18,] 0.9703235 5.935303e-02 2.967652e-02
[19,] 0.9698482 6.030353e-02 3.015176e-02
[20,] 0.9993960 1.208090e-03 6.040448e-04
[21,] 0.9998205 3.589979e-04 1.794990e-04
[22,] 0.9996983 6.033692e-04 3.016846e-04
[23,] 0.9996788 6.424988e-04 3.212494e-04
[24,] 0.9996551 6.898903e-04 3.449451e-04
[25,] 0.9995576 8.848804e-04 4.424402e-04
[26,] 0.9997981 4.038235e-04 2.019117e-04
[27,] 0.9997155 5.689600e-04 2.844800e-04
[28,] 0.9997309 5.382918e-04 2.691459e-04
[29,] 0.9996870 6.260103e-04 3.130051e-04
[30,] 0.9999537 9.253982e-05 4.626991e-05
[31,] 0.9999601 7.985127e-05 3.992563e-05
[32,] 0.9999332 1.336192e-04 6.680961e-05
[33,] 0.9998885 2.230515e-04 1.115258e-04
[34,] 0.9998522 2.955468e-04 1.477734e-04
[35,] 0.9997659 4.682301e-04 2.341151e-04
[36,] 0.9997857 4.285299e-04 2.142650e-04
[37,] 0.9997257 5.485158e-04 2.742579e-04
[38,] 0.9995843 8.313826e-04 4.156913e-04
[39,] 0.9996451 7.098823e-04 3.549411e-04
[40,] 0.9994411 1.117808e-03 5.589040e-04
[41,] 0.9991865 1.626942e-03 8.134708e-04
[42,] 0.9989131 2.173870e-03 1.086935e-03
[43,] 0.9983658 3.268409e-03 1.634204e-03
[44,] 0.9998424 3.152607e-04 1.576303e-04
[45,] 0.9999453 1.093272e-04 5.466359e-05
[46,] 0.9999374 1.252116e-04 6.260581e-05
[47,] 0.9999493 1.014155e-04 5.070774e-05
[48,] 0.9999592 8.156894e-05 4.078447e-05
[49,] 0.9999351 1.298269e-04 6.491346e-05
[50,] 0.9999156 1.688207e-04 8.441037e-05
[51,] 0.9998841 2.318519e-04 1.159259e-04
[52,] 0.9998385 3.229398e-04 1.614699e-04
[53,] 0.9998170 3.659320e-04 1.829660e-04
[54,] 0.9998459 3.082264e-04 1.541132e-04
[55,] 0.9997573 4.854553e-04 2.427276e-04
[56,] 0.9997513 4.974815e-04 2.487408e-04
[57,] 0.9996558 6.884133e-04 3.442067e-04
[58,] 0.9995559 8.882475e-04 4.441238e-04
[59,] 0.9997781 4.438731e-04 2.219366e-04
[60,] 0.9997072 5.855925e-04 2.927963e-04
[61,] 0.9995673 8.653032e-04 4.326516e-04
[62,] 0.9996103 7.794868e-04 3.897434e-04
[63,] 0.9994278 1.144479e-03 5.722394e-04
[64,] 0.9995144 9.712100e-04 4.856050e-04
[65,] 0.9995283 9.433358e-04 4.716679e-04
[66,] 0.9998303 3.393289e-04 1.696645e-04
[67,] 0.9998674 2.651997e-04 1.325998e-04
[68,] 0.9998328 3.343586e-04 1.671793e-04
[69,] 0.9997910 4.180233e-04 2.090116e-04
[70,] 0.9998430 3.140933e-04 1.570467e-04
[71,] 0.9998194 3.611466e-04 1.805733e-04
[72,] 0.9998284 3.431149e-04 1.715575e-04
[73,] 0.9999999 1.643240e-07 8.216199e-08
[74,] 0.9999999 2.623472e-07 1.311736e-07
[75,] 0.9999998 3.278005e-07 1.639002e-07
[76,] 0.9999998 3.455298e-07 1.727649e-07
[77,] 0.9999997 5.800667e-07 2.900333e-07
[78,] 0.9999998 3.781114e-07 1.890557e-07
[79,] 0.9999999 2.358874e-07 1.179437e-07
[80,] 0.9999998 4.663231e-07 2.331615e-07
[81,] 0.9999997 5.043959e-07 2.521980e-07
[82,] 0.9999996 8.403594e-07 4.201797e-07
[83,] 0.9999993 1.469283e-06 7.346413e-07
[84,] 0.9999992 1.551722e-06 7.758610e-07
[85,] 0.9999984 3.170880e-06 1.585440e-06
[86,] 0.9999969 6.235160e-06 3.117580e-06
[87,] 0.9999993 1.356203e-06 6.781013e-07
[88,] 0.9999987 2.528511e-06 1.264255e-06
[89,] 0.9999974 5.168399e-06 2.584200e-06
[90,] 0.9999965 7.061793e-06 3.530896e-06
[91,] 0.9999954 9.173986e-06 4.586993e-06
[92,] 0.9999925 1.498729e-05 7.493643e-06
[93,] 0.9999929 1.410861e-05 7.054307e-06
[94,] 0.9999893 2.145178e-05 1.072589e-05
[95,] 0.9999787 4.254292e-05 2.127146e-05
[96,] 0.9999645 7.105427e-05 3.552714e-05
[97,] 0.9999390 1.220664e-04 6.103322e-05
[98,] 0.9999582 8.356659e-05 4.178330e-05
[99,] 0.9999495 1.010629e-04 5.053146e-05
[100,] 0.9998992 2.016287e-04 1.008143e-04
[101,] 0.9998095 3.810850e-04 1.905425e-04
[102,] 0.9998586 2.827436e-04 1.413718e-04
[103,] 0.9998108 3.783550e-04 1.891775e-04
[104,] 0.9998841 2.317466e-04 1.158733e-04
[105,] 0.9997693 4.613014e-04 2.306507e-04
[106,] 0.9995536 8.928686e-04 4.464343e-04
[107,] 0.9993157 1.368552e-03 6.842762e-04
[108,] 0.9997836 4.327624e-04 2.163812e-04
[109,] 0.9998730 2.539490e-04 1.269745e-04
[110,] 0.9998693 2.613746e-04 1.306873e-04
[111,] 0.9999510 9.797124e-05 4.898562e-05
[112,] 0.9999033 1.934054e-04 9.670268e-05
[113,] 0.9997556 4.888861e-04 2.444430e-04
[114,] 0.9994019 1.196171e-03 5.980855e-04
[115,] 0.9985902 2.819612e-03 1.409806e-03
[116,] 0.9968880 6.224007e-03 3.112003e-03
[117,] 0.9946590 1.068196e-02 5.340980e-03
[118,] 0.9894962 2.100757e-02 1.050378e-02
[119,] 0.9893966 2.120673e-02 1.060337e-02
[120,] 0.9915480 1.690401e-02 8.452007e-03
[121,] 0.9797947 4.041066e-02 2.020533e-02
[122,] 0.9557884 8.842325e-02 4.421163e-02
[123,] 0.9972613 5.477451e-03 2.738726e-03
[124,] 0.9884465 2.310709e-02 1.155354e-02
[125,] 0.9927038 1.459232e-02 7.296160e-03
> postscript(file="/var/wessaorg/rcomp/tmp/1jxqo1322154507.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/2jpr61322154507.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/3s6q81322154507.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/4k0qs1322154507.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/5psv71322154507.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
9038.74780 3569.79311 -5687.41959 -10764.39041 18686.94519 33178.93232
7 8 9 10 11 12
2789.80800 -7693.84024 -266.40877 65115.33111 -23270.20338 -3650.53498
13 14 15 16 17 18
1571.00967 -8261.92303 7623.83811 1024.31475 -61891.24217 -9073.19776
19 20 21 22 23 24
-36551.91763 -39731.78643 1239.97813 -23406.18899 15097.39276 -11713.97550
25 26 27 28 29 30
8985.17636 5426.03047 3136.43949 9850.80311 68382.78603 40121.35347
31 32 33 34 35 36
-5001.19422 23724.84245 -10881.97305 -14224.28102 36116.21441 -9593.92319
37 38 39 40 41 42
23972.22735 -15508.68037 -42444.60550 -20462.11068 -3430.93316 1526.01621
43 44 45 46 47 48
-14758.94714 -8101.40004 -26025.93657 11294.40638 4002.82699 20779.10166
49 50 51 52 53 54
1146.37274 -5946.73367 10220.42015 3291.79045 47513.30269 27725.35407
55 56 57 58 59 60
4439.33857 20309.84695 10906.56458 -5064.47275 -11812.98769 -13395.74931
61 62 63 64 65 66
-6312.06186 -12887.07981 -17368.54691 -4036.70487 14730.10856 -13281.73166
67 68 69 70 71 72
-17024.36128 -15217.65448 -15736.90433 -217.25524 31053.02639 -1573.88083
73 74 75 76 77 78
-29652.13526 -15586.65071 -28284.19237 -4838.88711 1538.70726 -20087.27082
79 80 81 82 83 84
-13817.79113 -24651.85056 -23843.27458 62542.90967 8706.84176 -3331.80198
85 86 87 88 89 90
-13944.21901 13820.38406 21243.39701 -14860.00229 -8393.20634 -4386.79128
91 92 93 94 95 96
373.66485 -11091.35838 16654.56739 -1326.58068 -6353.82456 49440.61207
97 98 99 100 101 102
-16670.36856 -4315.50526 24012.25947 14346.76901 5005.11493 -27118.48352
103 104 105 106 107 108
14813.04332 2460.11818 7357.68221 18998.67209 -25053.30157 9090.92044
109 110 111 112 113 114
-5750.47713 -10668.40713 -23310.50534 96.56081 -24704.76765 -6219.24296
115 116 117 118 119 120
-2376.57746 -5381.92751 21213.60702 -7163.20501 30789.23068 -16411.02673
121 122 123 124 125 126
17765.18089 -5181.08736 -40.43730 -6196.82720 10838.02094 -3492.24572
127 128 129 130 131 132
-9523.20658 16528.29499 -14567.37435 5347.59546 1926.68455 26742.93898
133 134 135 136 137 138
3339.80094 1608.28077 -4415.08784 7662.01064 -4276.27865 -1455.54747
139 140 141 142 143 144
-889.50054 3012.67119 -504.90008 -11092.27765 -1081.55025 9716.11032
> postscript(file="/var/wessaorg/rcomp/tmp/60yx41322154507.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 9038.74780 NA
1 3569.79311 9038.74780
2 -5687.41959 3569.79311
3 -10764.39041 -5687.41959
4 18686.94519 -10764.39041
5 33178.93232 18686.94519
6 2789.80800 33178.93232
7 -7693.84024 2789.80800
8 -266.40877 -7693.84024
9 65115.33111 -266.40877
10 -23270.20338 65115.33111
11 -3650.53498 -23270.20338
12 1571.00967 -3650.53498
13 -8261.92303 1571.00967
14 7623.83811 -8261.92303
15 1024.31475 7623.83811
16 -61891.24217 1024.31475
17 -9073.19776 -61891.24217
18 -36551.91763 -9073.19776
19 -39731.78643 -36551.91763
20 1239.97813 -39731.78643
21 -23406.18899 1239.97813
22 15097.39276 -23406.18899
23 -11713.97550 15097.39276
24 8985.17636 -11713.97550
25 5426.03047 8985.17636
26 3136.43949 5426.03047
27 9850.80311 3136.43949
28 68382.78603 9850.80311
29 40121.35347 68382.78603
30 -5001.19422 40121.35347
31 23724.84245 -5001.19422
32 -10881.97305 23724.84245
33 -14224.28102 -10881.97305
34 36116.21441 -14224.28102
35 -9593.92319 36116.21441
36 23972.22735 -9593.92319
37 -15508.68037 23972.22735
38 -42444.60550 -15508.68037
39 -20462.11068 -42444.60550
40 -3430.93316 -20462.11068
41 1526.01621 -3430.93316
42 -14758.94714 1526.01621
43 -8101.40004 -14758.94714
44 -26025.93657 -8101.40004
45 11294.40638 -26025.93657
46 4002.82699 11294.40638
47 20779.10166 4002.82699
48 1146.37274 20779.10166
49 -5946.73367 1146.37274
50 10220.42015 -5946.73367
51 3291.79045 10220.42015
52 47513.30269 3291.79045
53 27725.35407 47513.30269
54 4439.33857 27725.35407
55 20309.84695 4439.33857
56 10906.56458 20309.84695
57 -5064.47275 10906.56458
58 -11812.98769 -5064.47275
59 -13395.74931 -11812.98769
60 -6312.06186 -13395.74931
61 -12887.07981 -6312.06186
62 -17368.54691 -12887.07981
63 -4036.70487 -17368.54691
64 14730.10856 -4036.70487
65 -13281.73166 14730.10856
66 -17024.36128 -13281.73166
67 -15217.65448 -17024.36128
68 -15736.90433 -15217.65448
69 -217.25524 -15736.90433
70 31053.02639 -217.25524
71 -1573.88083 31053.02639
72 -29652.13526 -1573.88083
73 -15586.65071 -29652.13526
74 -28284.19237 -15586.65071
75 -4838.88711 -28284.19237
76 1538.70726 -4838.88711
77 -20087.27082 1538.70726
78 -13817.79113 -20087.27082
79 -24651.85056 -13817.79113
80 -23843.27458 -24651.85056
81 62542.90967 -23843.27458
82 8706.84176 62542.90967
83 -3331.80198 8706.84176
84 -13944.21901 -3331.80198
85 13820.38406 -13944.21901
86 21243.39701 13820.38406
87 -14860.00229 21243.39701
88 -8393.20634 -14860.00229
89 -4386.79128 -8393.20634
90 373.66485 -4386.79128
91 -11091.35838 373.66485
92 16654.56739 -11091.35838
93 -1326.58068 16654.56739
94 -6353.82456 -1326.58068
95 49440.61207 -6353.82456
96 -16670.36856 49440.61207
97 -4315.50526 -16670.36856
98 24012.25947 -4315.50526
99 14346.76901 24012.25947
100 5005.11493 14346.76901
101 -27118.48352 5005.11493
102 14813.04332 -27118.48352
103 2460.11818 14813.04332
104 7357.68221 2460.11818
105 18998.67209 7357.68221
106 -25053.30157 18998.67209
107 9090.92044 -25053.30157
108 -5750.47713 9090.92044
109 -10668.40713 -5750.47713
110 -23310.50534 -10668.40713
111 96.56081 -23310.50534
112 -24704.76765 96.56081
113 -6219.24296 -24704.76765
114 -2376.57746 -6219.24296
115 -5381.92751 -2376.57746
116 21213.60702 -5381.92751
117 -7163.20501 21213.60702
118 30789.23068 -7163.20501
119 -16411.02673 30789.23068
120 17765.18089 -16411.02673
121 -5181.08736 17765.18089
122 -40.43730 -5181.08736
123 -6196.82720 -40.43730
124 10838.02094 -6196.82720
125 -3492.24572 10838.02094
126 -9523.20658 -3492.24572
127 16528.29499 -9523.20658
128 -14567.37435 16528.29499
129 5347.59546 -14567.37435
130 1926.68455 5347.59546
131 26742.93898 1926.68455
132 3339.80094 26742.93898
133 1608.28077 3339.80094
134 -4415.08784 1608.28077
135 7662.01064 -4415.08784
136 -4276.27865 7662.01064
137 -1455.54747 -4276.27865
138 -889.50054 -1455.54747
139 3012.67119 -889.50054
140 -504.90008 3012.67119
141 -11092.27765 -504.90008
142 -1081.55025 -11092.27765
143 9716.11032 -1081.55025
144 NA 9716.11032
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3569.79311 9038.74780
[2,] -5687.41959 3569.79311
[3,] -10764.39041 -5687.41959
[4,] 18686.94519 -10764.39041
[5,] 33178.93232 18686.94519
[6,] 2789.80800 33178.93232
[7,] -7693.84024 2789.80800
[8,] -266.40877 -7693.84024
[9,] 65115.33111 -266.40877
[10,] -23270.20338 65115.33111
[11,] -3650.53498 -23270.20338
[12,] 1571.00967 -3650.53498
[13,] -8261.92303 1571.00967
[14,] 7623.83811 -8261.92303
[15,] 1024.31475 7623.83811
[16,] -61891.24217 1024.31475
[17,] -9073.19776 -61891.24217
[18,] -36551.91763 -9073.19776
[19,] -39731.78643 -36551.91763
[20,] 1239.97813 -39731.78643
[21,] -23406.18899 1239.97813
[22,] 15097.39276 -23406.18899
[23,] -11713.97550 15097.39276
[24,] 8985.17636 -11713.97550
[25,] 5426.03047 8985.17636
[26,] 3136.43949 5426.03047
[27,] 9850.80311 3136.43949
[28,] 68382.78603 9850.80311
[29,] 40121.35347 68382.78603
[30,] -5001.19422 40121.35347
[31,] 23724.84245 -5001.19422
[32,] -10881.97305 23724.84245
[33,] -14224.28102 -10881.97305
[34,] 36116.21441 -14224.28102
[35,] -9593.92319 36116.21441
[36,] 23972.22735 -9593.92319
[37,] -15508.68037 23972.22735
[38,] -42444.60550 -15508.68037
[39,] -20462.11068 -42444.60550
[40,] -3430.93316 -20462.11068
[41,] 1526.01621 -3430.93316
[42,] -14758.94714 1526.01621
[43,] -8101.40004 -14758.94714
[44,] -26025.93657 -8101.40004
[45,] 11294.40638 -26025.93657
[46,] 4002.82699 11294.40638
[47,] 20779.10166 4002.82699
[48,] 1146.37274 20779.10166
[49,] -5946.73367 1146.37274
[50,] 10220.42015 -5946.73367
[51,] 3291.79045 10220.42015
[52,] 47513.30269 3291.79045
[53,] 27725.35407 47513.30269
[54,] 4439.33857 27725.35407
[55,] 20309.84695 4439.33857
[56,] 10906.56458 20309.84695
[57,] -5064.47275 10906.56458
[58,] -11812.98769 -5064.47275
[59,] -13395.74931 -11812.98769
[60,] -6312.06186 -13395.74931
[61,] -12887.07981 -6312.06186
[62,] -17368.54691 -12887.07981
[63,] -4036.70487 -17368.54691
[64,] 14730.10856 -4036.70487
[65,] -13281.73166 14730.10856
[66,] -17024.36128 -13281.73166
[67,] -15217.65448 -17024.36128
[68,] -15736.90433 -15217.65448
[69,] -217.25524 -15736.90433
[70,] 31053.02639 -217.25524
[71,] -1573.88083 31053.02639
[72,] -29652.13526 -1573.88083
[73,] -15586.65071 -29652.13526
[74,] -28284.19237 -15586.65071
[75,] -4838.88711 -28284.19237
[76,] 1538.70726 -4838.88711
[77,] -20087.27082 1538.70726
[78,] -13817.79113 -20087.27082
[79,] -24651.85056 -13817.79113
[80,] -23843.27458 -24651.85056
[81,] 62542.90967 -23843.27458
[82,] 8706.84176 62542.90967
[83,] -3331.80198 8706.84176
[84,] -13944.21901 -3331.80198
[85,] 13820.38406 -13944.21901
[86,] 21243.39701 13820.38406
[87,] -14860.00229 21243.39701
[88,] -8393.20634 -14860.00229
[89,] -4386.79128 -8393.20634
[90,] 373.66485 -4386.79128
[91,] -11091.35838 373.66485
[92,] 16654.56739 -11091.35838
[93,] -1326.58068 16654.56739
[94,] -6353.82456 -1326.58068
[95,] 49440.61207 -6353.82456
[96,] -16670.36856 49440.61207
[97,] -4315.50526 -16670.36856
[98,] 24012.25947 -4315.50526
[99,] 14346.76901 24012.25947
[100,] 5005.11493 14346.76901
[101,] -27118.48352 5005.11493
[102,] 14813.04332 -27118.48352
[103,] 2460.11818 14813.04332
[104,] 7357.68221 2460.11818
[105,] 18998.67209 7357.68221
[106,] -25053.30157 18998.67209
[107,] 9090.92044 -25053.30157
[108,] -5750.47713 9090.92044
[109,] -10668.40713 -5750.47713
[110,] -23310.50534 -10668.40713
[111,] 96.56081 -23310.50534
[112,] -24704.76765 96.56081
[113,] -6219.24296 -24704.76765
[114,] -2376.57746 -6219.24296
[115,] -5381.92751 -2376.57746
[116,] 21213.60702 -5381.92751
[117,] -7163.20501 21213.60702
[118,] 30789.23068 -7163.20501
[119,] -16411.02673 30789.23068
[120,] 17765.18089 -16411.02673
[121,] -5181.08736 17765.18089
[122,] -40.43730 -5181.08736
[123,] -6196.82720 -40.43730
[124,] 10838.02094 -6196.82720
[125,] -3492.24572 10838.02094
[126,] -9523.20658 -3492.24572
[127,] 16528.29499 -9523.20658
[128,] -14567.37435 16528.29499
[129,] 5347.59546 -14567.37435
[130,] 1926.68455 5347.59546
[131,] 26742.93898 1926.68455
[132,] 3339.80094 26742.93898
[133,] 1608.28077 3339.80094
[134,] -4415.08784 1608.28077
[135,] 7662.01064 -4415.08784
[136,] -4276.27865 7662.01064
[137,] -1455.54747 -4276.27865
[138,] -889.50054 -1455.54747
[139,] 3012.67119 -889.50054
[140,] -504.90008 3012.67119
[141,] -11092.27765 -504.90008
[142,] -1081.55025 -11092.27765
[143,] 9716.11032 -1081.55025
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3569.79311 9038.74780
2 -5687.41959 3569.79311
3 -10764.39041 -5687.41959
4 18686.94519 -10764.39041
5 33178.93232 18686.94519
6 2789.80800 33178.93232
7 -7693.84024 2789.80800
8 -266.40877 -7693.84024
9 65115.33111 -266.40877
10 -23270.20338 65115.33111
11 -3650.53498 -23270.20338
12 1571.00967 -3650.53498
13 -8261.92303 1571.00967
14 7623.83811 -8261.92303
15 1024.31475 7623.83811
16 -61891.24217 1024.31475
17 -9073.19776 -61891.24217
18 -36551.91763 -9073.19776
19 -39731.78643 -36551.91763
20 1239.97813 -39731.78643
21 -23406.18899 1239.97813
22 15097.39276 -23406.18899
23 -11713.97550 15097.39276
24 8985.17636 -11713.97550
25 5426.03047 8985.17636
26 3136.43949 5426.03047
27 9850.80311 3136.43949
28 68382.78603 9850.80311
29 40121.35347 68382.78603
30 -5001.19422 40121.35347
31 23724.84245 -5001.19422
32 -10881.97305 23724.84245
33 -14224.28102 -10881.97305
34 36116.21441 -14224.28102
35 -9593.92319 36116.21441
36 23972.22735 -9593.92319
37 -15508.68037 23972.22735
38 -42444.60550 -15508.68037
39 -20462.11068 -42444.60550
40 -3430.93316 -20462.11068
41 1526.01621 -3430.93316
42 -14758.94714 1526.01621
43 -8101.40004 -14758.94714
44 -26025.93657 -8101.40004
45 11294.40638 -26025.93657
46 4002.82699 11294.40638
47 20779.10166 4002.82699
48 1146.37274 20779.10166
49 -5946.73367 1146.37274
50 10220.42015 -5946.73367
51 3291.79045 10220.42015
52 47513.30269 3291.79045
53 27725.35407 47513.30269
54 4439.33857 27725.35407
55 20309.84695 4439.33857
56 10906.56458 20309.84695
57 -5064.47275 10906.56458
58 -11812.98769 -5064.47275
59 -13395.74931 -11812.98769
60 -6312.06186 -13395.74931
61 -12887.07981 -6312.06186
62 -17368.54691 -12887.07981
63 -4036.70487 -17368.54691
64 14730.10856 -4036.70487
65 -13281.73166 14730.10856
66 -17024.36128 -13281.73166
67 -15217.65448 -17024.36128
68 -15736.90433 -15217.65448
69 -217.25524 -15736.90433
70 31053.02639 -217.25524
71 -1573.88083 31053.02639
72 -29652.13526 -1573.88083
73 -15586.65071 -29652.13526
74 -28284.19237 -15586.65071
75 -4838.88711 -28284.19237
76 1538.70726 -4838.88711
77 -20087.27082 1538.70726
78 -13817.79113 -20087.27082
79 -24651.85056 -13817.79113
80 -23843.27458 -24651.85056
81 62542.90967 -23843.27458
82 8706.84176 62542.90967
83 -3331.80198 8706.84176
84 -13944.21901 -3331.80198
85 13820.38406 -13944.21901
86 21243.39701 13820.38406
87 -14860.00229 21243.39701
88 -8393.20634 -14860.00229
89 -4386.79128 -8393.20634
90 373.66485 -4386.79128
91 -11091.35838 373.66485
92 16654.56739 -11091.35838
93 -1326.58068 16654.56739
94 -6353.82456 -1326.58068
95 49440.61207 -6353.82456
96 -16670.36856 49440.61207
97 -4315.50526 -16670.36856
98 24012.25947 -4315.50526
99 14346.76901 24012.25947
100 5005.11493 14346.76901
101 -27118.48352 5005.11493
102 14813.04332 -27118.48352
103 2460.11818 14813.04332
104 7357.68221 2460.11818
105 18998.67209 7357.68221
106 -25053.30157 18998.67209
107 9090.92044 -25053.30157
108 -5750.47713 9090.92044
109 -10668.40713 -5750.47713
110 -23310.50534 -10668.40713
111 96.56081 -23310.50534
112 -24704.76765 96.56081
113 -6219.24296 -24704.76765
114 -2376.57746 -6219.24296
115 -5381.92751 -2376.57746
116 21213.60702 -5381.92751
117 -7163.20501 21213.60702
118 30789.23068 -7163.20501
119 -16411.02673 30789.23068
120 17765.18089 -16411.02673
121 -5181.08736 17765.18089
122 -40.43730 -5181.08736
123 -6196.82720 -40.43730
124 10838.02094 -6196.82720
125 -3492.24572 10838.02094
126 -9523.20658 -3492.24572
127 16528.29499 -9523.20658
128 -14567.37435 16528.29499
129 5347.59546 -14567.37435
130 1926.68455 5347.59546
131 26742.93898 1926.68455
132 3339.80094 26742.93898
133 1608.28077 3339.80094
134 -4415.08784 1608.28077
135 7662.01064 -4415.08784
136 -4276.27865 7662.01064
137 -1455.54747 -4276.27865
138 -889.50054 -1455.54747
139 3012.67119 -889.50054
140 -504.90008 3012.67119
141 -11092.27765 -504.90008
142 -1081.55025 -11092.27765
143 9716.11032 -1081.55025
> 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/7xyl71322154508.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/86dqp1322154508.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/9bhdu1322154508.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/10751z1322154508.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/11bs8v1322154508.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/12tyni1322154508.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/13rjps1322154508.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/14hnwf1322154508.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/15lhnr1322154508.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/16udg61322154508.tab")
+ }
>
> try(system("convert tmp/1jxqo1322154507.ps tmp/1jxqo1322154507.png",intern=TRUE))
character(0)
> try(system("convert tmp/2jpr61322154507.ps tmp/2jpr61322154507.png",intern=TRUE))
character(0)
> try(system("convert tmp/3s6q81322154507.ps tmp/3s6q81322154507.png",intern=TRUE))
character(0)
> try(system("convert tmp/4k0qs1322154507.ps tmp/4k0qs1322154507.png",intern=TRUE))
character(0)
> try(system("convert tmp/5psv71322154507.ps tmp/5psv71322154507.png",intern=TRUE))
character(0)
> try(system("convert tmp/60yx41322154507.ps tmp/60yx41322154507.png",intern=TRUE))
character(0)
> try(system("convert tmp/7xyl71322154508.ps tmp/7xyl71322154508.png",intern=TRUE))
character(0)
> try(system("convert tmp/86dqp1322154508.ps tmp/86dqp1322154508.png",intern=TRUE))
character(0)
> try(system("convert tmp/9bhdu1322154508.ps tmp/9bhdu1322154508.png",intern=TRUE))
character(0)
> try(system("convert tmp/10751z1322154508.ps tmp/10751z1322154508.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.591 0.533 5.238