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(4
+ ,2
+ ,1
+ ,2
+ ,1
+ ,2
+ ,1
+ ,1
+ ,5
+ ,4
+ ,2
+ ,4
+ ,3
+ ,2
+ ,1
+ ,2
+ ,3
+ ,3
+ ,2
+ ,2
+ ,3
+ ,4
+ ,1
+ ,2
+ ,2
+ ,3
+ ,3
+ ,2
+ ,3
+ ,3
+ ,1
+ ,2
+ ,4
+ ,3
+ ,1
+ ,1
+ ,4
+ ,2
+ ,1
+ ,4
+ ,4
+ ,4
+ ,2
+ ,2
+ ,2
+ ,4
+ ,4
+ ,3
+ ,2
+ ,3
+ ,2
+ ,2
+ ,2
+ ,3
+ ,1
+ ,2
+ ,4
+ ,4
+ ,1
+ ,1
+ ,4
+ ,4
+ ,3
+ ,3
+ ,3
+ ,3
+ ,2
+ ,1
+ ,2
+ ,3
+ ,2
+ ,2
+ ,5
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,3
+ ,2
+ ,1
+ ,3
+ ,4
+ ,5
+ ,2
+ ,2
+ ,3
+ ,4
+ ,2
+ ,3
+ ,2
+ ,2
+ ,2
+ ,2
+ ,2
+ ,3
+ ,2
+ ,2
+ ,3
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,2
+ ,3
+ ,4
+ ,3
+ ,2
+ ,2
+ ,5
+ ,4
+ ,2
+ ,4
+ ,4
+ ,4
+ ,2
+ ,2
+ ,3
+ ,1
+ ,2
+ ,2
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,5
+ ,2
+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+ ,'performance'
+ ,'excellence')
+ ,1:159))
> y <- array(NA,dim=c(4,159),dimnames=list(c('best','standards','performance','excellence'),1:159))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
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
best standards performance excellence
1 4 2 1 2
2 1 2 1 1
3 5 4 2 4
4 3 2 1 2
5 3 3 2 2
6 3 4 1 2
7 2 3 3 2
8 3 3 1 2
9 4 3 1 1
10 4 2 1 4
11 4 4 2 2
12 2 4 4 3
13 2 3 2 2
14 2 3 1 2
15 4 4 1 1
16 4 4 3 3
17 3 3 2 1
18 2 3 2 2
19 5 3 3 4
20 4 4 3 4
21 3 2 1 3
22 4 5 2 2
23 3 4 2 3
24 2 2 2 2
25 2 3 2 2
26 3 4 3 3
27 4 4 2 3
28 4 3 2 2
29 5 4 2 4
30 4 4 2 2
31 3 1 2 2
32 4 4 3 3
33 4 5 2 5
34 4 2 2 2
35 5 4 2 3
36 2 3 2 1
37 2 2 2 2
38 4 4 1 2
39 5 5 2 4
40 3 4 1 2
41 5 4 2 4
42 2 4 2 3
43 4 3 2 2
44 4 4 2 4
45 2 2 2 2
46 2 2 3 2
47 4 4 2 2
48 2 2 2 2
49 2 4 2 2
50 4 4 4 3
51 1 1 1 1
52 2 4 2 2
53 4 2 2 2
54 1 1 1 1
55 5 4 5 5
56 4 3 2 2
57 4 2 2 2
58 4 4 2 2
59 1 3 1 1
60 4 2 2 2
61 4 2 2 2
62 4 3 2 2
63 4 2 2 4
64 2 1 2 2
65 4 3 1 1
66 3 2 1 2
67 2 3 2 2
68 4 3 2 2
69 4 3 1 1
70 3 2 2 2
71 3 3 2 2
72 2 2 1 2
73 4 4 3 3
74 4 4 3 3
75 4 4 3 2
76 4 2 2 2
77 4 3 2 3
78 4 4 2 2
79 2 3 1 2
80 2 4 4 2
81 4 2 3 2
82 2 3 2 2
83 4 3 2 1
84 5 4 2 3
85 2 2 1 2
86 4 4 2 4
87 2 2 3 2
88 4 2 1 1
89 4 4 2 4
90 2 3 2 3
91 4 4 2 2
92 1 2 1 3
93 2 2 1 2
94 5 3 2 3
95 2 3 2 2
96 5 5 4 5
97 4 2 2 3
98 4 3 4 4
99 2 4 1 2
100 2 3 3 2
101 4 4 2 2
102 2 3 2 3
103 4 3 4 4
104 4 2 3 3
105 2 3 2 2
106 4 2 1 2
107 2 3 1 3
108 4 2 2 2
109 4 4 3 2
110 4 2 2 2
111 3 4 1 2
112 3 4 2 3
113 2 1 2 2
114 5 5 2 4
115 3 2 1 1
116 4 3 2 2
117 3 4 3 4
118 2 1 2 2
119 4 5 2 2
120 2 3 1 1
121 1 3 1 1
122 2 3 2 3
123 4 3 2 3
124 1 2 1 1
125 1 2 2 1
126 4 4 3 3
127 3 4 1 1
128 2 3 2 2
129 3 3 2 3
130 2 3 2 2
131 3 4 2 2
132 4 3 2 2
133 2 4 1 2
134 1 4 1 2
135 4 2 2 2
136 4 4 4 4
137 4 2 2 2
138 3 4 2 2
139 2 3 2 3
140 2 3 2 2
141 2 2 2 2
142 5 2 2 4
143 5 5 5 4
144 2 2 1 1
145 3 4 4 3
146 2 3 2 2
147 4 3 3 4
148 2 3 2 2
149 2 3 2 1
150 4 4 2 2
151 2 4 1 2
152 5 4 2 3
153 5 4 5 5
154 4 4 2 2
155 4 5 3 4
156 4 3 2 2
157 2 3 2 2
158 4 4 2 3
159 3 4 4 4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) standards performance excellence
1.22152 0.23180 0.05832 0.46728
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.14528 -0.90981 0.03187 0.80006 1.78927
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.22152 0.28499 4.286 3.18e-05 ***
standards 0.23180 0.08803 2.633 0.00931 **
performance 0.05832 0.10920 0.534 0.59405
excellence 0.46728 0.10277 4.547 1.09e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9639 on 155 degrees of freedom
Multiple R-squared: 0.2882, Adjusted R-squared: 0.2745
F-statistic: 20.92 on 3 and 155 DF, p-value: 1.959e-11
> 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.3487058 0.6974115 0.6512942
[2,] 0.1969261 0.3938522 0.8030739
[3,] 0.6490903 0.7018193 0.3509097
[4,] 0.5635811 0.8728378 0.4364189
[5,] 0.4955478 0.9910956 0.5044522
[6,] 0.4604981 0.9209962 0.5395019
[7,] 0.4186589 0.8373178 0.5813411
[8,] 0.5185525 0.9628949 0.4814475
[9,] 0.4860344 0.9720689 0.5139656
[10,] 0.4501723 0.9003445 0.5498277
[11,] 0.4285116 0.8570233 0.5714884
[12,] 0.4027477 0.8054954 0.5972523
[13,] 0.5166931 0.9666137 0.4833069
[14,] 0.4439597 0.8879194 0.5560403
[15,] 0.3857102 0.7714204 0.6142898
[16,] 0.3192041 0.6384083 0.6807959
[17,] 0.3247412 0.6494825 0.6752588
[18,] 0.2712407 0.5424814 0.7287593
[19,] 0.2553611 0.5107221 0.7446389
[20,] 0.2154306 0.4308612 0.7845694
[21,] 0.1701930 0.3403860 0.8298070
[22,] 0.2058335 0.4116670 0.7941665
[23,] 0.1752466 0.3504932 0.8247534
[24,] 0.1566034 0.3132067 0.8433966
[25,] 0.1741954 0.3483907 0.8258046
[26,] 0.1461199 0.2922397 0.8538801
[27,] 0.1827474 0.3654948 0.8172526
[28,] 0.2277065 0.4554130 0.7722935
[29,] 0.2603848 0.5207696 0.7396152
[30,] 0.2284570 0.4569140 0.7715430
[31,] 0.2077340 0.4154681 0.7922660
[32,] 0.1804570 0.3609140 0.8195430
[33,] 0.1525002 0.3050004 0.8474998
[34,] 0.1353560 0.2707120 0.8646440
[35,] 0.1236944 0.2473887 0.8763056
[36,] 0.2165882 0.4331764 0.7834118
[37,] 0.2258252 0.4516505 0.7741748
[38,] 0.1913889 0.3827779 0.8086111
[39,] 0.1741181 0.3482361 0.8258819
[40,] 0.1521980 0.3043960 0.8478020
[41,] 0.1409460 0.2818919 0.8590540
[42,] 0.1260435 0.2520870 0.8739565
[43,] 0.1501955 0.3003911 0.8498045
[44,] 0.1384165 0.2768331 0.8615835
[45,] 0.1396415 0.2792829 0.8603585
[46,] 0.1621637 0.3243274 0.8378363
[47,] 0.2005385 0.4010770 0.7994615
[48,] 0.2013187 0.4026374 0.7986813
[49,] 0.1794460 0.3588920 0.8205540
[50,] 0.1884927 0.3769854 0.8115073
[51,] 0.2221598 0.4443196 0.7778402
[52,] 0.2097467 0.4194934 0.7902533
[53,] 0.2629537 0.5259074 0.7370463
[54,] 0.2969953 0.5939905 0.7030047
[55,] 0.3285664 0.6571328 0.6714336
[56,] 0.3338409 0.6676819 0.6661591
[57,] 0.2969594 0.5939188 0.7030406
[58,] 0.2679142 0.5358284 0.7320858
[59,] 0.3277360 0.6554720 0.6722640
[60,] 0.2904950 0.5809900 0.7095050
[61,] 0.2926507 0.5853014 0.7073493
[62,] 0.2976308 0.5952616 0.7023692
[63,] 0.3588641 0.7177282 0.6411359
[64,] 0.3191957 0.6383915 0.6808043
[65,] 0.2789655 0.5579310 0.7210345
[66,] 0.2645019 0.5290037 0.7354981
[67,] 0.2309187 0.4618374 0.7690813
[68,] 0.1998623 0.3997246 0.8001377
[69,] 0.1870606 0.3741212 0.8129394
[70,] 0.2107988 0.4215977 0.7892012
[71,] 0.1899996 0.3799992 0.8100004
[72,] 0.1802723 0.3605447 0.8197277
[73,] 0.1815497 0.3630994 0.8184503
[74,] 0.2109319 0.4218639 0.7890681
[75,] 0.2313690 0.4627379 0.7686310
[76,] 0.2327601 0.4655203 0.7672399
[77,] 0.2843786 0.5687571 0.7156214
[78,] 0.3259036 0.6518073 0.6740964
[79,] 0.3061125 0.6122251 0.6938875
[80,] 0.2704078 0.5408156 0.7295922
[81,] 0.2599897 0.5199795 0.7400103
[82,] 0.3668273 0.7336546 0.6331727
[83,] 0.3277369 0.6554739 0.6722631
[84,] 0.3738876 0.7477753 0.6261124
[85,] 0.3664660 0.7329320 0.6335340
[86,] 0.5366151 0.9267697 0.4633849
[87,] 0.5111236 0.9777528 0.4888764
[88,] 0.5967232 0.8065535 0.4032768
[89,] 0.5929968 0.8140064 0.4070032
[90,] 0.5470711 0.9058578 0.4529289
[91,] 0.5360106 0.9279788 0.4639894
[92,] 0.4893184 0.9786369 0.5106816
[93,] 0.4981138 0.9962276 0.5018862
[94,] 0.5041415 0.9917171 0.4958585
[95,] 0.5002365 0.9995270 0.4997635
[96,] 0.5483136 0.9033728 0.4516864
[97,] 0.5014938 0.9970124 0.4985062
[98,] 0.4782913 0.9565825 0.5217087
[99,] 0.4720586 0.9441173 0.5279414
[100,] 0.5326162 0.9347677 0.4673838
[101,] 0.5626762 0.8746475 0.4373238
[102,] 0.6076904 0.7846192 0.3923096
[103,] 0.5990341 0.8019317 0.4009659
[104,] 0.6534493 0.6931015 0.3465507
[105,] 0.6080511 0.7838979 0.3919489
[106,] 0.5760333 0.8479333 0.4239667
[107,] 0.5330781 0.9338437 0.4669219
[108,] 0.5127242 0.9745516 0.4872758
[109,] 0.5223889 0.9552222 0.4776111
[110,] 0.5596545 0.8806909 0.4403455
[111,] 0.5850710 0.8298581 0.4149290
[112,] 0.5386475 0.9227050 0.4613525
[113,] 0.5387377 0.9225247 0.4612623
[114,] 0.4918285 0.9836570 0.5081715
[115,] 0.5093146 0.9813709 0.4906854
[116,] 0.5680481 0.8639038 0.4319519
[117,] 0.5343531 0.9312938 0.4656469
[118,] 0.5370003 0.9259994 0.4629997
[119,] 0.5645583 0.8708835 0.4354417
[120,] 0.5190274 0.9619452 0.4809726
[121,] 0.5139443 0.9721113 0.4860557
[122,] 0.4977109 0.9954218 0.5022891
[123,] 0.4478179 0.8956358 0.5521821
[124,] 0.4340728 0.8681455 0.5659272
[125,] 0.3784405 0.7568811 0.6215595
[126,] 0.4039642 0.8079283 0.5960358
[127,] 0.3740109 0.7480218 0.6259891
[128,] 0.5435695 0.9128610 0.4564305
[129,] 0.6013926 0.7972149 0.3986074
[130,] 0.5349726 0.9300547 0.4650274
[131,] 0.6444971 0.7110059 0.3555029
[132,] 0.5738182 0.8523636 0.4261818
[133,] 0.6785906 0.6428188 0.3214094
[134,] 0.6509216 0.6981569 0.3490784
[135,] 0.5980468 0.8039063 0.4019532
[136,] 0.6273679 0.7452643 0.3726321
[137,] 0.5831025 0.8337951 0.4168975
[138,] 0.4952822 0.9905644 0.5047178
[139,] 0.4213601 0.8427201 0.5786399
[140,] 0.3833883 0.7667765 0.6166117
[141,] 0.2953010 0.5906020 0.7046990
[142,] 0.2699615 0.5399231 0.7300385
[143,] 0.2130893 0.4261786 0.7869107
[144,] 0.1651555 0.3303110 0.8348445
[145,] 0.2553386 0.5106772 0.7446614
[146,] 0.2368265 0.4736530 0.7631735
> postscript(file="/var/www/html/rcomp/tmp/1trsw1291288871.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/2trsw1291288871.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/3mi9h1291288871.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/4mi9h1291288871.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/5mi9h1291288871.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 = 159
Frequency = 1
1 2 3 4 5 6
1.32199469 -1.21072637 0.86550578 0.32199469 0.03186690 -0.14161181
7 8 9 10 11 12
-1.02645763 0.09019144 1.55747038 0.38743682 0.80006366 -1.78386436
13 14 15 16 17 18
-0.96813310 -0.90980856 1.32566713 0.27446018 0.49914584 -0.96813310
19 20 21 22 23 24
1.03898449 -0.19281876 -0.14528425 0.56826041 -0.66721528 -0.73632985
25 26 27 28 29 30
-0.96813310 -0.72553982 0.33278472 1.03186690 0.86550578 0.80006366
31 32 33 34 35 36
0.49547340 0.27446018 -0.83357640 1.26367015 1.33278472 -0.50085416
37 38 39 40 41 42
-0.73632985 0.85838819 0.63370253 -0.14161181 0.86550578 -1.66721528
43 44 45 46 47 48
1.03186690 -0.13449422 -0.73632985 -0.79465438 0.80006366 -0.73632985
49 50 51 52 53 54
-1.19993634 0.21613564 -0.97892312 -1.19993634 1.26367015 -0.97892312
55 56 57 58 59 60
0.22325323 1.03186690 1.26367015 0.80006366 -1.44252962 1.26367015
61 62 63 64 65 66
1.26367015 1.03186690 0.32911228 -0.50452660 1.55747038 0.32199469
67 68 69 70 71 72
-0.96813310 1.03186690 1.55747038 0.26367015 0.03186690 -0.67800531
73 74 75 76 77 78
0.27446018 0.27446018 0.74173912 1.26367015 0.56458797 0.80006366
79 80 81 82 83 84
-0.90980856 -1.31658542 1.20534562 -0.96813310 1.49914584 1.33278472
85 86 87 88 89 90
-0.67800531 -0.13449422 -0.79465438 1.78927363 -0.13449422 -1.43541203
91 92 93 94 95 96
0.80006366 -2.14528425 -0.67800531 1.56458797 -0.96813310 0.04977452
97 98 99 100 101 102
0.79639122 -0.01934004 -1.14161181 -1.02645763 0.80006366 -1.43541203
103 104 105 106 107 108
-0.01934004 0.73806668 -0.96813310 1.32199469 -1.37708750 1.26367015
109 110 111 112 113 114
0.74173912 1.26367015 -0.14161181 -0.66721528 -0.50452660 0.63370253
115 116 117 118 119 120
0.78927363 1.03186690 -1.19281876 -0.50452660 0.56826041 -0.44252962
121 122 123 124 125 126
-1.44252962 -1.43541203 0.56458797 -1.21072637 -1.26905091 0.27446018
127 128 129 130 131 132
0.32566713 -0.96813310 -0.43541203 -0.96813310 -0.19993634 1.03186690
133 134 135 136 137 138
-1.14161181 -2.14161181 1.26367015 -0.25114329 1.26367015 -0.19993634
139 140 141 142 143 144
-1.43541203 -0.96813310 -0.73632985 1.32911228 0.45872892 -0.21072637
145 146 147 148 149 150
-0.78386436 -0.96813310 0.03898449 -0.96813310 -0.50085416 0.80006366
151 152 153 154 155 156
-1.14161181 1.33278472 0.22325323 0.80006366 -0.42462200 1.03186690
157 158 159
-0.96813310 0.33278472 -1.25114329
> postscript(file="/var/www/html/rcomp/tmp/6esqk1291288871.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 1.32199469 NA
1 -1.21072637 1.32199469
2 0.86550578 -1.21072637
3 0.32199469 0.86550578
4 0.03186690 0.32199469
5 -0.14161181 0.03186690
6 -1.02645763 -0.14161181
7 0.09019144 -1.02645763
8 1.55747038 0.09019144
9 0.38743682 1.55747038
10 0.80006366 0.38743682
11 -1.78386436 0.80006366
12 -0.96813310 -1.78386436
13 -0.90980856 -0.96813310
14 1.32566713 -0.90980856
15 0.27446018 1.32566713
16 0.49914584 0.27446018
17 -0.96813310 0.49914584
18 1.03898449 -0.96813310
19 -0.19281876 1.03898449
20 -0.14528425 -0.19281876
21 0.56826041 -0.14528425
22 -0.66721528 0.56826041
23 -0.73632985 -0.66721528
24 -0.96813310 -0.73632985
25 -0.72553982 -0.96813310
26 0.33278472 -0.72553982
27 1.03186690 0.33278472
28 0.86550578 1.03186690
29 0.80006366 0.86550578
30 0.49547340 0.80006366
31 0.27446018 0.49547340
32 -0.83357640 0.27446018
33 1.26367015 -0.83357640
34 1.33278472 1.26367015
35 -0.50085416 1.33278472
36 -0.73632985 -0.50085416
37 0.85838819 -0.73632985
38 0.63370253 0.85838819
39 -0.14161181 0.63370253
40 0.86550578 -0.14161181
41 -1.66721528 0.86550578
42 1.03186690 -1.66721528
43 -0.13449422 1.03186690
44 -0.73632985 -0.13449422
45 -0.79465438 -0.73632985
46 0.80006366 -0.79465438
47 -0.73632985 0.80006366
48 -1.19993634 -0.73632985
49 0.21613564 -1.19993634
50 -0.97892312 0.21613564
51 -1.19993634 -0.97892312
52 1.26367015 -1.19993634
53 -0.97892312 1.26367015
54 0.22325323 -0.97892312
55 1.03186690 0.22325323
56 1.26367015 1.03186690
57 0.80006366 1.26367015
58 -1.44252962 0.80006366
59 1.26367015 -1.44252962
60 1.26367015 1.26367015
61 1.03186690 1.26367015
62 0.32911228 1.03186690
63 -0.50452660 0.32911228
64 1.55747038 -0.50452660
65 0.32199469 1.55747038
66 -0.96813310 0.32199469
67 1.03186690 -0.96813310
68 1.55747038 1.03186690
69 0.26367015 1.55747038
70 0.03186690 0.26367015
71 -0.67800531 0.03186690
72 0.27446018 -0.67800531
73 0.27446018 0.27446018
74 0.74173912 0.27446018
75 1.26367015 0.74173912
76 0.56458797 1.26367015
77 0.80006366 0.56458797
78 -0.90980856 0.80006366
79 -1.31658542 -0.90980856
80 1.20534562 -1.31658542
81 -0.96813310 1.20534562
82 1.49914584 -0.96813310
83 1.33278472 1.49914584
84 -0.67800531 1.33278472
85 -0.13449422 -0.67800531
86 -0.79465438 -0.13449422
87 1.78927363 -0.79465438
88 -0.13449422 1.78927363
89 -1.43541203 -0.13449422
90 0.80006366 -1.43541203
91 -2.14528425 0.80006366
92 -0.67800531 -2.14528425
93 1.56458797 -0.67800531
94 -0.96813310 1.56458797
95 0.04977452 -0.96813310
96 0.79639122 0.04977452
97 -0.01934004 0.79639122
98 -1.14161181 -0.01934004
99 -1.02645763 -1.14161181
100 0.80006366 -1.02645763
101 -1.43541203 0.80006366
102 -0.01934004 -1.43541203
103 0.73806668 -0.01934004
104 -0.96813310 0.73806668
105 1.32199469 -0.96813310
106 -1.37708750 1.32199469
107 1.26367015 -1.37708750
108 0.74173912 1.26367015
109 1.26367015 0.74173912
110 -0.14161181 1.26367015
111 -0.66721528 -0.14161181
112 -0.50452660 -0.66721528
113 0.63370253 -0.50452660
114 0.78927363 0.63370253
115 1.03186690 0.78927363
116 -1.19281876 1.03186690
117 -0.50452660 -1.19281876
118 0.56826041 -0.50452660
119 -0.44252962 0.56826041
120 -1.44252962 -0.44252962
121 -1.43541203 -1.44252962
122 0.56458797 -1.43541203
123 -1.21072637 0.56458797
124 -1.26905091 -1.21072637
125 0.27446018 -1.26905091
126 0.32566713 0.27446018
127 -0.96813310 0.32566713
128 -0.43541203 -0.96813310
129 -0.96813310 -0.43541203
130 -0.19993634 -0.96813310
131 1.03186690 -0.19993634
132 -1.14161181 1.03186690
133 -2.14161181 -1.14161181
134 1.26367015 -2.14161181
135 -0.25114329 1.26367015
136 1.26367015 -0.25114329
137 -0.19993634 1.26367015
138 -1.43541203 -0.19993634
139 -0.96813310 -1.43541203
140 -0.73632985 -0.96813310
141 1.32911228 -0.73632985
142 0.45872892 1.32911228
143 -0.21072637 0.45872892
144 -0.78386436 -0.21072637
145 -0.96813310 -0.78386436
146 0.03898449 -0.96813310
147 -0.96813310 0.03898449
148 -0.50085416 -0.96813310
149 0.80006366 -0.50085416
150 -1.14161181 0.80006366
151 1.33278472 -1.14161181
152 0.22325323 1.33278472
153 0.80006366 0.22325323
154 -0.42462200 0.80006366
155 1.03186690 -0.42462200
156 -0.96813310 1.03186690
157 0.33278472 -0.96813310
158 -1.25114329 0.33278472
159 NA -1.25114329
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.21072637 1.32199469
[2,] 0.86550578 -1.21072637
[3,] 0.32199469 0.86550578
[4,] 0.03186690 0.32199469
[5,] -0.14161181 0.03186690
[6,] -1.02645763 -0.14161181
[7,] 0.09019144 -1.02645763
[8,] 1.55747038 0.09019144
[9,] 0.38743682 1.55747038
[10,] 0.80006366 0.38743682
[11,] -1.78386436 0.80006366
[12,] -0.96813310 -1.78386436
[13,] -0.90980856 -0.96813310
[14,] 1.32566713 -0.90980856
[15,] 0.27446018 1.32566713
[16,] 0.49914584 0.27446018
[17,] -0.96813310 0.49914584
[18,] 1.03898449 -0.96813310
[19,] -0.19281876 1.03898449
[20,] -0.14528425 -0.19281876
[21,] 0.56826041 -0.14528425
[22,] -0.66721528 0.56826041
[23,] -0.73632985 -0.66721528
[24,] -0.96813310 -0.73632985
[25,] -0.72553982 -0.96813310
[26,] 0.33278472 -0.72553982
[27,] 1.03186690 0.33278472
[28,] 0.86550578 1.03186690
[29,] 0.80006366 0.86550578
[30,] 0.49547340 0.80006366
[31,] 0.27446018 0.49547340
[32,] -0.83357640 0.27446018
[33,] 1.26367015 -0.83357640
[34,] 1.33278472 1.26367015
[35,] -0.50085416 1.33278472
[36,] -0.73632985 -0.50085416
[37,] 0.85838819 -0.73632985
[38,] 0.63370253 0.85838819
[39,] -0.14161181 0.63370253
[40,] 0.86550578 -0.14161181
[41,] -1.66721528 0.86550578
[42,] 1.03186690 -1.66721528
[43,] -0.13449422 1.03186690
[44,] -0.73632985 -0.13449422
[45,] -0.79465438 -0.73632985
[46,] 0.80006366 -0.79465438
[47,] -0.73632985 0.80006366
[48,] -1.19993634 -0.73632985
[49,] 0.21613564 -1.19993634
[50,] -0.97892312 0.21613564
[51,] -1.19993634 -0.97892312
[52,] 1.26367015 -1.19993634
[53,] -0.97892312 1.26367015
[54,] 0.22325323 -0.97892312
[55,] 1.03186690 0.22325323
[56,] 1.26367015 1.03186690
[57,] 0.80006366 1.26367015
[58,] -1.44252962 0.80006366
[59,] 1.26367015 -1.44252962
[60,] 1.26367015 1.26367015
[61,] 1.03186690 1.26367015
[62,] 0.32911228 1.03186690
[63,] -0.50452660 0.32911228
[64,] 1.55747038 -0.50452660
[65,] 0.32199469 1.55747038
[66,] -0.96813310 0.32199469
[67,] 1.03186690 -0.96813310
[68,] 1.55747038 1.03186690
[69,] 0.26367015 1.55747038
[70,] 0.03186690 0.26367015
[71,] -0.67800531 0.03186690
[72,] 0.27446018 -0.67800531
[73,] 0.27446018 0.27446018
[74,] 0.74173912 0.27446018
[75,] 1.26367015 0.74173912
[76,] 0.56458797 1.26367015
[77,] 0.80006366 0.56458797
[78,] -0.90980856 0.80006366
[79,] -1.31658542 -0.90980856
[80,] 1.20534562 -1.31658542
[81,] -0.96813310 1.20534562
[82,] 1.49914584 -0.96813310
[83,] 1.33278472 1.49914584
[84,] -0.67800531 1.33278472
[85,] -0.13449422 -0.67800531
[86,] -0.79465438 -0.13449422
[87,] 1.78927363 -0.79465438
[88,] -0.13449422 1.78927363
[89,] -1.43541203 -0.13449422
[90,] 0.80006366 -1.43541203
[91,] -2.14528425 0.80006366
[92,] -0.67800531 -2.14528425
[93,] 1.56458797 -0.67800531
[94,] -0.96813310 1.56458797
[95,] 0.04977452 -0.96813310
[96,] 0.79639122 0.04977452
[97,] -0.01934004 0.79639122
[98,] -1.14161181 -0.01934004
[99,] -1.02645763 -1.14161181
[100,] 0.80006366 -1.02645763
[101,] -1.43541203 0.80006366
[102,] -0.01934004 -1.43541203
[103,] 0.73806668 -0.01934004
[104,] -0.96813310 0.73806668
[105,] 1.32199469 -0.96813310
[106,] -1.37708750 1.32199469
[107,] 1.26367015 -1.37708750
[108,] 0.74173912 1.26367015
[109,] 1.26367015 0.74173912
[110,] -0.14161181 1.26367015
[111,] -0.66721528 -0.14161181
[112,] -0.50452660 -0.66721528
[113,] 0.63370253 -0.50452660
[114,] 0.78927363 0.63370253
[115,] 1.03186690 0.78927363
[116,] -1.19281876 1.03186690
[117,] -0.50452660 -1.19281876
[118,] 0.56826041 -0.50452660
[119,] -0.44252962 0.56826041
[120,] -1.44252962 -0.44252962
[121,] -1.43541203 -1.44252962
[122,] 0.56458797 -1.43541203
[123,] -1.21072637 0.56458797
[124,] -1.26905091 -1.21072637
[125,] 0.27446018 -1.26905091
[126,] 0.32566713 0.27446018
[127,] -0.96813310 0.32566713
[128,] -0.43541203 -0.96813310
[129,] -0.96813310 -0.43541203
[130,] -0.19993634 -0.96813310
[131,] 1.03186690 -0.19993634
[132,] -1.14161181 1.03186690
[133,] -2.14161181 -1.14161181
[134,] 1.26367015 -2.14161181
[135,] -0.25114329 1.26367015
[136,] 1.26367015 -0.25114329
[137,] -0.19993634 1.26367015
[138,] -1.43541203 -0.19993634
[139,] -0.96813310 -1.43541203
[140,] -0.73632985 -0.96813310
[141,] 1.32911228 -0.73632985
[142,] 0.45872892 1.32911228
[143,] -0.21072637 0.45872892
[144,] -0.78386436 -0.21072637
[145,] -0.96813310 -0.78386436
[146,] 0.03898449 -0.96813310
[147,] -0.96813310 0.03898449
[148,] -0.50085416 -0.96813310
[149,] 0.80006366 -0.50085416
[150,] -1.14161181 0.80006366
[151,] 1.33278472 -1.14161181
[152,] 0.22325323 1.33278472
[153,] 0.80006366 0.22325323
[154,] -0.42462200 0.80006366
[155,] 1.03186690 -0.42462200
[156,] -0.96813310 1.03186690
[157,] 0.33278472 -0.96813310
[158,] -1.25114329 0.33278472
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.21072637 1.32199469
2 0.86550578 -1.21072637
3 0.32199469 0.86550578
4 0.03186690 0.32199469
5 -0.14161181 0.03186690
6 -1.02645763 -0.14161181
7 0.09019144 -1.02645763
8 1.55747038 0.09019144
9 0.38743682 1.55747038
10 0.80006366 0.38743682
11 -1.78386436 0.80006366
12 -0.96813310 -1.78386436
13 -0.90980856 -0.96813310
14 1.32566713 -0.90980856
15 0.27446018 1.32566713
16 0.49914584 0.27446018
17 -0.96813310 0.49914584
18 1.03898449 -0.96813310
19 -0.19281876 1.03898449
20 -0.14528425 -0.19281876
21 0.56826041 -0.14528425
22 -0.66721528 0.56826041
23 -0.73632985 -0.66721528
24 -0.96813310 -0.73632985
25 -0.72553982 -0.96813310
26 0.33278472 -0.72553982
27 1.03186690 0.33278472
28 0.86550578 1.03186690
29 0.80006366 0.86550578
30 0.49547340 0.80006366
31 0.27446018 0.49547340
32 -0.83357640 0.27446018
33 1.26367015 -0.83357640
34 1.33278472 1.26367015
35 -0.50085416 1.33278472
36 -0.73632985 -0.50085416
37 0.85838819 -0.73632985
38 0.63370253 0.85838819
39 -0.14161181 0.63370253
40 0.86550578 -0.14161181
41 -1.66721528 0.86550578
42 1.03186690 -1.66721528
43 -0.13449422 1.03186690
44 -0.73632985 -0.13449422
45 -0.79465438 -0.73632985
46 0.80006366 -0.79465438
47 -0.73632985 0.80006366
48 -1.19993634 -0.73632985
49 0.21613564 -1.19993634
50 -0.97892312 0.21613564
51 -1.19993634 -0.97892312
52 1.26367015 -1.19993634
53 -0.97892312 1.26367015
54 0.22325323 -0.97892312
55 1.03186690 0.22325323
56 1.26367015 1.03186690
57 0.80006366 1.26367015
58 -1.44252962 0.80006366
59 1.26367015 -1.44252962
60 1.26367015 1.26367015
61 1.03186690 1.26367015
62 0.32911228 1.03186690
63 -0.50452660 0.32911228
64 1.55747038 -0.50452660
65 0.32199469 1.55747038
66 -0.96813310 0.32199469
67 1.03186690 -0.96813310
68 1.55747038 1.03186690
69 0.26367015 1.55747038
70 0.03186690 0.26367015
71 -0.67800531 0.03186690
72 0.27446018 -0.67800531
73 0.27446018 0.27446018
74 0.74173912 0.27446018
75 1.26367015 0.74173912
76 0.56458797 1.26367015
77 0.80006366 0.56458797
78 -0.90980856 0.80006366
79 -1.31658542 -0.90980856
80 1.20534562 -1.31658542
81 -0.96813310 1.20534562
82 1.49914584 -0.96813310
83 1.33278472 1.49914584
84 -0.67800531 1.33278472
85 -0.13449422 -0.67800531
86 -0.79465438 -0.13449422
87 1.78927363 -0.79465438
88 -0.13449422 1.78927363
89 -1.43541203 -0.13449422
90 0.80006366 -1.43541203
91 -2.14528425 0.80006366
92 -0.67800531 -2.14528425
93 1.56458797 -0.67800531
94 -0.96813310 1.56458797
95 0.04977452 -0.96813310
96 0.79639122 0.04977452
97 -0.01934004 0.79639122
98 -1.14161181 -0.01934004
99 -1.02645763 -1.14161181
100 0.80006366 -1.02645763
101 -1.43541203 0.80006366
102 -0.01934004 -1.43541203
103 0.73806668 -0.01934004
104 -0.96813310 0.73806668
105 1.32199469 -0.96813310
106 -1.37708750 1.32199469
107 1.26367015 -1.37708750
108 0.74173912 1.26367015
109 1.26367015 0.74173912
110 -0.14161181 1.26367015
111 -0.66721528 -0.14161181
112 -0.50452660 -0.66721528
113 0.63370253 -0.50452660
114 0.78927363 0.63370253
115 1.03186690 0.78927363
116 -1.19281876 1.03186690
117 -0.50452660 -1.19281876
118 0.56826041 -0.50452660
119 -0.44252962 0.56826041
120 -1.44252962 -0.44252962
121 -1.43541203 -1.44252962
122 0.56458797 -1.43541203
123 -1.21072637 0.56458797
124 -1.26905091 -1.21072637
125 0.27446018 -1.26905091
126 0.32566713 0.27446018
127 -0.96813310 0.32566713
128 -0.43541203 -0.96813310
129 -0.96813310 -0.43541203
130 -0.19993634 -0.96813310
131 1.03186690 -0.19993634
132 -1.14161181 1.03186690
133 -2.14161181 -1.14161181
134 1.26367015 -2.14161181
135 -0.25114329 1.26367015
136 1.26367015 -0.25114329
137 -0.19993634 1.26367015
138 -1.43541203 -0.19993634
139 -0.96813310 -1.43541203
140 -0.73632985 -0.96813310
141 1.32911228 -0.73632985
142 0.45872892 1.32911228
143 -0.21072637 0.45872892
144 -0.78386436 -0.21072637
145 -0.96813310 -0.78386436
146 0.03898449 -0.96813310
147 -0.96813310 0.03898449
148 -0.50085416 -0.96813310
149 0.80006366 -0.50085416
150 -1.14161181 0.80006366
151 1.33278472 -1.14161181
152 0.22325323 1.33278472
153 0.80006366 0.22325323
154 -0.42462200 0.80006366
155 1.03186690 -0.42462200
156 -0.96813310 1.03186690
157 0.33278472 -0.96813310
158 -1.25114329 0.33278472
> 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/7esqk1291288871.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/8p1qn1291288871.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/9p1qn1291288871.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/100sp81291288871.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/113tow1291288871.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/126bm11291288871.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/132lka1291288871.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/146m0y1291288871.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/159mz41291288871.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/16umxs1291288871.tab")
+ }
>
> try(system("convert tmp/1trsw1291288871.ps tmp/1trsw1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/2trsw1291288871.ps tmp/2trsw1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/3mi9h1291288871.ps tmp/3mi9h1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/4mi9h1291288871.ps tmp/4mi9h1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/5mi9h1291288871.ps tmp/5mi9h1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/6esqk1291288871.ps tmp/6esqk1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/7esqk1291288871.ps tmp/7esqk1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/8p1qn1291288871.ps tmp/8p1qn1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/9p1qn1291288871.ps tmp/9p1qn1291288871.png",intern=TRUE))
character(0)
> try(system("convert tmp/100sp81291288871.ps tmp/100sp81291288871.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.924 1.739 14.647