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(9
+ ,13
+ ,14
+ ,13
+ ,3
+ ,9
+ ,12
+ ,8
+ ,13
+ ,5
+ ,9
+ ,15
+ ,12
+ ,16
+ ,6
+ ,9
+ ,12
+ ,7
+ ,12
+ ,6
+ ,9
+ ,10
+ ,10
+ ,11
+ ,5
+ ,9
+ ,12
+ ,7
+ ,12
+ ,3
+ ,9
+ ,15
+ ,16
+ ,18
+ ,8
+ ,9
+ ,9
+ ,11
+ ,11
+ ,4
+ ,9
+ ,12
+ ,14
+ ,14
+ ,4
+ ,9
+ ,11
+ ,6
+ ,9
+ ,4
+ ,9
+ ,11
+ ,16
+ ,14
+ ,6
+ ,9
+ ,11
+ ,11
+ ,12
+ ,6
+ ,9
+ ,15
+ ,16
+ ,11
+ ,5
+ ,9
+ ,7
+ ,12
+ ,12
+ ,4
+ ,9
+ ,11
+ ,7
+ ,13
+ ,6
+ ,9
+ ,11
+ ,13
+ ,11
+ ,4
+ ,9
+ ,10
+ ,11
+ ,12
+ ,6
+ ,9
+ ,14
+ ,15
+ ,16
+ ,6
+ ,9
+ ,10
+ ,7
+ ,9
+ ,4
+ ,9
+ ,6
+ ,9
+ ,11
+ ,4
+ ,9
+ ,11
+ ,7
+ ,13
+ ,2
+ ,9
+ ,15
+ ,14
+ ,15
+ ,7
+ ,9
+ ,11
+ ,15
+ ,10
+ ,5
+ ,9
+ ,12
+ ,7
+ ,11
+ ,4
+ ,9
+ ,14
+ ,15
+ ,13
+ ,6
+ ,9
+ ,15
+ ,17
+ ,16
+ ,6
+ ,9
+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j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> #'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
Popularity Tijd KnowingPeople Liked Celebrity
1 13 9 14 13 3
2 12 9 8 13 5
3 15 9 12 16 6
4 12 9 7 12 6
5 10 9 10 11 5
6 12 9 7 12 3
7 15 9 16 18 8
8 9 9 11 11 4
9 12 9 14 14 4
10 11 9 6 9 4
11 11 9 16 14 6
12 11 9 11 12 6
13 15 9 16 11 5
14 7 9 12 12 4
15 11 9 7 13 6
16 11 9 13 11 4
17 10 9 11 12 6
18 14 9 15 16 6
19 10 9 7 9 4
20 6 9 9 11 4
21 11 9 7 13 2
22 15 9 14 15 7
23 11 9 15 10 5
24 12 9 7 11 4
25 14 9 15 13 6
26 15 9 17 16 6
27 9 9 15 15 7
28 13 9 14 14 5
29 13 9 14 14 6
30 16 9 8 14 4
31 13 9 8 8 4
32 12 9 14 13 7
33 14 9 14 15 7
34 11 9 8 13 4
35 9 9 11 11 4
36 16 9 16 15 6
37 12 9 10 15 6
38 10 9 8 9 5
39 13 9 14 13 6
40 16 9 16 16 7
41 14 9 13 13 6
42 15 9 5 11 3
43 5 9 8 12 3
44 8 9 10 12 4
45 11 9 8 12 6
46 16 9 13 14 7
47 17 9 15 14 5
48 9 9 6 8 4
49 9 9 12 13 5
50 13 9 16 16 6
51 10 9 5 13 6
52 6 10 15 11 6
53 12 10 12 14 5
54 8 10 8 13 4
55 14 10 13 13 5
56 12 10 14 13 5
57 11 10 12 12 4
58 16 10 16 16 6
59 8 10 10 15 2
60 15 10 15 15 8
61 7 10 8 12 3
62 16 10 16 14 6
63 14 10 19 12 6
64 16 10 14 15 6
65 9 10 6 12 5
66 14 10 13 13 5
67 11 10 15 12 6
68 13 10 7 12 5
69 15 10 13 13 6
70 5 10 4 5 2
71 15 10 14 13 5
72 13 10 13 13 5
73 11 10 11 14 5
74 11 10 14 17 6
75 12 10 12 13 6
76 12 10 15 13 6
77 12 10 14 12 5
78 12 10 13 13 5
79 14 10 8 14 4
80 6 10 6 11 2
81 7 10 7 12 4
82 14 10 13 12 6
83 14 10 13 16 6
84 10 10 11 12 5
85 13 10 5 12 3
86 12 10 12 12 6
87 9 10 8 10 4
88 12 10 11 15 5
89 16 10 14 15 8
90 10 10 9 12 4
91 14 10 10 16 6
92 10 10 13 15 6
93 16 10 16 16 7
94 15 10 16 13 6
95 12 10 11 12 5
96 10 10 8 11 4
97 8 10 4 13 6
98 8 10 7 10 3
99 11 10 14 15 5
100 13 10 11 13 6
101 16 10 17 16 7
102 16 10 15 15 7
103 14 10 17 18 6
104 11 10 5 13 3
105 4 10 4 10 2
106 14 10 10 16 8
107 9 10 11 13 3
108 14 10 15 15 8
109 8 10 10 14 3
110 8 10 9 15 4
111 11 10 12 14 5
112 12 10 15 13 7
113 11 10 7 13 6
114 14 10 13 15 6
115 15 10 12 16 7
116 16 10 14 14 6
117 16 10 14 14 6
118 11 10 8 16 6
119 14 10 15 14 6
120 14 10 12 12 4
121 12 10 12 13 4
122 14 10 16 12 5
123 8 10 9 12 4
124 13 10 15 14 6
125 16 10 15 14 6
126 12 10 6 14 5
127 16 10 14 16 8
128 12 10 15 13 6
129 11 10 10 14 5
130 4 10 6 4 4
131 16 10 14 16 8
132 15 10 12 13 6
133 10 10 8 16 4
134 13 10 11 15 6
135 15 10 13 14 6
136 12 10 9 13 4
137 14 10 15 14 6
138 7 10 13 12 3
139 19 10 15 15 6
140 12 10 14 14 5
141 12 10 16 13 4
142 13 10 14 14 6
143 15 10 14 16 4
144 8 10 10 6 4
145 12 10 10 13 4
146 10 10 4 13 6
147 8 10 8 14 5
148 10 10 15 15 6
149 15 10 16 14 6
150 16 10 12 15 8
151 13 10 12 13 7
152 16 10 15 16 7
153 9 10 9 12 4
154 14 10 12 15 6
155 14 10 14 12 6
156 12 10 11 14 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Tijd KnowingPeople Liked Celebrity
3.4951 -0.2404 0.2424 0.3658 0.6216
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.48034 -1.21616 -0.06998 1.28152 6.56801
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.49514 3.53926 0.988 0.324960
Tijd -0.24040 0.36368 -0.661 0.509611
KnowingPeople 0.24239 0.06146 3.944 0.000122 ***
Liked 0.36579 0.09710 3.767 0.000236 ***
Celebrity 0.62160 0.15643 3.974 0.000109 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.109 on 151 degrees of freedom
Multiple R-squared: 0.4974, Adjusted R-squared: 0.4841
F-statistic: 37.36 on 4 and 151 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.12751496 0.25502991 0.872485043
[2,] 0.06353130 0.12706260 0.936468700
[3,] 0.08477512 0.16955024 0.915224878
[4,] 0.04338533 0.08677066 0.956614670
[5,] 0.01961127 0.03922254 0.980388729
[6,] 0.34657163 0.69314326 0.653428369
[7,] 0.69673960 0.60652079 0.303260397
[8,] 0.62150073 0.75699855 0.378499275
[9,] 0.53098606 0.93802789 0.469013943
[10,] 0.48792599 0.97585197 0.512074014
[11,] 0.40668369 0.81336737 0.593316313
[12,] 0.33246853 0.66493705 0.667531474
[13,] 0.59979977 0.80040046 0.400200228
[14,] 0.53163657 0.93672685 0.468363426
[15,] 0.49896659 0.99793318 0.501033409
[16,] 0.42976827 0.85953654 0.570231731
[17,] 0.41645115 0.83290230 0.583548851
[18,] 0.38330009 0.76660019 0.616699907
[19,] 0.32799546 0.65599091 0.672004544
[20,] 0.59893390 0.80213220 0.401066101
[21,] 0.53823734 0.92352533 0.461762663
[22,] 0.47861544 0.95723089 0.521384555
[23,] 0.64876620 0.70246760 0.351233802
[24,] 0.77307784 0.45384433 0.226922164
[25,] 0.73612372 0.52775256 0.263876278
[26,] 0.69420878 0.61158244 0.305791222
[27,] 0.64922180 0.70155639 0.350778195
[28,] 0.63871823 0.72256354 0.361281772
[29,] 0.65730373 0.68539254 0.342696271
[30,] 0.61616363 0.76767275 0.383836374
[31,] 0.56177394 0.87645212 0.438226061
[32,] 0.51172277 0.97655445 0.488277227
[33,] 0.49367470 0.98734940 0.506325300
[34,] 0.46621379 0.93242758 0.533786208
[35,] 0.75347745 0.49304511 0.246522553
[36,] 0.92911516 0.14176968 0.070884838
[37,] 0.94352360 0.11295281 0.056476403
[38,] 0.92846359 0.14307282 0.071536411
[39,] 0.93460523 0.13078954 0.065394768
[40,] 0.96973403 0.06053195 0.030265975
[41,] 0.96700998 0.06598005 0.032990024
[42,] 0.97097436 0.05805127 0.029025636
[43,] 0.96414649 0.07170703 0.035853514
[44,] 0.95731106 0.08537789 0.042688943
[45,] 0.98467980 0.03064040 0.015320201
[46,] 0.98772791 0.02454418 0.012272088
[47,] 0.98514450 0.02971099 0.014855497
[48,] 0.99122550 0.01754900 0.008774500
[49,] 0.98900185 0.02199630 0.010998148
[50,] 0.98563006 0.02873987 0.014369937
[51,] 0.98627857 0.02744287 0.013721433
[52,] 0.98769075 0.02461850 0.012309248
[53,] 0.98549287 0.02901425 0.014507127
[54,] 0.98525408 0.02949183 0.014745915
[55,] 0.98845098 0.02309804 0.011549018
[56,] 0.98584124 0.02831751 0.014158756
[57,] 0.98767830 0.02464340 0.012321702
[58,] 0.98417664 0.03164672 0.015823361
[59,] 0.98379099 0.03241803 0.016209014
[60,] 0.98256503 0.03486995 0.017434973
[61,] 0.98634280 0.02731441 0.013657205
[62,] 0.98719296 0.02561407 0.012807037
[63,] 0.98334375 0.03331250 0.016656251
[64,] 0.98589488 0.02821023 0.014105115
[65,] 0.98194758 0.03610485 0.018052424
[66,] 0.97758452 0.04483096 0.022415478
[67,] 0.98688415 0.02623170 0.013115852
[68,] 0.98261361 0.03477279 0.017386394
[69,] 0.97935038 0.04129924 0.020649622
[70,] 0.97283082 0.05433837 0.027169183
[71,] 0.96464358 0.07071284 0.035356418
[72,] 0.97843363 0.04313273 0.021566365
[73,] 0.97694292 0.04611417 0.023057083
[74,] 0.97971715 0.04056570 0.020282852
[75,] 0.97744990 0.04510020 0.022550102
[76,] 0.97041878 0.05916244 0.029581218
[77,] 0.96472976 0.07054048 0.035270241
[78,] 0.99112270 0.01775461 0.008877303
[79,] 0.98784217 0.02431565 0.012157825
[80,] 0.98371838 0.03256324 0.016281622
[81,] 0.97827447 0.04345105 0.021725527
[82,] 0.97292336 0.05415327 0.027076635
[83,] 0.96475448 0.07049104 0.035245518
[84,] 0.95706530 0.08586940 0.042934702
[85,] 0.97583105 0.04833790 0.024168950
[86,] 0.96920579 0.06158842 0.030794210
[87,] 0.96393902 0.07212197 0.036060983
[88,] 0.95498252 0.09003496 0.045017482
[89,] 0.94507504 0.10984993 0.054924964
[90,] 0.94607268 0.10785463 0.053927317
[91,] 0.93265195 0.13469609 0.067348047
[92,] 0.93592555 0.12814890 0.064074452
[93,] 0.92147686 0.15704629 0.078523145
[94,] 0.90370584 0.19258832 0.096294159
[95,] 0.88809679 0.22380642 0.111903212
[96,] 0.89390237 0.21219527 0.106097635
[97,] 0.92130195 0.15739611 0.078698053
[98,] 0.92050788 0.15898425 0.079492123
[99,] 0.90052160 0.19895680 0.099478399
[100,] 0.88358944 0.23282111 0.116410557
[101,] 0.88253461 0.23493078 0.117465390
[102,] 0.88603615 0.22792771 0.113963854
[103,] 0.91644659 0.16710682 0.083553410
[104,] 0.90606068 0.18787864 0.093939322
[105,] 0.91673275 0.16653450 0.083267251
[106,] 0.89383139 0.21233723 0.106168613
[107,] 0.86754585 0.26490829 0.132454147
[108,] 0.83753628 0.32492744 0.162463721
[109,] 0.84319491 0.31361018 0.156805091
[110,] 0.84976306 0.30047388 0.150236941
[111,] 0.83666766 0.32666467 0.163332335
[112,] 0.80000072 0.39999855 0.199999275
[113,] 0.85480333 0.29039334 0.145196672
[114,] 0.82397627 0.35204745 0.176023725
[115,] 0.79928108 0.40143783 0.200718917
[116,] 0.78837360 0.42325280 0.211626402
[117,] 0.75590645 0.48818710 0.244093550
[118,] 0.75080716 0.49838568 0.249192841
[119,] 0.72873745 0.54252509 0.271262546
[120,] 0.67555085 0.64889830 0.324449151
[121,] 0.65724411 0.68551178 0.342755890
[122,] 0.60132968 0.79734064 0.398670318
[123,] 0.56186650 0.87626701 0.438133504
[124,] 0.49779025 0.99558050 0.502209749
[125,] 0.50592646 0.98814708 0.494073542
[126,] 0.45971042 0.91942085 0.540289575
[127,] 0.39064433 0.78128865 0.609355675
[128,] 0.35498248 0.70996497 0.645017516
[129,] 0.33167068 0.66334135 0.668329323
[130,] 0.26495672 0.52991344 0.735043280
[131,] 0.38130622 0.76261244 0.618693778
[132,] 0.67663022 0.64673957 0.323369783
[133,] 0.61306933 0.77386134 0.386930670
[134,] 0.54331741 0.91336518 0.456682588
[135,] 0.45615499 0.91230999 0.543845006
[136,] 0.40547170 0.81094341 0.594528296
[137,] 0.31255199 0.62510398 0.687448009
[138,] 0.24883983 0.49767967 0.751160166
[139,] 0.17612328 0.35224656 0.823876718
[140,] 0.20902107 0.41804214 0.790978932
[141,] 0.84812265 0.30375469 0.151877347
> postscript(file="/var/www/html/rcomp/tmp/1397p1291551726.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/html/rcomp/tmp/2397p1291551726.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/html/rcomp/tmp/3397p1291551726.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/html/rcomp/tmp/4e06a1291551726.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/html/rcomp/tmp/5e06a1291551726.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 = 156
Frequency = 1
1 2 3 4 5 6
1.654892175 0.866053285 1.177519382 0.852632251 -0.887162320 2.717434665
7 8 9 10 11 12
-1.766829341 -1.507955302 -0.332494614 2.435585599 -3.060483796 -1.116942895
13 14 15 16 17 18
2.658474961 -4.116135073 -0.513153733 0.007257125 -2.116942895 -0.549661978
19 20 21 22 23 24
1.193191812 -4.023167729 1.973249485 0.436916988 -0.733345269 2.461619844
25 26 27 28 29 30
0.547695975 -0.034449551 -5.805476798 0.045904582 -0.575696223 5.121868106
31 32 33 34 35 36
4.316584010 -1.831511043 -0.563083012 0.487654090 -1.507955302 1.573730220
37 38 39 40 41 42
-0.971907061 0.329197221 -0.209910239 0.586343431 1.032483548 6.568008222
43 44 45 46 47 48
-4.524959122 -2.631347499 -0.389761535 2.045096759 3.803510795 0.801371583
49 50 51 52 53 54
-3.103521861 -1.792055764 -1.028366160 -6.480335718 -0.228911506 -2.271949571
55 56 57 58 59 60
1.894480692 -0.347913095 0.124261267 1.448340576 -2.245107503 -0.186681263
61 62 63 64 65 66
-2.284562782 2.179912544 0.184303152 2.298914133 -1.042976818 1.894480692
67 68 69 70 71 72
-1.846121702 2.714629395 2.272879887 -0.132884943 2.652086905 0.894480692
73 74 75 76 77 78
-0.986517719 -3.432657835 -0.484726326 -1.211907686 0.017872889 -0.105519308
79 80 81 82 83 84
3.362264445 -1.812388420 -2.663769800 1.638665871 0.175521935 -1.254945751
85 86 87 88 89 90
4.442618578 -0.118940342 -0.174591619 -0.352303703 1.055712524 -0.148557373
91 92 93 94 95 96
0.902703295 -3.458692081 0.826739771 1.545698528 0.745054249 0.459622397
97 98 99 100 101 102
-2.545576034 -0.310597027 -2.079485063 0.757667460 0.584345984 1.434919542
103 104 105 106 107 108
-1.525625179 2.076832594 -2.961814863 -0.340498314 -1.377530126 -1.186681263
109 110 111 112 113 114
-2.500922323 -3.245915325 -1.228911506 -1.833508490 -0.272757393 0.541307919
115 116 117 118 119 120
0.796314917 2.664700117 2.664700117 -1.612509132 0.422306330 3.124261267
121 122 123 124 125 126
0.758475283 1.533085316 -2.148557373 -0.577693670 2.422306330 1.225451214
127 128 129 130 131 132
0.689926540 -1.211907686 -0.744123932 -2.495088141 0.689926540 2.515273674
133 134 135 136 137 138
-1.369307523 0.026095492 1.907093903 1.485656643 0.422306330 -3.496531715
139 140 141 142 143 144
5.056520346 -0.713699079 -0.211099863 -0.335299883 2.176329758 -0.196235255
145 146 147 148 149 150
1.243262856 -0.545576034 -3.259336359 -3.943479654 1.179912544 1.540500097
151 152 153 154 155 156
-0.106327131 1.069133558 -1.148557373 0.783701706 1.396272085 1.878284695
> postscript(file="/var/www/html/rcomp/tmp/6prnd1291551726.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 = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 1.654892175 NA
1 0.866053285 1.654892175
2 1.177519382 0.866053285
3 0.852632251 1.177519382
4 -0.887162320 0.852632251
5 2.717434665 -0.887162320
6 -1.766829341 2.717434665
7 -1.507955302 -1.766829341
8 -0.332494614 -1.507955302
9 2.435585599 -0.332494614
10 -3.060483796 2.435585599
11 -1.116942895 -3.060483796
12 2.658474961 -1.116942895
13 -4.116135073 2.658474961
14 -0.513153733 -4.116135073
15 0.007257125 -0.513153733
16 -2.116942895 0.007257125
17 -0.549661978 -2.116942895
18 1.193191812 -0.549661978
19 -4.023167729 1.193191812
20 1.973249485 -4.023167729
21 0.436916988 1.973249485
22 -0.733345269 0.436916988
23 2.461619844 -0.733345269
24 0.547695975 2.461619844
25 -0.034449551 0.547695975
26 -5.805476798 -0.034449551
27 0.045904582 -5.805476798
28 -0.575696223 0.045904582
29 5.121868106 -0.575696223
30 4.316584010 5.121868106
31 -1.831511043 4.316584010
32 -0.563083012 -1.831511043
33 0.487654090 -0.563083012
34 -1.507955302 0.487654090
35 1.573730220 -1.507955302
36 -0.971907061 1.573730220
37 0.329197221 -0.971907061
38 -0.209910239 0.329197221
39 0.586343431 -0.209910239
40 1.032483548 0.586343431
41 6.568008222 1.032483548
42 -4.524959122 6.568008222
43 -2.631347499 -4.524959122
44 -0.389761535 -2.631347499
45 2.045096759 -0.389761535
46 3.803510795 2.045096759
47 0.801371583 3.803510795
48 -3.103521861 0.801371583
49 -1.792055764 -3.103521861
50 -1.028366160 -1.792055764
51 -6.480335718 -1.028366160
52 -0.228911506 -6.480335718
53 -2.271949571 -0.228911506
54 1.894480692 -2.271949571
55 -0.347913095 1.894480692
56 0.124261267 -0.347913095
57 1.448340576 0.124261267
58 -2.245107503 1.448340576
59 -0.186681263 -2.245107503
60 -2.284562782 -0.186681263
61 2.179912544 -2.284562782
62 0.184303152 2.179912544
63 2.298914133 0.184303152
64 -1.042976818 2.298914133
65 1.894480692 -1.042976818
66 -1.846121702 1.894480692
67 2.714629395 -1.846121702
68 2.272879887 2.714629395
69 -0.132884943 2.272879887
70 2.652086905 -0.132884943
71 0.894480692 2.652086905
72 -0.986517719 0.894480692
73 -3.432657835 -0.986517719
74 -0.484726326 -3.432657835
75 -1.211907686 -0.484726326
76 0.017872889 -1.211907686
77 -0.105519308 0.017872889
78 3.362264445 -0.105519308
79 -1.812388420 3.362264445
80 -2.663769800 -1.812388420
81 1.638665871 -2.663769800
82 0.175521935 1.638665871
83 -1.254945751 0.175521935
84 4.442618578 -1.254945751
85 -0.118940342 4.442618578
86 -0.174591619 -0.118940342
87 -0.352303703 -0.174591619
88 1.055712524 -0.352303703
89 -0.148557373 1.055712524
90 0.902703295 -0.148557373
91 -3.458692081 0.902703295
92 0.826739771 -3.458692081
93 1.545698528 0.826739771
94 0.745054249 1.545698528
95 0.459622397 0.745054249
96 -2.545576034 0.459622397
97 -0.310597027 -2.545576034
98 -2.079485063 -0.310597027
99 0.757667460 -2.079485063
100 0.584345984 0.757667460
101 1.434919542 0.584345984
102 -1.525625179 1.434919542
103 2.076832594 -1.525625179
104 -2.961814863 2.076832594
105 -0.340498314 -2.961814863
106 -1.377530126 -0.340498314
107 -1.186681263 -1.377530126
108 -2.500922323 -1.186681263
109 -3.245915325 -2.500922323
110 -1.228911506 -3.245915325
111 -1.833508490 -1.228911506
112 -0.272757393 -1.833508490
113 0.541307919 -0.272757393
114 0.796314917 0.541307919
115 2.664700117 0.796314917
116 2.664700117 2.664700117
117 -1.612509132 2.664700117
118 0.422306330 -1.612509132
119 3.124261267 0.422306330
120 0.758475283 3.124261267
121 1.533085316 0.758475283
122 -2.148557373 1.533085316
123 -0.577693670 -2.148557373
124 2.422306330 -0.577693670
125 1.225451214 2.422306330
126 0.689926540 1.225451214
127 -1.211907686 0.689926540
128 -0.744123932 -1.211907686
129 -2.495088141 -0.744123932
130 0.689926540 -2.495088141
131 2.515273674 0.689926540
132 -1.369307523 2.515273674
133 0.026095492 -1.369307523
134 1.907093903 0.026095492
135 1.485656643 1.907093903
136 0.422306330 1.485656643
137 -3.496531715 0.422306330
138 5.056520346 -3.496531715
139 -0.713699079 5.056520346
140 -0.211099863 -0.713699079
141 -0.335299883 -0.211099863
142 2.176329758 -0.335299883
143 -0.196235255 2.176329758
144 1.243262856 -0.196235255
145 -0.545576034 1.243262856
146 -3.259336359 -0.545576034
147 -3.943479654 -3.259336359
148 1.179912544 -3.943479654
149 1.540500097 1.179912544
150 -0.106327131 1.540500097
151 1.069133558 -0.106327131
152 -1.148557373 1.069133558
153 0.783701706 -1.148557373
154 1.396272085 0.783701706
155 1.878284695 1.396272085
156 NA 1.878284695
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.866053285 1.654892175
[2,] 1.177519382 0.866053285
[3,] 0.852632251 1.177519382
[4,] -0.887162320 0.852632251
[5,] 2.717434665 -0.887162320
[6,] -1.766829341 2.717434665
[7,] -1.507955302 -1.766829341
[8,] -0.332494614 -1.507955302
[9,] 2.435585599 -0.332494614
[10,] -3.060483796 2.435585599
[11,] -1.116942895 -3.060483796
[12,] 2.658474961 -1.116942895
[13,] -4.116135073 2.658474961
[14,] -0.513153733 -4.116135073
[15,] 0.007257125 -0.513153733
[16,] -2.116942895 0.007257125
[17,] -0.549661978 -2.116942895
[18,] 1.193191812 -0.549661978
[19,] -4.023167729 1.193191812
[20,] 1.973249485 -4.023167729
[21,] 0.436916988 1.973249485
[22,] -0.733345269 0.436916988
[23,] 2.461619844 -0.733345269
[24,] 0.547695975 2.461619844
[25,] -0.034449551 0.547695975
[26,] -5.805476798 -0.034449551
[27,] 0.045904582 -5.805476798
[28,] -0.575696223 0.045904582
[29,] 5.121868106 -0.575696223
[30,] 4.316584010 5.121868106
[31,] -1.831511043 4.316584010
[32,] -0.563083012 -1.831511043
[33,] 0.487654090 -0.563083012
[34,] -1.507955302 0.487654090
[35,] 1.573730220 -1.507955302
[36,] -0.971907061 1.573730220
[37,] 0.329197221 -0.971907061
[38,] -0.209910239 0.329197221
[39,] 0.586343431 -0.209910239
[40,] 1.032483548 0.586343431
[41,] 6.568008222 1.032483548
[42,] -4.524959122 6.568008222
[43,] -2.631347499 -4.524959122
[44,] -0.389761535 -2.631347499
[45,] 2.045096759 -0.389761535
[46,] 3.803510795 2.045096759
[47,] 0.801371583 3.803510795
[48,] -3.103521861 0.801371583
[49,] -1.792055764 -3.103521861
[50,] -1.028366160 -1.792055764
[51,] -6.480335718 -1.028366160
[52,] -0.228911506 -6.480335718
[53,] -2.271949571 -0.228911506
[54,] 1.894480692 -2.271949571
[55,] -0.347913095 1.894480692
[56,] 0.124261267 -0.347913095
[57,] 1.448340576 0.124261267
[58,] -2.245107503 1.448340576
[59,] -0.186681263 -2.245107503
[60,] -2.284562782 -0.186681263
[61,] 2.179912544 -2.284562782
[62,] 0.184303152 2.179912544
[63,] 2.298914133 0.184303152
[64,] -1.042976818 2.298914133
[65,] 1.894480692 -1.042976818
[66,] -1.846121702 1.894480692
[67,] 2.714629395 -1.846121702
[68,] 2.272879887 2.714629395
[69,] -0.132884943 2.272879887
[70,] 2.652086905 -0.132884943
[71,] 0.894480692 2.652086905
[72,] -0.986517719 0.894480692
[73,] -3.432657835 -0.986517719
[74,] -0.484726326 -3.432657835
[75,] -1.211907686 -0.484726326
[76,] 0.017872889 -1.211907686
[77,] -0.105519308 0.017872889
[78,] 3.362264445 -0.105519308
[79,] -1.812388420 3.362264445
[80,] -2.663769800 -1.812388420
[81,] 1.638665871 -2.663769800
[82,] 0.175521935 1.638665871
[83,] -1.254945751 0.175521935
[84,] 4.442618578 -1.254945751
[85,] -0.118940342 4.442618578
[86,] -0.174591619 -0.118940342
[87,] -0.352303703 -0.174591619
[88,] 1.055712524 -0.352303703
[89,] -0.148557373 1.055712524
[90,] 0.902703295 -0.148557373
[91,] -3.458692081 0.902703295
[92,] 0.826739771 -3.458692081
[93,] 1.545698528 0.826739771
[94,] 0.745054249 1.545698528
[95,] 0.459622397 0.745054249
[96,] -2.545576034 0.459622397
[97,] -0.310597027 -2.545576034
[98,] -2.079485063 -0.310597027
[99,] 0.757667460 -2.079485063
[100,] 0.584345984 0.757667460
[101,] 1.434919542 0.584345984
[102,] -1.525625179 1.434919542
[103,] 2.076832594 -1.525625179
[104,] -2.961814863 2.076832594
[105,] -0.340498314 -2.961814863
[106,] -1.377530126 -0.340498314
[107,] -1.186681263 -1.377530126
[108,] -2.500922323 -1.186681263
[109,] -3.245915325 -2.500922323
[110,] -1.228911506 -3.245915325
[111,] -1.833508490 -1.228911506
[112,] -0.272757393 -1.833508490
[113,] 0.541307919 -0.272757393
[114,] 0.796314917 0.541307919
[115,] 2.664700117 0.796314917
[116,] 2.664700117 2.664700117
[117,] -1.612509132 2.664700117
[118,] 0.422306330 -1.612509132
[119,] 3.124261267 0.422306330
[120,] 0.758475283 3.124261267
[121,] 1.533085316 0.758475283
[122,] -2.148557373 1.533085316
[123,] -0.577693670 -2.148557373
[124,] 2.422306330 -0.577693670
[125,] 1.225451214 2.422306330
[126,] 0.689926540 1.225451214
[127,] -1.211907686 0.689926540
[128,] -0.744123932 -1.211907686
[129,] -2.495088141 -0.744123932
[130,] 0.689926540 -2.495088141
[131,] 2.515273674 0.689926540
[132,] -1.369307523 2.515273674
[133,] 0.026095492 -1.369307523
[134,] 1.907093903 0.026095492
[135,] 1.485656643 1.907093903
[136,] 0.422306330 1.485656643
[137,] -3.496531715 0.422306330
[138,] 5.056520346 -3.496531715
[139,] -0.713699079 5.056520346
[140,] -0.211099863 -0.713699079
[141,] -0.335299883 -0.211099863
[142,] 2.176329758 -0.335299883
[143,] -0.196235255 2.176329758
[144,] 1.243262856 -0.196235255
[145,] -0.545576034 1.243262856
[146,] -3.259336359 -0.545576034
[147,] -3.943479654 -3.259336359
[148,] 1.179912544 -3.943479654
[149,] 1.540500097 1.179912544
[150,] -0.106327131 1.540500097
[151,] 1.069133558 -0.106327131
[152,] -1.148557373 1.069133558
[153,] 0.783701706 -1.148557373
[154,] 1.396272085 0.783701706
[155,] 1.878284695 1.396272085
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.866053285 1.654892175
2 1.177519382 0.866053285
3 0.852632251 1.177519382
4 -0.887162320 0.852632251
5 2.717434665 -0.887162320
6 -1.766829341 2.717434665
7 -1.507955302 -1.766829341
8 -0.332494614 -1.507955302
9 2.435585599 -0.332494614
10 -3.060483796 2.435585599
11 -1.116942895 -3.060483796
12 2.658474961 -1.116942895
13 -4.116135073 2.658474961
14 -0.513153733 -4.116135073
15 0.007257125 -0.513153733
16 -2.116942895 0.007257125
17 -0.549661978 -2.116942895
18 1.193191812 -0.549661978
19 -4.023167729 1.193191812
20 1.973249485 -4.023167729
21 0.436916988 1.973249485
22 -0.733345269 0.436916988
23 2.461619844 -0.733345269
24 0.547695975 2.461619844
25 -0.034449551 0.547695975
26 -5.805476798 -0.034449551
27 0.045904582 -5.805476798
28 -0.575696223 0.045904582
29 5.121868106 -0.575696223
30 4.316584010 5.121868106
31 -1.831511043 4.316584010
32 -0.563083012 -1.831511043
33 0.487654090 -0.563083012
34 -1.507955302 0.487654090
35 1.573730220 -1.507955302
36 -0.971907061 1.573730220
37 0.329197221 -0.971907061
38 -0.209910239 0.329197221
39 0.586343431 -0.209910239
40 1.032483548 0.586343431
41 6.568008222 1.032483548
42 -4.524959122 6.568008222
43 -2.631347499 -4.524959122
44 -0.389761535 -2.631347499
45 2.045096759 -0.389761535
46 3.803510795 2.045096759
47 0.801371583 3.803510795
48 -3.103521861 0.801371583
49 -1.792055764 -3.103521861
50 -1.028366160 -1.792055764
51 -6.480335718 -1.028366160
52 -0.228911506 -6.480335718
53 -2.271949571 -0.228911506
54 1.894480692 -2.271949571
55 -0.347913095 1.894480692
56 0.124261267 -0.347913095
57 1.448340576 0.124261267
58 -2.245107503 1.448340576
59 -0.186681263 -2.245107503
60 -2.284562782 -0.186681263
61 2.179912544 -2.284562782
62 0.184303152 2.179912544
63 2.298914133 0.184303152
64 -1.042976818 2.298914133
65 1.894480692 -1.042976818
66 -1.846121702 1.894480692
67 2.714629395 -1.846121702
68 2.272879887 2.714629395
69 -0.132884943 2.272879887
70 2.652086905 -0.132884943
71 0.894480692 2.652086905
72 -0.986517719 0.894480692
73 -3.432657835 -0.986517719
74 -0.484726326 -3.432657835
75 -1.211907686 -0.484726326
76 0.017872889 -1.211907686
77 -0.105519308 0.017872889
78 3.362264445 -0.105519308
79 -1.812388420 3.362264445
80 -2.663769800 -1.812388420
81 1.638665871 -2.663769800
82 0.175521935 1.638665871
83 -1.254945751 0.175521935
84 4.442618578 -1.254945751
85 -0.118940342 4.442618578
86 -0.174591619 -0.118940342
87 -0.352303703 -0.174591619
88 1.055712524 -0.352303703
89 -0.148557373 1.055712524
90 0.902703295 -0.148557373
91 -3.458692081 0.902703295
92 0.826739771 -3.458692081
93 1.545698528 0.826739771
94 0.745054249 1.545698528
95 0.459622397 0.745054249
96 -2.545576034 0.459622397
97 -0.310597027 -2.545576034
98 -2.079485063 -0.310597027
99 0.757667460 -2.079485063
100 0.584345984 0.757667460
101 1.434919542 0.584345984
102 -1.525625179 1.434919542
103 2.076832594 -1.525625179
104 -2.961814863 2.076832594
105 -0.340498314 -2.961814863
106 -1.377530126 -0.340498314
107 -1.186681263 -1.377530126
108 -2.500922323 -1.186681263
109 -3.245915325 -2.500922323
110 -1.228911506 -3.245915325
111 -1.833508490 -1.228911506
112 -0.272757393 -1.833508490
113 0.541307919 -0.272757393
114 0.796314917 0.541307919
115 2.664700117 0.796314917
116 2.664700117 2.664700117
117 -1.612509132 2.664700117
118 0.422306330 -1.612509132
119 3.124261267 0.422306330
120 0.758475283 3.124261267
121 1.533085316 0.758475283
122 -2.148557373 1.533085316
123 -0.577693670 -2.148557373
124 2.422306330 -0.577693670
125 1.225451214 2.422306330
126 0.689926540 1.225451214
127 -1.211907686 0.689926540
128 -0.744123932 -1.211907686
129 -2.495088141 -0.744123932
130 0.689926540 -2.495088141
131 2.515273674 0.689926540
132 -1.369307523 2.515273674
133 0.026095492 -1.369307523
134 1.907093903 0.026095492
135 1.485656643 1.907093903
136 0.422306330 1.485656643
137 -3.496531715 0.422306330
138 5.056520346 -3.496531715
139 -0.713699079 5.056520346
140 -0.211099863 -0.713699079
141 -0.335299883 -0.211099863
142 2.176329758 -0.335299883
143 -0.196235255 2.176329758
144 1.243262856 -0.196235255
145 -0.545576034 1.243262856
146 -3.259336359 -0.545576034
147 -3.943479654 -3.259336359
148 1.179912544 -3.943479654
149 1.540500097 1.179912544
150 -0.106327131 1.540500097
151 1.069133558 -0.106327131
152 -1.148557373 1.069133558
153 0.783701706 -1.148557373
154 1.396272085 0.783701706
155 1.878284695 1.396272085
> 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/7ij4y1291551726.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/html/rcomp/tmp/8ij4y1291551726.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/html/rcomp/tmp/9ij4y1291551726.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/html/rcomp/tmp/10asmj1291551726.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/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/11wakp1291551726.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/12zt1v1291551726.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/13ouxo1291551726.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/149uwc1291551726.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/15dvvi1291551726.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/16r5sr1291551726.tab")
+ }
>
> try(system("convert tmp/1397p1291551726.ps tmp/1397p1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/2397p1291551726.ps tmp/2397p1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/3397p1291551726.ps tmp/3397p1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/4e06a1291551726.ps tmp/4e06a1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/5e06a1291551726.ps tmp/5e06a1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/6prnd1291551726.ps tmp/6prnd1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ij4y1291551726.ps tmp/7ij4y1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ij4y1291551726.ps tmp/8ij4y1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ij4y1291551726.ps tmp/9ij4y1291551726.png",intern=TRUE))
character(0)
> try(system("convert tmp/10asmj1291551726.ps tmp/10asmj1291551726.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.001 1.811 9.867