R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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(13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,11
+ ,9
+ ,7
+ ,13
+ ,2
+ ,15
+ ,11
+ ,14
+ ,15
+ ,7
+ ,11
+ ,11
+ ,15
+ ,10
+ ,5
+ ,12
+ ,12
+ ,7
+ ,11
+ ,4
+ ,14
+ ,12
+ ,15
+ ,13
+ ,6
+ ,15
+ ,11
+ ,17
+ ,16
+ ,6
+ ,9
+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+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '5'
> #'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
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> 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
Celebrity\r Popularity FindingFriends KnowingPeople Liked t
1 3 13 13 14 13 1
2 5 12 12 8 13 2
3 6 15 10 12 16 3
4 6 12 9 7 12 4
5 5 10 10 10 11 5
6 3 12 12 7 12 6
7 8 15 13 16 18 7
8 4 9 12 11 11 8
9 4 12 12 14 14 9
10 4 11 6 6 9 10
11 6 11 5 16 14 11
12 6 11 12 11 12 12
13 5 15 11 16 11 13
14 4 7 14 12 12 14
15 6 11 14 7 13 15
16 4 11 12 13 11 16
17 6 10 12 11 12 17
18 6 14 11 15 16 18
19 4 10 11 7 9 19
20 4 6 7 9 11 20
21 2 11 9 7 13 21
22 7 15 11 14 15 22
23 5 11 11 15 10 23
24 4 12 12 7 11 24
25 6 14 12 15 13 25
26 6 15 11 17 16 26
27 7 9 11 15 15 27
28 5 13 8 14 14 28
29 6 13 9 14 14 29
30 4 16 12 8 14 30
31 4 13 10 8 8 31
32 7 12 10 14 13 32
33 7 14 12 14 15 33
34 4 11 8 8 13 34
35 4 9 12 11 11 35
36 6 16 11 16 15 36
37 6 12 12 10 15 37
38 5 10 7 8 9 38
39 6 13 11 14 13 39
40 7 16 11 16 16 40
41 6 14 12 13 13 41
42 3 15 9 5 11 42
43 3 5 15 8 12 43
44 4 8 11 10 12 44
45 6 11 11 8 12 45
46 7 16 11 13 14 46
47 5 17 11 15 14 47
48 4 9 15 6 8 48
49 5 9 11 12 13 49
50 6 13 12 16 16 50
51 6 10 12 5 13 51
52 6 6 9 15 11 52
53 5 12 12 12 14 53
54 4 8 12 8 13 54
55 5 14 13 13 13 55
56 5 12 11 14 13 56
57 4 11 9 12 12 57
58 6 16 9 16 16 58
59 2 8 11 10 15 59
60 8 15 11 15 15 60
61 3 7 12 8 12 61
62 6 16 12 16 14 62
63 6 14 9 19 12 63
64 6 16 11 14 15 64
65 5 9 9 6 12 65
66 5 14 12 13 13 66
67 6 11 12 15 12 67
68 5 13 12 7 12 68
69 6 15 12 13 13 69
70 2 5 14 4 5 70
71 5 15 11 14 13 71
72 5 13 12 13 13 72
73 5 11 11 11 14 73
74 6 11 6 14 17 74
75 6 12 10 12 13 75
76 6 12 12 15 13 76
77 5 12 13 14 12 77
78 5 12 8 13 13 78
79 4 14 12 8 14 79
80 2 6 12 6 11 80
81 4 7 12 7 12 81
82 6 14 6 13 12 82
83 6 14 11 13 16 83
84 5 10 10 11 12 84
85 3 13 12 5 12 85
86 6 12 13 12 12 86
87 4 9 11 8 10 87
88 5 12 7 11 15 88
89 8 16 11 14 15 89
90 4 10 11 9 12 90
91 6 14 11 10 16 91
92 6 10 11 13 15 92
93 7 16 12 16 16 93
94 6 15 10 16 13 94
95 5 12 11 11 12 95
96 4 10 12 8 11 96
97 6 8 7 4 13 97
98 3 8 13 7 10 98
99 5 11 8 14 15 99
100 6 13 12 11 13 100
101 7 16 11 17 16 101
102 7 16 12 15 15 102
103 6 14 14 17 18 103
104 3 11 10 5 13 104
105 2 4 10 4 10 105
106 8 14 13 10 16 106
107 3 9 10 11 13 107
108 8 14 11 15 15 108
109 3 8 10 10 14 109
110 4 8 7 9 15 110
111 5 11 10 12 14 111
112 7 12 8 15 13 112
113 6 11 12 7 13 113
114 6 14 12 13 15 114
115 7 15 12 12 16 115
116 6 16 11 14 14 116
117 6 16 12 14 14 117
118 6 11 12 8 16 118
119 6 14 12 15 14 119
120 4 14 11 12 12 120
121 4 12 12 12 13 121
122 5 14 11 16 12 122
123 4 8 11 9 12 123
124 6 13 13 15 14 124
125 6 16 12 15 14 125
126 5 12 12 6 14 126
127 8 16 12 14 16 127
128 6 12 12 15 13 128
129 5 11 8 10 14 129
130 4 4 8 6 4 130
131 8 16 12 14 16 131
132 6 15 11 12 13 132
133 4 10 12 8 16 133
134 6 13 13 11 15 134
135 6 15 12 13 14 135
136 4 12 12 9 13 136
137 6 14 11 15 14 137
138 3 7 12 13 12 138
139 6 19 12 15 15 139
140 5 12 10 14 14 140
141 4 12 11 16 13 141
142 6 13 12 14 14 142
143 4 15 12 14 16 143
144 4 8 10 10 6 144
145 4 12 12 10 13 145
146 6 10 13 4 13 146
147 5 8 12 8 14 147
148 6 10 15 15 15 148
149 6 15 11 16 14 149
150 8 16 12 12 15 150
151 7 13 11 12 13 151
152 7 16 12 15 16 152
153 4 9 11 9 12 153
154 6 14 10 12 15 154
155 6 14 11 14 12 155
156 2 12 11 11 14 156
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Popularity FindingFriends KnowingPeople Liked
0.4178099 0.1541880 -0.0205822 0.1035727 0.1459054
t
0.0004860
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.299445 -0.612920 0.001786 0.580783 2.269402
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.417810 0.708265 0.590 0.55614
Popularity 0.154188 0.038463 4.009 9.59e-05 ***
FindingFriends -0.020582 0.048050 -0.428 0.66901
KnowingPeople 0.103573 0.030955 3.346 0.00104 **
Liked 0.145905 0.049024 2.976 0.00340 **
t 0.000486 0.001895 0.256 0.79798
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.047 on 150 degrees of freedom
Multiple R-squared: 0.4592, Adjusted R-squared: 0.4411
F-statistic: 25.47 on 5 and 150 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.586990387 0.82601923 0.41300961
[2,] 0.494474023 0.98894805 0.50552598
[3,] 0.672041461 0.65591708 0.32795854
[4,] 0.792897964 0.41420407 0.20710204
[5,] 0.805276100 0.38944780 0.19472390
[6,] 0.743430422 0.51313916 0.25656958
[7,] 0.668643690 0.66271262 0.33135631
[8,] 0.612224585 0.77555083 0.38777541
[9,] 0.559819937 0.88036013 0.44018006
[10,] 0.610907469 0.77818506 0.38909253
[11,] 0.540362084 0.91927583 0.45963792
[12,] 0.545395923 0.90920815 0.45460408
[13,] 0.948037102 0.10392580 0.05196290
[14,] 0.941501564 0.11699687 0.05849844
[15,] 0.921177246 0.15764551 0.07882275
[16,] 0.897175505 0.20564899 0.10282450
[17,] 0.865798462 0.26840308 0.13420154
[18,] 0.840376292 0.31924742 0.15962371
[19,] 0.848802425 0.30239515 0.15119758
[20,] 0.832945777 0.33410845 0.16705422
[21,] 0.791440510 0.41711898 0.20855949
[22,] 0.807443480 0.38511304 0.19255652
[23,] 0.772887301 0.45422540 0.22711270
[24,] 0.807788185 0.38442363 0.19221182
[25,] 0.791988194 0.41602361 0.20801181
[26,] 0.782420226 0.43515955 0.21757977
[27,] 0.752545399 0.49490920 0.24745460
[28,] 0.712683748 0.57463250 0.28731625
[29,] 0.673456335 0.65308733 0.32654366
[30,] 0.662993660 0.67401268 0.33700634
[31,] 0.614792825 0.77041435 0.38520717
[32,] 0.563645671 0.87270866 0.43635433
[33,] 0.513615008 0.97276998 0.48638499
[34,] 0.568099803 0.86380039 0.43190020
[35,] 0.575910770 0.84817846 0.42408923
[36,] 0.535454124 0.92909175 0.46454588
[37,] 0.582915971 0.83416806 0.41708403
[38,] 0.568929984 0.86214003 0.43107002
[39,] 0.609803909 0.78039218 0.39019609
[40,] 0.580186207 0.83962759 0.41981379
[41,] 0.535100255 0.92979949 0.46489974
[42,] 0.494369484 0.98873897 0.50563052
[43,] 0.559203020 0.88159396 0.44079698
[44,] 0.596399692 0.80720062 0.40360031
[45,] 0.564600166 0.87079967 0.43539983
[46,] 0.538507349 0.92298530 0.46149265
[47,] 0.503667248 0.99266550 0.49633275
[48,] 0.468361500 0.93672300 0.53163850
[49,] 0.473098908 0.94619782 0.52690109
[50,] 0.444763000 0.88952600 0.55523700
[51,] 0.732397178 0.53520564 0.26760282
[52,] 0.800486849 0.39902630 0.19951315
[53,] 0.790014209 0.41997158 0.20998579
[54,] 0.757198937 0.48560213 0.24280106
[55,] 0.718677307 0.56264539 0.28132269
[56,] 0.681061776 0.63787645 0.31893822
[57,] 0.672075676 0.65584865 0.32792432
[58,] 0.641545558 0.71690888 0.35845444
[59,] 0.622826595 0.75434681 0.37717340
[60,] 0.582459016 0.83508197 0.41754098
[61,] 0.538614594 0.92277081 0.46138541
[62,] 0.493373030 0.98674606 0.50662697
[63,] 0.480161933 0.96032387 0.51983807
[64,] 0.441881136 0.88376227 0.55811886
[65,] 0.396008933 0.79201787 0.60399107
[66,] 0.351996066 0.70399213 0.64800393
[67,] 0.330103346 0.66020669 0.66989665
[68,] 0.298114145 0.59622829 0.70188586
[69,] 0.260142829 0.52028566 0.73985717
[70,] 0.228372578 0.45674516 0.77162742
[71,] 0.249089015 0.49817803 0.75091099
[72,] 0.276591458 0.55318292 0.72340854
[73,] 0.240267110 0.48053422 0.75973289
[74,] 0.209886749 0.41977350 0.79011325
[75,] 0.178345937 0.35669187 0.82165406
[76,] 0.151316731 0.30263346 0.84868327
[77,] 0.213588208 0.42717642 0.78641179
[78,] 0.204619754 0.40923951 0.79538025
[79,] 0.173631987 0.34726397 0.82636801
[80,] 0.151653996 0.30330799 0.84834600
[81,] 0.190346589 0.38069318 0.80965341
[82,] 0.168753892 0.33750778 0.83124611
[83,] 0.143848351 0.28769670 0.85615165
[84,] 0.133358192 0.26671638 0.86664181
[85,] 0.111008271 0.22201654 0.88899173
[86,] 0.090557758 0.18111552 0.90944224
[87,] 0.073019616 0.14603923 0.92698038
[88,] 0.060589774 0.12117955 0.93941023
[89,] 0.109814719 0.21962944 0.89018528
[90,] 0.105899669 0.21179934 0.89410033
[91,] 0.091791860 0.18358372 0.90820814
[92,] 0.077987526 0.15597505 0.92201247
[93,] 0.062428068 0.12485614 0.93757193
[94,] 0.050994910 0.10198982 0.94900509
[95,] 0.043415425 0.08683085 0.95658458
[96,] 0.065632461 0.13126492 0.93436754
[97,] 0.063907322 0.12781464 0.93609268
[98,] 0.110664526 0.22132905 0.88933547
[99,] 0.148109992 0.29621998 0.85189001
[100,] 0.223783175 0.44756635 0.77621682
[101,] 0.260872571 0.52174514 0.73912743
[102,] 0.231433210 0.46286642 0.76856679
[103,] 0.196256043 0.39251209 0.80374396
[104,] 0.260528164 0.52105633 0.73947184
[105,] 0.257028247 0.51405649 0.74297175
[106,] 0.216060053 0.43212011 0.78393995
[107,] 0.201849223 0.40369845 0.79815078
[108,] 0.166820070 0.33364014 0.83317993
[109,] 0.136669183 0.27333837 0.86333082
[110,] 0.128557793 0.25711559 0.87144221
[111,] 0.103655230 0.20731046 0.89634477
[112,] 0.137778888 0.27555778 0.86222111
[113,] 0.156521825 0.31304365 0.84347818
[114,] 0.146219312 0.29243862 0.85378069
[115,] 0.117125508 0.23425102 0.88287449
[116,] 0.090634627 0.18126925 0.90936537
[117,] 0.076153823 0.15230765 0.92384618
[118,] 0.063984515 0.12796903 0.93601548
[119,] 0.075399897 0.15079979 0.92460010
[120,] 0.060617580 0.12123516 0.93938242
[121,] 0.049470501 0.09894100 0.95052950
[122,] 0.068742691 0.13748538 0.93125731
[123,] 0.112673197 0.22534639 0.88732680
[124,] 0.088378826 0.17675765 0.91162117
[125,] 0.067260709 0.13452142 0.93273929
[126,] 0.051258646 0.10251729 0.94874135
[127,] 0.036090286 0.07218057 0.96390971
[128,] 0.032968682 0.06593736 0.96703132
[129,] 0.027833621 0.05566724 0.97216638
[130,] 0.021332146 0.04266429 0.97866785
[131,] 0.021149489 0.04229898 0.97885051
[132,] 0.019140715 0.03828143 0.98085929
[133,] 0.013199352 0.02639870 0.98680065
[134,] 0.008607958 0.01721592 0.99139204
[135,] 0.038467421 0.07693484 0.96153258
[136,] 0.021775193 0.04355039 0.97822481
[137,] 0.170476380 0.34095276 0.82952362
[138,] 0.164705002 0.32941000 0.83529500
[139,] 0.091339354 0.18267871 0.90866065
> postscript(file="/var/www/html/rcomp/tmp/1v5151290525782.ps",horizontal=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/html/rcomp/tmp/2v5151290525782.ps",horizontal=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/html/rcomp/tmp/3v5151290525782.ps",horizontal=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/html/rcomp/tmp/4oej81290525782.ps",horizontal=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/html/rcomp/tmp/5oej81290525782.ps",horizontal=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 = 156
Frequency = 1
1 2 3 4 5 6
-2.50195929 0.25259656 -0.10362459 1.43935622 0.60301589 -1.49986919
7 8 9 10 11 12
1.25007667 -0.30666227 -1.51814644 0.07017090 0.28384922 1.23711250
13 14 15 16 17 18
-0.77266558 -0.20951567 1.54520421 -0.82607122 1.38887076 -0.24686164
19 20 21 22 23 24
0.21932352 0.25430487 -2.56062231 0.84648459 0.08870504 -0.36271090
25 26 27 28 29 30
0.20803506 -0.61208258 1.66561029 -0.76389617 0.25620005 -1.52366752
31 32 33 34 35 36
-0.22732136 1.57541777 1.01590932 -0.69109449 -0.31978293 -0.52165204
37 38 39 40 41 42
0.73663218 1.02418915 0.43841027 0.33049876 0.40740517 -1.68862323
43 44 45 46 47 48
-0.48035940 -0.23288337 1.51121194 0.93011182 -1.43170746 0.69122568
49 50 51 52 53 54
0.25744814 -0.19121453 1.84787900 1.65848284 -0.33238294 -0.15592080
55 56 57 58 59 60
-0.57881597 -0.41566287 -0.95007442 -0.71941268 -2.67788882 1.72444582
61 62 63 64 65 66
-0.85922903 -0.36779919 -0.14056278 -0.32811334 0.97584996 -0.60474359
67 68 69 70 71 72
0.79609459 0.31581387 0.23961054 -0.07843381 -0.88551618 -0.45347128
73 74 75 76 77 78
-0.10492344 0.04324563 0.76166722 0.49162762 -0.23879811 -0.38452762
79 80 81 82 83 84
-1.23910305 -1.36122336 0.23462462 0.40989362 -0.07130310 0.31514776
85 86 87 88 89 90
-1.48530197 0.96397365 0.09098885 -0.49463476 1.65973790 -0.46004047
91 92 93 94 95 96
0.23552727 0.68698081 0.32532555 -0.12442052 0.02200843 -0.19289595
97 98 99 100 101 102
2.13456315 -0.61543160 -0.63592801 0.74006743 0.19728312 0.57043005
103 104 105 106 107 108
-0.72537705 -1.37322872 -0.75310970 2.26940234 -1.68774649 1.85530822
109 110 111 112 113 114
-1.57686311 -0.68142829 -0.24754438 1.39180475 1.45641674 0.08011999
115 116 117 118 119 120
0.88311329 -0.20747736 -0.18738115 0.91269813 0.01645032 -1.40208902
121 122 123 124 125 126
-1.21952217 -0.81735155 -0.16770080 0.18879075 -0.29484141 0.25357863
127 128 129 130 131 132
1.51594855 0.46635820 -0.09031049 1.86186428 1.51400475 0.29198616
133 134 135 136 137 138
-0.94040310 0.45231648 0.06163242 -0.91609346 -0.01287895 -1.41451051
139 140 141 142 143 144
-0.91011417 -0.62297027 -1.66411398 0.26303414 -2.33763864 0.57337181
145 146 147 148 149 150
-1.02403967 1.92586853 0.65298042 0.53495092 -0.27647103 1.85782240
151 152 153 154 155 156
1.59112913 0.40022713 -0.33646733 0.12309031 0.37375740 -3.29944534
> postscript(file="/var/www/html/rcomp/tmp/6oej81290525782.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.50195929 NA
1 0.25259656 -2.50195929
2 -0.10362459 0.25259656
3 1.43935622 -0.10362459
4 0.60301589 1.43935622
5 -1.49986919 0.60301589
6 1.25007667 -1.49986919
7 -0.30666227 1.25007667
8 -1.51814644 -0.30666227
9 0.07017090 -1.51814644
10 0.28384922 0.07017090
11 1.23711250 0.28384922
12 -0.77266558 1.23711250
13 -0.20951567 -0.77266558
14 1.54520421 -0.20951567
15 -0.82607122 1.54520421
16 1.38887076 -0.82607122
17 -0.24686164 1.38887076
18 0.21932352 -0.24686164
19 0.25430487 0.21932352
20 -2.56062231 0.25430487
21 0.84648459 -2.56062231
22 0.08870504 0.84648459
23 -0.36271090 0.08870504
24 0.20803506 -0.36271090
25 -0.61208258 0.20803506
26 1.66561029 -0.61208258
27 -0.76389617 1.66561029
28 0.25620005 -0.76389617
29 -1.52366752 0.25620005
30 -0.22732136 -1.52366752
31 1.57541777 -0.22732136
32 1.01590932 1.57541777
33 -0.69109449 1.01590932
34 -0.31978293 -0.69109449
35 -0.52165204 -0.31978293
36 0.73663218 -0.52165204
37 1.02418915 0.73663218
38 0.43841027 1.02418915
39 0.33049876 0.43841027
40 0.40740517 0.33049876
41 -1.68862323 0.40740517
42 -0.48035940 -1.68862323
43 -0.23288337 -0.48035940
44 1.51121194 -0.23288337
45 0.93011182 1.51121194
46 -1.43170746 0.93011182
47 0.69122568 -1.43170746
48 0.25744814 0.69122568
49 -0.19121453 0.25744814
50 1.84787900 -0.19121453
51 1.65848284 1.84787900
52 -0.33238294 1.65848284
53 -0.15592080 -0.33238294
54 -0.57881597 -0.15592080
55 -0.41566287 -0.57881597
56 -0.95007442 -0.41566287
57 -0.71941268 -0.95007442
58 -2.67788882 -0.71941268
59 1.72444582 -2.67788882
60 -0.85922903 1.72444582
61 -0.36779919 -0.85922903
62 -0.14056278 -0.36779919
63 -0.32811334 -0.14056278
64 0.97584996 -0.32811334
65 -0.60474359 0.97584996
66 0.79609459 -0.60474359
67 0.31581387 0.79609459
68 0.23961054 0.31581387
69 -0.07843381 0.23961054
70 -0.88551618 -0.07843381
71 -0.45347128 -0.88551618
72 -0.10492344 -0.45347128
73 0.04324563 -0.10492344
74 0.76166722 0.04324563
75 0.49162762 0.76166722
76 -0.23879811 0.49162762
77 -0.38452762 -0.23879811
78 -1.23910305 -0.38452762
79 -1.36122336 -1.23910305
80 0.23462462 -1.36122336
81 0.40989362 0.23462462
82 -0.07130310 0.40989362
83 0.31514776 -0.07130310
84 -1.48530197 0.31514776
85 0.96397365 -1.48530197
86 0.09098885 0.96397365
87 -0.49463476 0.09098885
88 1.65973790 -0.49463476
89 -0.46004047 1.65973790
90 0.23552727 -0.46004047
91 0.68698081 0.23552727
92 0.32532555 0.68698081
93 -0.12442052 0.32532555
94 0.02200843 -0.12442052
95 -0.19289595 0.02200843
96 2.13456315 -0.19289595
97 -0.61543160 2.13456315
98 -0.63592801 -0.61543160
99 0.74006743 -0.63592801
100 0.19728312 0.74006743
101 0.57043005 0.19728312
102 -0.72537705 0.57043005
103 -1.37322872 -0.72537705
104 -0.75310970 -1.37322872
105 2.26940234 -0.75310970
106 -1.68774649 2.26940234
107 1.85530822 -1.68774649
108 -1.57686311 1.85530822
109 -0.68142829 -1.57686311
110 -0.24754438 -0.68142829
111 1.39180475 -0.24754438
112 1.45641674 1.39180475
113 0.08011999 1.45641674
114 0.88311329 0.08011999
115 -0.20747736 0.88311329
116 -0.18738115 -0.20747736
117 0.91269813 -0.18738115
118 0.01645032 0.91269813
119 -1.40208902 0.01645032
120 -1.21952217 -1.40208902
121 -0.81735155 -1.21952217
122 -0.16770080 -0.81735155
123 0.18879075 -0.16770080
124 -0.29484141 0.18879075
125 0.25357863 -0.29484141
126 1.51594855 0.25357863
127 0.46635820 1.51594855
128 -0.09031049 0.46635820
129 1.86186428 -0.09031049
130 1.51400475 1.86186428
131 0.29198616 1.51400475
132 -0.94040310 0.29198616
133 0.45231648 -0.94040310
134 0.06163242 0.45231648
135 -0.91609346 0.06163242
136 -0.01287895 -0.91609346
137 -1.41451051 -0.01287895
138 -0.91011417 -1.41451051
139 -0.62297027 -0.91011417
140 -1.66411398 -0.62297027
141 0.26303414 -1.66411398
142 -2.33763864 0.26303414
143 0.57337181 -2.33763864
144 -1.02403967 0.57337181
145 1.92586853 -1.02403967
146 0.65298042 1.92586853
147 0.53495092 0.65298042
148 -0.27647103 0.53495092
149 1.85782240 -0.27647103
150 1.59112913 1.85782240
151 0.40022713 1.59112913
152 -0.33646733 0.40022713
153 0.12309031 -0.33646733
154 0.37375740 0.12309031
155 -3.29944534 0.37375740
156 NA -3.29944534
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.25259656 -2.50195929
[2,] -0.10362459 0.25259656
[3,] 1.43935622 -0.10362459
[4,] 0.60301589 1.43935622
[5,] -1.49986919 0.60301589
[6,] 1.25007667 -1.49986919
[7,] -0.30666227 1.25007667
[8,] -1.51814644 -0.30666227
[9,] 0.07017090 -1.51814644
[10,] 0.28384922 0.07017090
[11,] 1.23711250 0.28384922
[12,] -0.77266558 1.23711250
[13,] -0.20951567 -0.77266558
[14,] 1.54520421 -0.20951567
[15,] -0.82607122 1.54520421
[16,] 1.38887076 -0.82607122
[17,] -0.24686164 1.38887076
[18,] 0.21932352 -0.24686164
[19,] 0.25430487 0.21932352
[20,] -2.56062231 0.25430487
[21,] 0.84648459 -2.56062231
[22,] 0.08870504 0.84648459
[23,] -0.36271090 0.08870504
[24,] 0.20803506 -0.36271090
[25,] -0.61208258 0.20803506
[26,] 1.66561029 -0.61208258
[27,] -0.76389617 1.66561029
[28,] 0.25620005 -0.76389617
[29,] -1.52366752 0.25620005
[30,] -0.22732136 -1.52366752
[31,] 1.57541777 -0.22732136
[32,] 1.01590932 1.57541777
[33,] -0.69109449 1.01590932
[34,] -0.31978293 -0.69109449
[35,] -0.52165204 -0.31978293
[36,] 0.73663218 -0.52165204
[37,] 1.02418915 0.73663218
[38,] 0.43841027 1.02418915
[39,] 0.33049876 0.43841027
[40,] 0.40740517 0.33049876
[41,] -1.68862323 0.40740517
[42,] -0.48035940 -1.68862323
[43,] -0.23288337 -0.48035940
[44,] 1.51121194 -0.23288337
[45,] 0.93011182 1.51121194
[46,] -1.43170746 0.93011182
[47,] 0.69122568 -1.43170746
[48,] 0.25744814 0.69122568
[49,] -0.19121453 0.25744814
[50,] 1.84787900 -0.19121453
[51,] 1.65848284 1.84787900
[52,] -0.33238294 1.65848284
[53,] -0.15592080 -0.33238294
[54,] -0.57881597 -0.15592080
[55,] -0.41566287 -0.57881597
[56,] -0.95007442 -0.41566287
[57,] -0.71941268 -0.95007442
[58,] -2.67788882 -0.71941268
[59,] 1.72444582 -2.67788882
[60,] -0.85922903 1.72444582
[61,] -0.36779919 -0.85922903
[62,] -0.14056278 -0.36779919
[63,] -0.32811334 -0.14056278
[64,] 0.97584996 -0.32811334
[65,] -0.60474359 0.97584996
[66,] 0.79609459 -0.60474359
[67,] 0.31581387 0.79609459
[68,] 0.23961054 0.31581387
[69,] -0.07843381 0.23961054
[70,] -0.88551618 -0.07843381
[71,] -0.45347128 -0.88551618
[72,] -0.10492344 -0.45347128
[73,] 0.04324563 -0.10492344
[74,] 0.76166722 0.04324563
[75,] 0.49162762 0.76166722
[76,] -0.23879811 0.49162762
[77,] -0.38452762 -0.23879811
[78,] -1.23910305 -0.38452762
[79,] -1.36122336 -1.23910305
[80,] 0.23462462 -1.36122336
[81,] 0.40989362 0.23462462
[82,] -0.07130310 0.40989362
[83,] 0.31514776 -0.07130310
[84,] -1.48530197 0.31514776
[85,] 0.96397365 -1.48530197
[86,] 0.09098885 0.96397365
[87,] -0.49463476 0.09098885
[88,] 1.65973790 -0.49463476
[89,] -0.46004047 1.65973790
[90,] 0.23552727 -0.46004047
[91,] 0.68698081 0.23552727
[92,] 0.32532555 0.68698081
[93,] -0.12442052 0.32532555
[94,] 0.02200843 -0.12442052
[95,] -0.19289595 0.02200843
[96,] 2.13456315 -0.19289595
[97,] -0.61543160 2.13456315
[98,] -0.63592801 -0.61543160
[99,] 0.74006743 -0.63592801
[100,] 0.19728312 0.74006743
[101,] 0.57043005 0.19728312
[102,] -0.72537705 0.57043005
[103,] -1.37322872 -0.72537705
[104,] -0.75310970 -1.37322872
[105,] 2.26940234 -0.75310970
[106,] -1.68774649 2.26940234
[107,] 1.85530822 -1.68774649
[108,] -1.57686311 1.85530822
[109,] -0.68142829 -1.57686311
[110,] -0.24754438 -0.68142829
[111,] 1.39180475 -0.24754438
[112,] 1.45641674 1.39180475
[113,] 0.08011999 1.45641674
[114,] 0.88311329 0.08011999
[115,] -0.20747736 0.88311329
[116,] -0.18738115 -0.20747736
[117,] 0.91269813 -0.18738115
[118,] 0.01645032 0.91269813
[119,] -1.40208902 0.01645032
[120,] -1.21952217 -1.40208902
[121,] -0.81735155 -1.21952217
[122,] -0.16770080 -0.81735155
[123,] 0.18879075 -0.16770080
[124,] -0.29484141 0.18879075
[125,] 0.25357863 -0.29484141
[126,] 1.51594855 0.25357863
[127,] 0.46635820 1.51594855
[128,] -0.09031049 0.46635820
[129,] 1.86186428 -0.09031049
[130,] 1.51400475 1.86186428
[131,] 0.29198616 1.51400475
[132,] -0.94040310 0.29198616
[133,] 0.45231648 -0.94040310
[134,] 0.06163242 0.45231648
[135,] -0.91609346 0.06163242
[136,] -0.01287895 -0.91609346
[137,] -1.41451051 -0.01287895
[138,] -0.91011417 -1.41451051
[139,] -0.62297027 -0.91011417
[140,] -1.66411398 -0.62297027
[141,] 0.26303414 -1.66411398
[142,] -2.33763864 0.26303414
[143,] 0.57337181 -2.33763864
[144,] -1.02403967 0.57337181
[145,] 1.92586853 -1.02403967
[146,] 0.65298042 1.92586853
[147,] 0.53495092 0.65298042
[148,] -0.27647103 0.53495092
[149,] 1.85782240 -0.27647103
[150,] 1.59112913 1.85782240
[151,] 0.40022713 1.59112913
[152,] -0.33646733 0.40022713
[153,] 0.12309031 -0.33646733
[154,] 0.37375740 0.12309031
[155,] -3.29944534 0.37375740
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.25259656 -2.50195929
2 -0.10362459 0.25259656
3 1.43935622 -0.10362459
4 0.60301589 1.43935622
5 -1.49986919 0.60301589
6 1.25007667 -1.49986919
7 -0.30666227 1.25007667
8 -1.51814644 -0.30666227
9 0.07017090 -1.51814644
10 0.28384922 0.07017090
11 1.23711250 0.28384922
12 -0.77266558 1.23711250
13 -0.20951567 -0.77266558
14 1.54520421 -0.20951567
15 -0.82607122 1.54520421
16 1.38887076 -0.82607122
17 -0.24686164 1.38887076
18 0.21932352 -0.24686164
19 0.25430487 0.21932352
20 -2.56062231 0.25430487
21 0.84648459 -2.56062231
22 0.08870504 0.84648459
23 -0.36271090 0.08870504
24 0.20803506 -0.36271090
25 -0.61208258 0.20803506
26 1.66561029 -0.61208258
27 -0.76389617 1.66561029
28 0.25620005 -0.76389617
29 -1.52366752 0.25620005
30 -0.22732136 -1.52366752
31 1.57541777 -0.22732136
32 1.01590932 1.57541777
33 -0.69109449 1.01590932
34 -0.31978293 -0.69109449
35 -0.52165204 -0.31978293
36 0.73663218 -0.52165204
37 1.02418915 0.73663218
38 0.43841027 1.02418915
39 0.33049876 0.43841027
40 0.40740517 0.33049876
41 -1.68862323 0.40740517
42 -0.48035940 -1.68862323
43 -0.23288337 -0.48035940
44 1.51121194 -0.23288337
45 0.93011182 1.51121194
46 -1.43170746 0.93011182
47 0.69122568 -1.43170746
48 0.25744814 0.69122568
49 -0.19121453 0.25744814
50 1.84787900 -0.19121453
51 1.65848284 1.84787900
52 -0.33238294 1.65848284
53 -0.15592080 -0.33238294
54 -0.57881597 -0.15592080
55 -0.41566287 -0.57881597
56 -0.95007442 -0.41566287
57 -0.71941268 -0.95007442
58 -2.67788882 -0.71941268
59 1.72444582 -2.67788882
60 -0.85922903 1.72444582
61 -0.36779919 -0.85922903
62 -0.14056278 -0.36779919
63 -0.32811334 -0.14056278
64 0.97584996 -0.32811334
65 -0.60474359 0.97584996
66 0.79609459 -0.60474359
67 0.31581387 0.79609459
68 0.23961054 0.31581387
69 -0.07843381 0.23961054
70 -0.88551618 -0.07843381
71 -0.45347128 -0.88551618
72 -0.10492344 -0.45347128
73 0.04324563 -0.10492344
74 0.76166722 0.04324563
75 0.49162762 0.76166722
76 -0.23879811 0.49162762
77 -0.38452762 -0.23879811
78 -1.23910305 -0.38452762
79 -1.36122336 -1.23910305
80 0.23462462 -1.36122336
81 0.40989362 0.23462462
82 -0.07130310 0.40989362
83 0.31514776 -0.07130310
84 -1.48530197 0.31514776
85 0.96397365 -1.48530197
86 0.09098885 0.96397365
87 -0.49463476 0.09098885
88 1.65973790 -0.49463476
89 -0.46004047 1.65973790
90 0.23552727 -0.46004047
91 0.68698081 0.23552727
92 0.32532555 0.68698081
93 -0.12442052 0.32532555
94 0.02200843 -0.12442052
95 -0.19289595 0.02200843
96 2.13456315 -0.19289595
97 -0.61543160 2.13456315
98 -0.63592801 -0.61543160
99 0.74006743 -0.63592801
100 0.19728312 0.74006743
101 0.57043005 0.19728312
102 -0.72537705 0.57043005
103 -1.37322872 -0.72537705
104 -0.75310970 -1.37322872
105 2.26940234 -0.75310970
106 -1.68774649 2.26940234
107 1.85530822 -1.68774649
108 -1.57686311 1.85530822
109 -0.68142829 -1.57686311
110 -0.24754438 -0.68142829
111 1.39180475 -0.24754438
112 1.45641674 1.39180475
113 0.08011999 1.45641674
114 0.88311329 0.08011999
115 -0.20747736 0.88311329
116 -0.18738115 -0.20747736
117 0.91269813 -0.18738115
118 0.01645032 0.91269813
119 -1.40208902 0.01645032
120 -1.21952217 -1.40208902
121 -0.81735155 -1.21952217
122 -0.16770080 -0.81735155
123 0.18879075 -0.16770080
124 -0.29484141 0.18879075
125 0.25357863 -0.29484141
126 1.51594855 0.25357863
127 0.46635820 1.51594855
128 -0.09031049 0.46635820
129 1.86186428 -0.09031049
130 1.51400475 1.86186428
131 0.29198616 1.51400475
132 -0.94040310 0.29198616
133 0.45231648 -0.94040310
134 0.06163242 0.45231648
135 -0.91609346 0.06163242
136 -0.01287895 -0.91609346
137 -1.41451051 -0.01287895
138 -0.91011417 -1.41451051
139 -0.62297027 -0.91011417
140 -1.66411398 -0.62297027
141 0.26303414 -1.66411398
142 -2.33763864 0.26303414
143 0.57337181 -2.33763864
144 -1.02403967 0.57337181
145 1.92586853 -1.02403967
146 0.65298042 1.92586853
147 0.53495092 0.65298042
148 -0.27647103 0.53495092
149 1.85782240 -0.27647103
150 1.59112913 1.85782240
151 0.40022713 1.59112913
152 -0.33646733 0.40022713
153 0.12309031 -0.33646733
154 0.37375740 0.12309031
155 -3.29944534 0.37375740
> 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/html/rcomp/tmp/7hn0b1290525782.ps",horizontal=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/html/rcomp/tmp/8sxzw1290525782.ps",horizontal=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/html/rcomp/tmp/9sxzw1290525782.ps",horizontal=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/html/rcomp/tmp/10sxzw1290525782.ps",horizontal=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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/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/html/rcomp/tmp/1166fn1290525782.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/html/rcomp/tmp/12ygeq1290525782.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/html/rcomp/tmp/135zt21290525782.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/html/rcomp/tmp/14jrc21290525783.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/html/rcomp/tmp/15u0c51290525783.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/html/rcomp/tmp/16qs9w1290525783.tab")
+ }
> try(system("convert tmp/1v5151290525782.ps tmp/1v5151290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/2v5151290525782.ps tmp/2v5151290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/3v5151290525782.ps tmp/3v5151290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/4oej81290525782.ps tmp/4oej81290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/5oej81290525782.ps tmp/5oej81290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/6oej81290525782.ps tmp/6oej81290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/7hn0b1290525782.ps tmp/7hn0b1290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/8sxzw1290525782.ps tmp/8sxzw1290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/9sxzw1290525782.ps tmp/9sxzw1290525782.png",intern=TRUE))
character(0)
> try(system("convert tmp/10sxzw1290525782.ps tmp/10sxzw1290525782.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.979 1.819 9.050