R version 2.12.1 (2010-12-16)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,8
+ ,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
+ ,15
+ ,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
+ 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)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Depressie belasting autonomie conformistisch agressief
1 13 13 14 13 3
2 12 12 8 13 5
3 8 10 12 16 6
4 12 9 7 12 6
5 10 10 10 11 5
6 12 12 7 12 3
7 15 13 16 18 8
8 9 12 11 11 4
9 12 15 14 14 4
10 11 6 6 9 4
11 11 5 16 14 6
12 11 12 11 12 6
13 15 11 16 11 5
14 7 14 12 12 4
15 11 14 7 13 6
16 11 12 13 11 4
17 10 12 11 12 6
18 14 11 15 16 6
19 10 11 7 9 4
20 6 7 9 11 4
21 11 9 7 13 2
22 15 11 14 15 7
23 11 11 15 10 5
24 12 12 7 11 4
25 14 12 15 13 6
26 15 11 17 16 6
27 9 11 15 15 7
28 13 8 14 14 5
29 13 9 14 14 6
30 16 12 8 14 4
31 13 10 8 8 4
32 12 10 14 13 7
33 14 12 14 15 7
34 11 8 8 13 4
35 9 12 11 11 4
36 16 11 16 15 6
37 12 12 10 15 6
38 10 7 8 9 5
39 13 11 14 13 6
40 16 11 16 16 7
41 14 12 13 13 6
42 15 9 5 11 3
43 5 15 8 12 3
44 8 11 10 12 4
45 11 11 8 12 6
46 16 11 13 14 7
47 17 11 15 14 5
48 9 15 6 8 4
49 9 11 12 13 5
50 13 12 16 16 6
51 10 12 5 13 6
52 6 9 15 11 6
53 12 12 12 14 5
54 8 12 8 13 4
55 14 13 13 13 5
56 12 11 14 13 5
57 11 9 12 12 4
58 16 9 16 16 6
59 8 11 10 15 2
60 15 11 15 15 8
61 7 12 8 12 3
62 16 12 16 14 6
63 14 9 19 12 6
64 16 11 14 15 6
65 9 9 6 12 5
66 14 12 13 13 5
67 11 12 15 12 6
68 13 12 7 12 5
69 15 12 13 13 6
70 5 14 4 5 2
71 15 11 14 13 5
72 13 12 13 13 5
73 11 11 11 14 5
74 11 6 14 17 6
75 12 10 12 13 6
76 12 12 15 13 6
77 12 13 14 12 5
78 12 8 13 13 5
79 14 12 8 14 4
80 6 12 6 11 2
81 7 12 7 12 4
82 14 6 13 12 6
83 14 11 13 16 6
84 10 10 11 12 5
85 13 12 5 12 3
86 12 13 12 12 6
87 9 11 8 10 4
88 12 7 11 15 5
89 16 11 14 15 8
90 10 11 9 12 4
91 14 11 10 16 6
92 10 11 13 15 6
93 16 12 16 16 7
94 15 10 16 13 6
95 12 11 11 12 5
96 10 12 8 11 4
97 8 7 4 13 6
98 8 13 7 10 3
99 11 8 14 15 5
100 13 12 11 13 6
101 16 11 17 16 7
102 16 12 15 15 7
103 14 14 17 18 6
104 11 10 5 13 3
105 4 10 4 10 2
106 14 13 10 16 8
107 9 10 11 13 3
108 14 11 15 15 8
109 8 10 10 14 3
110 8 7 9 15 4
111 11 10 12 14 5
112 12 8 15 13 7
113 11 12 7 13 6
114 14 12 13 15 6
115 15 12 12 16 7
116 16 11 14 14 6
117 16 12 14 14 6
118 11 12 8 16 6
119 14 12 15 14 6
120 14 11 12 12 4
121 12 12 12 13 4
122 14 11 16 12 5
123 8 11 9 12 4
124 13 13 15 14 6
125 16 12 15 14 6
126 12 12 6 14 5
127 16 12 14 16 8
128 12 12 15 13 6
129 11 8 10 14 5
130 4 8 6 4 4
131 16 12 14 16 8
132 15 11 12 13 6
133 10 12 8 16 4
134 13 13 11 15 6
135 15 12 13 14 6
136 12 12 9 13 4
137 14 11 15 14 6
138 7 12 13 12 3
139 19 12 15 15 6
140 12 10 14 14 5
141 12 11 16 13 4
142 13 12 14 14 6
143 15 12 14 16 4
144 8 10 10 6 4
145 12 12 10 13 4
146 10 13 4 13 6
147 8 12 8 14 5
148 10 15 15 15 6
149 15 11 16 14 6
150 16 12 12 15 8
151 13 11 12 13 7
152 16 12 15 16 7
153 9 11 9 12 4
154 14 10 12 15 6
155 14 11 14 12 6
156 12 11 11 14 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) belasting autonomie conformistisch agressief
0.4581 0.1091 0.2529 0.3136 0.6266
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.4433 -1.2948 -0.0792 1.2693 6.9657
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.45813 1.44328 0.317 0.751363
belasting 0.10912 0.09649 1.131 0.259876
autonomie 0.25291 0.06260 4.040 8.48e-05 ***
conformistisch 0.31361 0.09848 3.184 0.001762 **
agressief 0.62662 0.15924 3.935 0.000127 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.148 on 151 degrees of freedom
Multiple R-squared: 0.4815, Adjusted R-squared: 0.4678
F-statistic: 35.06 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.7402498 0.519500340 0.2597501699
[2,] 0.6763589 0.647282267 0.3236411334
[3,] 0.7234805 0.553039054 0.2765195268
[4,] 0.6362753 0.727449342 0.3637246711
[5,] 0.5337764 0.932447201 0.4662236004
[6,] 0.5952666 0.809466799 0.4047333997
[7,] 0.8598925 0.280215059 0.1401075293
[8,] 0.8025623 0.394875399 0.1974376994
[9,] 0.7369341 0.526131859 0.2630659295
[10,] 0.7006581 0.598683724 0.2993418620
[11,] 0.6710866 0.657826704 0.3289133518
[12,] 0.5979657 0.804068639 0.4020343194
[13,] 0.7465503 0.506899323 0.2534496613
[14,] 0.7249455 0.550109082 0.2750545409
[15,] 0.7336745 0.532650967 0.2663254837
[16,] 0.6738721 0.652255802 0.3261279010
[17,] 0.6578201 0.684359713 0.3421798567
[18,] 0.6257859 0.748428151 0.3742140756
[19,] 0.5968953 0.806209446 0.4031047232
[20,] 0.7558940 0.488212069 0.2441060347
[21,] 0.7191291 0.561741892 0.2808709462
[22,] 0.6725848 0.654830472 0.3274152360
[23,] 0.8436361 0.312727878 0.1563639390
[24,] 0.8975926 0.204814772 0.1024073860
[25,] 0.8735925 0.252815090 0.1264075449
[26,] 0.8503079 0.299384135 0.1496920674
[27,] 0.8177531 0.364493752 0.1822468760
[28,] 0.8135008 0.372998473 0.1864992365
[29,] 0.8362806 0.327438719 0.1637193594
[30,] 0.8018497 0.396300575 0.1981502874
[31,] 0.7646276 0.470744897 0.2353724486
[32,] 0.7244372 0.551125622 0.2755628111
[33,] 0.7226877 0.554624658 0.2773123291
[34,] 0.6983724 0.603255190 0.3016275952
[35,] 0.9158162 0.168367515 0.0841837576
[36,] 0.9829079 0.034184113 0.0170920564
[37,] 0.9861568 0.027686361 0.0138431804
[38,] 0.9810463 0.037907443 0.0189537215
[39,] 0.9843508 0.031298315 0.0156491574
[40,] 0.9935450 0.012910040 0.0064550200
[41,] 0.9909770 0.018046033 0.0090230166
[42,] 0.9931419 0.013716122 0.0068580611
[43,] 0.9918186 0.016362793 0.0081813964
[44,] 0.9892183 0.021563380 0.0107816902
[45,] 0.9992637 0.001472548 0.0007362741
[46,] 0.9988999 0.002200138 0.0011000690
[47,] 0.9991212 0.001757664 0.0008788318
[48,] 0.9990046 0.001990872 0.0009954358
[49,] 0.9985397 0.002920537 0.0014602683
[50,] 0.9978926 0.004214740 0.0021073699
[51,] 0.9977007 0.004598558 0.0022992792
[52,] 0.9981512 0.003697606 0.0018488032
[53,] 0.9974794 0.005041270 0.0025206348
[54,] 0.9978706 0.004258741 0.0021293705
[55,] 0.9979592 0.004081638 0.0020408191
[56,] 0.9971070 0.005785937 0.0028929685
[57,] 0.9973855 0.005229001 0.0026145004
[58,] 0.9965416 0.006916706 0.0034583531
[59,] 0.9961127 0.007774501 0.0038872505
[60,] 0.9961190 0.007762090 0.0038810449
[61,] 0.9968013 0.006397461 0.0031987307
[62,] 0.9968266 0.006346794 0.0031733971
[63,] 0.9958043 0.008391379 0.0041956895
[64,] 0.9964541 0.007091763 0.0035458814
[65,] 0.9951829 0.009634210 0.0048171049
[66,] 0.9937018 0.012596483 0.0062982417
[67,] 0.9951149 0.009770111 0.0048850554
[68,] 0.9932412 0.013517596 0.0067587979
[69,] 0.9920423 0.015915475 0.0079577374
[70,] 0.9892133 0.021573333 0.0107866665
[71,] 0.9853831 0.029233783 0.0146168917
[72,] 0.9913134 0.017373111 0.0086865553
[73,] 0.9908918 0.018216456 0.0091082281
[74,] 0.9925481 0.014903723 0.0074518616
[75,] 0.9929308 0.014138373 0.0070691863
[76,] 0.9902935 0.019413013 0.0097065064
[77,] 0.9878887 0.024222546 0.0121112730
[78,] 0.9970273 0.005945459 0.0029727295
[79,] 0.9958458 0.008308334 0.0041541670
[80,] 0.9942093 0.011581458 0.0057907289
[81,] 0.9921407 0.015718540 0.0078592701
[82,] 0.9899558 0.020088404 0.0100442019
[83,] 0.9863438 0.027312330 0.0136561652
[84,] 0.9832459 0.033508150 0.0167540750
[85,] 0.9908303 0.018339422 0.0091697112
[86,] 0.9878633 0.024273339 0.0121366696
[87,] 0.9856536 0.028692760 0.0143463800
[88,] 0.9813355 0.037329002 0.0186645010
[89,] 0.9756647 0.048670537 0.0243352687
[90,] 0.9726265 0.054747033 0.0273735163
[91,] 0.9643716 0.071256884 0.0356284420
[92,] 0.9619557 0.076088609 0.0380443043
[93,] 0.9517257 0.096548568 0.0482742840
[94,] 0.9390480 0.121904094 0.0609520472
[95,] 0.9272935 0.145413027 0.0727065134
[96,] 0.9346511 0.130697822 0.0653489112
[97,] 0.9557878 0.088424498 0.0442122488
[98,] 0.9549048 0.090190412 0.0450952059
[99,] 0.9422976 0.115404824 0.0577024120
[100,] 0.9297106 0.140578726 0.0702893628
[101,] 0.9265518 0.146896368 0.0734481840
[102,] 0.9257662 0.148467564 0.0742337820
[103,] 0.9410821 0.117835737 0.0589178685
[104,] 0.9344140 0.131172078 0.0655860390
[105,] 0.9549966 0.090006898 0.0450034490
[106,] 0.9409200 0.118160091 0.0590800456
[107,] 0.9231831 0.153633786 0.0768168930
[108,] 0.9020203 0.195959495 0.0979797473
[109,] 0.9006863 0.198627416 0.0993137078
[110,] 0.9059282 0.188143505 0.0940717527
[111,] 0.8978494 0.204301291 0.1021506455
[112,] 0.8697747 0.260450552 0.1302252762
[113,] 0.9090879 0.181824269 0.0909121343
[114,] 0.8887725 0.222455001 0.1112275003
[115,] 0.8693638 0.261272349 0.1306361745
[116,] 0.8619020 0.276195987 0.1380979933
[117,] 0.8295068 0.340986343 0.1704931717
[118,] 0.8289345 0.342130916 0.1710654581
[119,] 0.8142563 0.371487435 0.1857437174
[120,] 0.7702850 0.459429972 0.2297149858
[121,] 0.7465339 0.506932254 0.2534661269
[122,] 0.7620054 0.475989257 0.2379946286
[123,] 0.7590452 0.481909692 0.2409548459
[124,] 0.7066229 0.586754210 0.2933771051
[125,] 0.6949214 0.610157252 0.3050786260
[126,] 0.6681201 0.663759888 0.3318799442
[127,] 0.5987706 0.802458878 0.4012294392
[128,] 0.5735849 0.852830289 0.4264151446
[129,] 0.5684635 0.863072980 0.4315364902
[130,] 0.4950571 0.990114253 0.5049428735
[131,] 0.5619602 0.876079605 0.4380398024
[132,] 0.8689951 0.262009797 0.1310048985
[133,] 0.8930558 0.213888413 0.1069442067
[134,] 0.8617994 0.276401175 0.1382005875
[135,] 0.7988523 0.402295333 0.2011476665
[136,] 0.7715911 0.456817761 0.2284088806
[137,] 0.6777752 0.644449631 0.3222248157
[138,] 0.6667414 0.666517111 0.3332585556
[139,] 0.7800951 0.439809726 0.2199048630
[140,] 0.7464801 0.507039809 0.2535199045
[141,] 0.8596824 0.280635240 0.1403176202
> postscript(file="/var/www/rcomp/tmp/1xqfa1321627983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/2evur1321627983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/33xii1321627983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/4aj631321627983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/5vu0w1321627983.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.62580640 0.99915175 -5.36168673 1.26641451 -0.66121129 2.81890552
7 8 9 10 11 12
-1.58114156 -1.50574550 -0.53266142 3.04074654 -2.20050654 -1.07258920
13 14 15 16 17 18
2.71220710 -4.29050527 -0.59279857 -0.01156566 -2.07258920 -0.22953810
19 20 21 22 23 24
1.24223080 -3.45431969 2.45927962 0.71036128 -0.72127539 2.50589482
25 26 27 28 29 30
0.60216306 0.26464174 -5.54254880 0.60456836 -0.13117090 5.31216245
31 32 33 34 35 36
4.41204928 -1.55330274 -0.39875986 1.06225440 -1.50574550 1.83115925
37 38 39 40 41 42
-0.76050140 0.79918712 -0.03580573 0.89093369 1.10798321 6.96569650
43 44 45 46 47 48
-4.76136795 -2.45732172 -0.20473783 2.27687878 4.02429489 0.37226379
49 50 51 52 53 54
-2.90336744 -1.59156931 -0.86873615 -6.44325869 -0.32609600 -2.37423012
55 56 57 58 59 60
1.62548022 -0.40918760 0.25510038 1.73579408 -2.14490774 -0.16916694
61 62 63 64 65 66
-2.43400456 2.03564555 0.23149356 2.33697941 -0.85405727 1.73460135
67 68 69 70 71 72
-2.08422952 2.56566925 2.10798321 -0.81873637 2.59081240 0.73460135
73 74 75 76 77 78
-0.96406479 -2.74462979 -0.42086444 -1.39783694 -0.31382243 0.17108587
79 80 81 82 83 84
3.31216245 -1.98795884 -2.80771261 2.07631743 0.27628206 -1.22772880
85 86 87 88 89 90
4.32472568 -0.43462041 -0.32428670 0.15881230 1.08374314 -0.20441164
91 92 93 94 95 96
1.03501230 -3.41011051 0.78181256 1.56749524 0.66315007 0.25298474
97 98 99 100 101 102
-2.07022041 -0.66300075 -1.70903907 0.61380337 0.63802361 1.34833006
103 104 105 106 107 108
-1.68993651 2.22936051 -2.95028899 -0.43646623 -1.28809997 -1.16916694
109 110 111 112 113 114
-2.34879731 -2.70874940 -1.10785374 -1.58797055 -0.37455631 0.48076836
115 116 117 118 119 120
0.79345288 2.65058684 2.54146571 -1.56828867 0.28855563 3.03685812
121 122 123 124 125 126
0.61412956 1.39859967 -2.20441164 -0.82056550 2.28855563 1.19136448
127 128 129 130 131 132
0.66101458 -1.39783694 -0.38379132 -2.60945858 0.66101458 2.47001443
133 134 135 136 137 138
-1.31505241 -0.12253261 1.79437579 1.37285980 0.39767676 -3.69855496
139 140 141 142 143 144
4.97494820 -0.61367390 -0.28838963 -0.45853429 2.16748711 -0.46655602
145 146 147 148 149 150
1.11994972 -0.72494720 -3.31445568 -4.35241520 1.14476668 1.48044217
151 152 153 154 155 156
-0.15660371 1.03472264 -1.20441164 0.95192070 1.27780169 1.91578961
> postscript(file="/var/www/rcomp/tmp/6k6me1321627983.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.62580640 NA
1 0.99915175 1.62580640
2 -5.36168673 0.99915175
3 1.26641451 -5.36168673
4 -0.66121129 1.26641451
5 2.81890552 -0.66121129
6 -1.58114156 2.81890552
7 -1.50574550 -1.58114156
8 -0.53266142 -1.50574550
9 3.04074654 -0.53266142
10 -2.20050654 3.04074654
11 -1.07258920 -2.20050654
12 2.71220710 -1.07258920
13 -4.29050527 2.71220710
14 -0.59279857 -4.29050527
15 -0.01156566 -0.59279857
16 -2.07258920 -0.01156566
17 -0.22953810 -2.07258920
18 1.24223080 -0.22953810
19 -3.45431969 1.24223080
20 2.45927962 -3.45431969
21 0.71036128 2.45927962
22 -0.72127539 0.71036128
23 2.50589482 -0.72127539
24 0.60216306 2.50589482
25 0.26464174 0.60216306
26 -5.54254880 0.26464174
27 0.60456836 -5.54254880
28 -0.13117090 0.60456836
29 5.31216245 -0.13117090
30 4.41204928 5.31216245
31 -1.55330274 4.41204928
32 -0.39875986 -1.55330274
33 1.06225440 -0.39875986
34 -1.50574550 1.06225440
35 1.83115925 -1.50574550
36 -0.76050140 1.83115925
37 0.79918712 -0.76050140
38 -0.03580573 0.79918712
39 0.89093369 -0.03580573
40 1.10798321 0.89093369
41 6.96569650 1.10798321
42 -4.76136795 6.96569650
43 -2.45732172 -4.76136795
44 -0.20473783 -2.45732172
45 2.27687878 -0.20473783
46 4.02429489 2.27687878
47 0.37226379 4.02429489
48 -2.90336744 0.37226379
49 -1.59156931 -2.90336744
50 -0.86873615 -1.59156931
51 -6.44325869 -0.86873615
52 -0.32609600 -6.44325869
53 -2.37423012 -0.32609600
54 1.62548022 -2.37423012
55 -0.40918760 1.62548022
56 0.25510038 -0.40918760
57 1.73579408 0.25510038
58 -2.14490774 1.73579408
59 -0.16916694 -2.14490774
60 -2.43400456 -0.16916694
61 2.03564555 -2.43400456
62 0.23149356 2.03564555
63 2.33697941 0.23149356
64 -0.85405727 2.33697941
65 1.73460135 -0.85405727
66 -2.08422952 1.73460135
67 2.56566925 -2.08422952
68 2.10798321 2.56566925
69 -0.81873637 2.10798321
70 2.59081240 -0.81873637
71 0.73460135 2.59081240
72 -0.96406479 0.73460135
73 -2.74462979 -0.96406479
74 -0.42086444 -2.74462979
75 -1.39783694 -0.42086444
76 -0.31382243 -1.39783694
77 0.17108587 -0.31382243
78 3.31216245 0.17108587
79 -1.98795884 3.31216245
80 -2.80771261 -1.98795884
81 2.07631743 -2.80771261
82 0.27628206 2.07631743
83 -1.22772880 0.27628206
84 4.32472568 -1.22772880
85 -0.43462041 4.32472568
86 -0.32428670 -0.43462041
87 0.15881230 -0.32428670
88 1.08374314 0.15881230
89 -0.20441164 1.08374314
90 1.03501230 -0.20441164
91 -3.41011051 1.03501230
92 0.78181256 -3.41011051
93 1.56749524 0.78181256
94 0.66315007 1.56749524
95 0.25298474 0.66315007
96 -2.07022041 0.25298474
97 -0.66300075 -2.07022041
98 -1.70903907 -0.66300075
99 0.61380337 -1.70903907
100 0.63802361 0.61380337
101 1.34833006 0.63802361
102 -1.68993651 1.34833006
103 2.22936051 -1.68993651
104 -2.95028899 2.22936051
105 -0.43646623 -2.95028899
106 -1.28809997 -0.43646623
107 -1.16916694 -1.28809997
108 -2.34879731 -1.16916694
109 -2.70874940 -2.34879731
110 -1.10785374 -2.70874940
111 -1.58797055 -1.10785374
112 -0.37455631 -1.58797055
113 0.48076836 -0.37455631
114 0.79345288 0.48076836
115 2.65058684 0.79345288
116 2.54146571 2.65058684
117 -1.56828867 2.54146571
118 0.28855563 -1.56828867
119 3.03685812 0.28855563
120 0.61412956 3.03685812
121 1.39859967 0.61412956
122 -2.20441164 1.39859967
123 -0.82056550 -2.20441164
124 2.28855563 -0.82056550
125 1.19136448 2.28855563
126 0.66101458 1.19136448
127 -1.39783694 0.66101458
128 -0.38379132 -1.39783694
129 -2.60945858 -0.38379132
130 0.66101458 -2.60945858
131 2.47001443 0.66101458
132 -1.31505241 2.47001443
133 -0.12253261 -1.31505241
134 1.79437579 -0.12253261
135 1.37285980 1.79437579
136 0.39767676 1.37285980
137 -3.69855496 0.39767676
138 4.97494820 -3.69855496
139 -0.61367390 4.97494820
140 -0.28838963 -0.61367390
141 -0.45853429 -0.28838963
142 2.16748711 -0.45853429
143 -0.46655602 2.16748711
144 1.11994972 -0.46655602
145 -0.72494720 1.11994972
146 -3.31445568 -0.72494720
147 -4.35241520 -3.31445568
148 1.14476668 -4.35241520
149 1.48044217 1.14476668
150 -0.15660371 1.48044217
151 1.03472264 -0.15660371
152 -1.20441164 1.03472264
153 0.95192070 -1.20441164
154 1.27780169 0.95192070
155 1.91578961 1.27780169
156 NA 1.91578961
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.99915175 1.62580640
[2,] -5.36168673 0.99915175
[3,] 1.26641451 -5.36168673
[4,] -0.66121129 1.26641451
[5,] 2.81890552 -0.66121129
[6,] -1.58114156 2.81890552
[7,] -1.50574550 -1.58114156
[8,] -0.53266142 -1.50574550
[9,] 3.04074654 -0.53266142
[10,] -2.20050654 3.04074654
[11,] -1.07258920 -2.20050654
[12,] 2.71220710 -1.07258920
[13,] -4.29050527 2.71220710
[14,] -0.59279857 -4.29050527
[15,] -0.01156566 -0.59279857
[16,] -2.07258920 -0.01156566
[17,] -0.22953810 -2.07258920
[18,] 1.24223080 -0.22953810
[19,] -3.45431969 1.24223080
[20,] 2.45927962 -3.45431969
[21,] 0.71036128 2.45927962
[22,] -0.72127539 0.71036128
[23,] 2.50589482 -0.72127539
[24,] 0.60216306 2.50589482
[25,] 0.26464174 0.60216306
[26,] -5.54254880 0.26464174
[27,] 0.60456836 -5.54254880
[28,] -0.13117090 0.60456836
[29,] 5.31216245 -0.13117090
[30,] 4.41204928 5.31216245
[31,] -1.55330274 4.41204928
[32,] -0.39875986 -1.55330274
[33,] 1.06225440 -0.39875986
[34,] -1.50574550 1.06225440
[35,] 1.83115925 -1.50574550
[36,] -0.76050140 1.83115925
[37,] 0.79918712 -0.76050140
[38,] -0.03580573 0.79918712
[39,] 0.89093369 -0.03580573
[40,] 1.10798321 0.89093369
[41,] 6.96569650 1.10798321
[42,] -4.76136795 6.96569650
[43,] -2.45732172 -4.76136795
[44,] -0.20473783 -2.45732172
[45,] 2.27687878 -0.20473783
[46,] 4.02429489 2.27687878
[47,] 0.37226379 4.02429489
[48,] -2.90336744 0.37226379
[49,] -1.59156931 -2.90336744
[50,] -0.86873615 -1.59156931
[51,] -6.44325869 -0.86873615
[52,] -0.32609600 -6.44325869
[53,] -2.37423012 -0.32609600
[54,] 1.62548022 -2.37423012
[55,] -0.40918760 1.62548022
[56,] 0.25510038 -0.40918760
[57,] 1.73579408 0.25510038
[58,] -2.14490774 1.73579408
[59,] -0.16916694 -2.14490774
[60,] -2.43400456 -0.16916694
[61,] 2.03564555 -2.43400456
[62,] 0.23149356 2.03564555
[63,] 2.33697941 0.23149356
[64,] -0.85405727 2.33697941
[65,] 1.73460135 -0.85405727
[66,] -2.08422952 1.73460135
[67,] 2.56566925 -2.08422952
[68,] 2.10798321 2.56566925
[69,] -0.81873637 2.10798321
[70,] 2.59081240 -0.81873637
[71,] 0.73460135 2.59081240
[72,] -0.96406479 0.73460135
[73,] -2.74462979 -0.96406479
[74,] -0.42086444 -2.74462979
[75,] -1.39783694 -0.42086444
[76,] -0.31382243 -1.39783694
[77,] 0.17108587 -0.31382243
[78,] 3.31216245 0.17108587
[79,] -1.98795884 3.31216245
[80,] -2.80771261 -1.98795884
[81,] 2.07631743 -2.80771261
[82,] 0.27628206 2.07631743
[83,] -1.22772880 0.27628206
[84,] 4.32472568 -1.22772880
[85,] -0.43462041 4.32472568
[86,] -0.32428670 -0.43462041
[87,] 0.15881230 -0.32428670
[88,] 1.08374314 0.15881230
[89,] -0.20441164 1.08374314
[90,] 1.03501230 -0.20441164
[91,] -3.41011051 1.03501230
[92,] 0.78181256 -3.41011051
[93,] 1.56749524 0.78181256
[94,] 0.66315007 1.56749524
[95,] 0.25298474 0.66315007
[96,] -2.07022041 0.25298474
[97,] -0.66300075 -2.07022041
[98,] -1.70903907 -0.66300075
[99,] 0.61380337 -1.70903907
[100,] 0.63802361 0.61380337
[101,] 1.34833006 0.63802361
[102,] -1.68993651 1.34833006
[103,] 2.22936051 -1.68993651
[104,] -2.95028899 2.22936051
[105,] -0.43646623 -2.95028899
[106,] -1.28809997 -0.43646623
[107,] -1.16916694 -1.28809997
[108,] -2.34879731 -1.16916694
[109,] -2.70874940 -2.34879731
[110,] -1.10785374 -2.70874940
[111,] -1.58797055 -1.10785374
[112,] -0.37455631 -1.58797055
[113,] 0.48076836 -0.37455631
[114,] 0.79345288 0.48076836
[115,] 2.65058684 0.79345288
[116,] 2.54146571 2.65058684
[117,] -1.56828867 2.54146571
[118,] 0.28855563 -1.56828867
[119,] 3.03685812 0.28855563
[120,] 0.61412956 3.03685812
[121,] 1.39859967 0.61412956
[122,] -2.20441164 1.39859967
[123,] -0.82056550 -2.20441164
[124,] 2.28855563 -0.82056550
[125,] 1.19136448 2.28855563
[126,] 0.66101458 1.19136448
[127,] -1.39783694 0.66101458
[128,] -0.38379132 -1.39783694
[129,] -2.60945858 -0.38379132
[130,] 0.66101458 -2.60945858
[131,] 2.47001443 0.66101458
[132,] -1.31505241 2.47001443
[133,] -0.12253261 -1.31505241
[134,] 1.79437579 -0.12253261
[135,] 1.37285980 1.79437579
[136,] 0.39767676 1.37285980
[137,] -3.69855496 0.39767676
[138,] 4.97494820 -3.69855496
[139,] -0.61367390 4.97494820
[140,] -0.28838963 -0.61367390
[141,] -0.45853429 -0.28838963
[142,] 2.16748711 -0.45853429
[143,] -0.46655602 2.16748711
[144,] 1.11994972 -0.46655602
[145,] -0.72494720 1.11994972
[146,] -3.31445568 -0.72494720
[147,] -4.35241520 -3.31445568
[148,] 1.14476668 -4.35241520
[149,] 1.48044217 1.14476668
[150,] -0.15660371 1.48044217
[151,] 1.03472264 -0.15660371
[152,] -1.20441164 1.03472264
[153,] 0.95192070 -1.20441164
[154,] 1.27780169 0.95192070
[155,] 1.91578961 1.27780169
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.99915175 1.62580640
2 -5.36168673 0.99915175
3 1.26641451 -5.36168673
4 -0.66121129 1.26641451
5 2.81890552 -0.66121129
6 -1.58114156 2.81890552
7 -1.50574550 -1.58114156
8 -0.53266142 -1.50574550
9 3.04074654 -0.53266142
10 -2.20050654 3.04074654
11 -1.07258920 -2.20050654
12 2.71220710 -1.07258920
13 -4.29050527 2.71220710
14 -0.59279857 -4.29050527
15 -0.01156566 -0.59279857
16 -2.07258920 -0.01156566
17 -0.22953810 -2.07258920
18 1.24223080 -0.22953810
19 -3.45431969 1.24223080
20 2.45927962 -3.45431969
21 0.71036128 2.45927962
22 -0.72127539 0.71036128
23 2.50589482 -0.72127539
24 0.60216306 2.50589482
25 0.26464174 0.60216306
26 -5.54254880 0.26464174
27 0.60456836 -5.54254880
28 -0.13117090 0.60456836
29 5.31216245 -0.13117090
30 4.41204928 5.31216245
31 -1.55330274 4.41204928
32 -0.39875986 -1.55330274
33 1.06225440 -0.39875986
34 -1.50574550 1.06225440
35 1.83115925 -1.50574550
36 -0.76050140 1.83115925
37 0.79918712 -0.76050140
38 -0.03580573 0.79918712
39 0.89093369 -0.03580573
40 1.10798321 0.89093369
41 6.96569650 1.10798321
42 -4.76136795 6.96569650
43 -2.45732172 -4.76136795
44 -0.20473783 -2.45732172
45 2.27687878 -0.20473783
46 4.02429489 2.27687878
47 0.37226379 4.02429489
48 -2.90336744 0.37226379
49 -1.59156931 -2.90336744
50 -0.86873615 -1.59156931
51 -6.44325869 -0.86873615
52 -0.32609600 -6.44325869
53 -2.37423012 -0.32609600
54 1.62548022 -2.37423012
55 -0.40918760 1.62548022
56 0.25510038 -0.40918760
57 1.73579408 0.25510038
58 -2.14490774 1.73579408
59 -0.16916694 -2.14490774
60 -2.43400456 -0.16916694
61 2.03564555 -2.43400456
62 0.23149356 2.03564555
63 2.33697941 0.23149356
64 -0.85405727 2.33697941
65 1.73460135 -0.85405727
66 -2.08422952 1.73460135
67 2.56566925 -2.08422952
68 2.10798321 2.56566925
69 -0.81873637 2.10798321
70 2.59081240 -0.81873637
71 0.73460135 2.59081240
72 -0.96406479 0.73460135
73 -2.74462979 -0.96406479
74 -0.42086444 -2.74462979
75 -1.39783694 -0.42086444
76 -0.31382243 -1.39783694
77 0.17108587 -0.31382243
78 3.31216245 0.17108587
79 -1.98795884 3.31216245
80 -2.80771261 -1.98795884
81 2.07631743 -2.80771261
82 0.27628206 2.07631743
83 -1.22772880 0.27628206
84 4.32472568 -1.22772880
85 -0.43462041 4.32472568
86 -0.32428670 -0.43462041
87 0.15881230 -0.32428670
88 1.08374314 0.15881230
89 -0.20441164 1.08374314
90 1.03501230 -0.20441164
91 -3.41011051 1.03501230
92 0.78181256 -3.41011051
93 1.56749524 0.78181256
94 0.66315007 1.56749524
95 0.25298474 0.66315007
96 -2.07022041 0.25298474
97 -0.66300075 -2.07022041
98 -1.70903907 -0.66300075
99 0.61380337 -1.70903907
100 0.63802361 0.61380337
101 1.34833006 0.63802361
102 -1.68993651 1.34833006
103 2.22936051 -1.68993651
104 -2.95028899 2.22936051
105 -0.43646623 -2.95028899
106 -1.28809997 -0.43646623
107 -1.16916694 -1.28809997
108 -2.34879731 -1.16916694
109 -2.70874940 -2.34879731
110 -1.10785374 -2.70874940
111 -1.58797055 -1.10785374
112 -0.37455631 -1.58797055
113 0.48076836 -0.37455631
114 0.79345288 0.48076836
115 2.65058684 0.79345288
116 2.54146571 2.65058684
117 -1.56828867 2.54146571
118 0.28855563 -1.56828867
119 3.03685812 0.28855563
120 0.61412956 3.03685812
121 1.39859967 0.61412956
122 -2.20441164 1.39859967
123 -0.82056550 -2.20441164
124 2.28855563 -0.82056550
125 1.19136448 2.28855563
126 0.66101458 1.19136448
127 -1.39783694 0.66101458
128 -0.38379132 -1.39783694
129 -2.60945858 -0.38379132
130 0.66101458 -2.60945858
131 2.47001443 0.66101458
132 -1.31505241 2.47001443
133 -0.12253261 -1.31505241
134 1.79437579 -0.12253261
135 1.37285980 1.79437579
136 0.39767676 1.37285980
137 -3.69855496 0.39767676
138 4.97494820 -3.69855496
139 -0.61367390 4.97494820
140 -0.28838963 -0.61367390
141 -0.45853429 -0.28838963
142 2.16748711 -0.45853429
143 -0.46655602 2.16748711
144 1.11994972 -0.46655602
145 -0.72494720 1.11994972
146 -3.31445568 -0.72494720
147 -4.35241520 -3.31445568
148 1.14476668 -4.35241520
149 1.48044217 1.14476668
150 -0.15660371 1.48044217
151 1.03472264 -0.15660371
152 -1.20441164 1.03472264
153 0.95192070 -1.20441164
154 1.27780169 0.95192070
155 1.91578961 1.27780169
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/74e8q1321627983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/8afh81321627983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/96xjk1321627983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/rcomp/tmp/10tecx1321627983.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/11bufl1321627983.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/12elpa1321627983.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/13fq701321627983.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/14wte11321627983.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/158nrj1321627983.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/1629s91321627983.tab")
+ }
>
> try(system("convert tmp/1xqfa1321627983.ps tmp/1xqfa1321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/2evur1321627983.ps tmp/2evur1321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/33xii1321627983.ps tmp/33xii1321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/4aj631321627983.ps tmp/4aj631321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/5vu0w1321627983.ps tmp/5vu0w1321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/6k6me1321627983.ps tmp/6k6me1321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/74e8q1321627983.ps tmp/74e8q1321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/8afh81321627983.ps tmp/8afh81321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/96xjk1321627983.ps tmp/96xjk1321627983.png",intern=TRUE))
character(0)
> try(system("convert tmp/10tecx1321627983.ps tmp/10tecx1321627983.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.528 0.644 7.156