R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(18
+ ,89
+ ,48
+ ,63
+ ,1760
+ ,20
+ ,56
+ ,52
+ ,56
+ ,1609
+ ,0
+ ,18
+ ,0
+ ,0
+ ,192
+ ,26
+ ,92
+ ,49
+ ,60
+ ,2182
+ ,31
+ ,131
+ ,76
+ ,116
+ ,3367
+ ,36
+ ,257
+ ,125
+ ,138
+ ,6727
+ ,23
+ ,55
+ ,46
+ ,71
+ ,1619
+ ,30
+ ,56
+ ,68
+ ,107
+ ,1507
+ ,30
+ ,42
+ ,52
+ ,50
+ ,1682
+ ,26
+ ,92
+ ,67
+ ,79
+ ,2812
+ ,24
+ ,74
+ ,50
+ ,58
+ ,1943
+ ,30
+ ,66
+ ,71
+ ,91
+ ,2017
+ ,21
+ ,96
+ ,41
+ ,40
+ ,1702
+ ,25
+ ,110
+ ,79
+ ,91
+ ,3034
+ ,18
+ ,55
+ ,49
+ ,61
+ ,1379
+ ,19
+ ,79
+ ,54
+ ,65
+ ,1517
+ ,33
+ ,53
+ ,75
+ ,131
+ ,1637
+ ,15
+ ,54
+ ,1
+ ,45
+ ,1169
+ ,34
+ ,84
+ ,54
+ ,110
+ ,2384
+ ,18
+ ,24
+ ,13
+ ,41
+ ,726
+ ,15
+ ,55
+ ,17
+ ,37
+ ,993
+ ,30
+ ,96
+ ,89
+ ,84
+ ,2683
+ ,25
+ ,70
+ ,37
+ ,67
+ ,1713
+ ,34
+ ,50
+ ,44
+ ,69
+ ,2027
+ ,21
+ ,81
+ ,50
+ ,58
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,32
+ ,701
+ ,2
+ ,12
+ ,10
+ ,4
+ ,285
+ ,21
+ ,55
+ ,46
+ ,70
+ ,1774
+ ,25
+ ,29
+ ,34
+ ,90
+ ,1071
+ ,29
+ ,46
+ ,49
+ ,91
+ ,1582
+ ,2
+ ,9
+ ,1
+ ,1
+ ,256
+ ,0
+ ,9
+ ,0
+ ,0
+ ,98
+ ,18
+ ,55
+ ,33
+ ,39
+ ,1358
+ ,1
+ ,3
+ ,0
+ ,0
+ ,41
+ ,21
+ ,58
+ ,48
+ ,45
+ ,1771
+ ,0
+ ,3
+ ,5
+ ,0
+ ,42
+ ,4
+ ,16
+ ,8
+ ,7
+ ,528
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,25
+ ,45
+ ,35
+ ,75
+ ,1026
+ ,26
+ ,38
+ ,21
+ ,52
+ ,1296
+ ,0
+ ,4
+ ,0
+ ,0
+ ,81
+ ,4
+ ,13
+ ,0
+ ,1
+ ,257
+ ,17
+ ,23
+ ,15
+ ,49
+ ,914
+ ,21
+ ,50
+ ,50
+ ,69
+ ,1178
+ ,22
+ ,19
+ ,17
+ ,56
+ ,1080)
+ ,dim=c(5
+ ,144)
+ ,dimnames=list(c('TNORC'
+ ,'TNOLI'
+ ,'NOBC'
+ ,'NOSFBM'
+ ,'TNOPV')
+ ,1:144))
> y <- array(NA,dim=c(5,144),dimnames=list(c('TNORC','TNOLI','NOBC','NOSFBM','TNOPV'),1:144))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = '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
TNORC TNOLI NOBC NOSFBM TNOPV
1 18 89 48 63 1760
2 20 56 52 56 1609
3 0 18 0 0 192
4 26 92 49 60 2182
5 31 131 76 116 3367
6 36 257 125 138 6727
7 23 55 46 71 1619
8 30 56 68 107 1507
9 30 42 52 50 1682
10 26 92 67 79 2812
11 24 74 50 58 1943
12 30 66 71 91 2017
13 21 96 41 40 1702
14 25 110 79 91 3034
15 18 55 49 61 1379
16 19 79 54 65 1517
17 33 53 75 131 1637
18 15 54 1 45 1169
19 34 84 54 110 2384
20 18 24 13 41 726
21 15 55 17 37 993
22 30 96 89 84 2683
23 25 70 37 67 1713
24 34 50 44 69 2027
25 21 81 50 58 1818
26 21 28 39 60 1393
27 25 154 59 88 2000
28 31 85 79 75 1346
29 31 115 60 98 2676
30 20 43 52 67 2106
31 28 43 50 84 1591
32 20 43 54 58 1519
33 17 101 53 35 2171
34 25 121 76 74 3003
35 24 52 60 89 2364
36 0 1 0 0 1
37 27 60 53 75 2017
38 14 50 44 39 1564
39 32 47 36 93 2072
40 31 63 83 123 2106
41 21 69 100 73 2270
42 34 56 37 118 1643
43 23 29 25 76 957
44 24 77 59 65 2025
45 26 46 55 97 1236
46 22 91 41 67 1178
47 35 31 23 63 744
48 21 92 63 84 1976
49 31 85 54 112 2224
50 26 56 67 75 2561
51 22 28 12 39 658
52 21 65 84 63 1779
53 27 71 64 93 2355
54 30 77 56 76 2017
55 33 59 54 117 1758
56 11 54 35 30 1675
57 26 62 52 65 1760
58 26 23 25 78 875
59 23 65 67 87 1169
60 38 93 36 85 2789
61 29 56 50 107 1606
62 19 76 48 60 2020
63 19 58 46 53 1300
64 26 35 53 67 1235
65 26 32 27 90 1215
66 29 38 38 89 1230
67 36 67 68 135 2226
68 25 65 93 71 2897
69 24 38 56 75 1071
70 21 15 5 42 340
71 19 110 53 42 2704
72 12 64 36 8 1247
73 30 64 72 86 1422
74 21 68 46 41 1535
75 34 66 73 118 2593
76 32 42 12 91 1397
77 28 58 76 102 2162
78 28 94 71 89 2513
79 21 26 17 46 917
80 31 71 34 60 1234
81 26 66 54 69 917
82 29 59 39 95 1924
83 23 27 26 17 853
84 25 34 40 61 1398
85 22 44 35 55 986
86 26 47 32 55 1608
87 33 220 55 124 2577
88 24 108 58 73 1201
89 24 56 39 73 1189
90 21 50 39 67 1431
91 28 40 48 66 1698
92 27 74 72 75 2185
93 25 56 39 83 1228
94 15 58 27 55 1266
95 13 36 22 27 830
96 36 111 48 115 2238
97 24 68 95 76 1787
98 1 12 13 0 223
99 24 100 32 83 2254
100 31 75 41 90 1952
101 4 28 22 4 665
102 20 22 41 56 804
103 23 49 55 63 1211
104 23 57 28 52 1143
105 12 38 30 24 710
106 16 22 2 17 596
107 29 44 79 105 1353
108 10 32 18 20 971
109 0 0 0 0 0
110 25 31 46 51 1030
111 21 66 25 76 1130
112 23 44 50 59 1284
113 21 61 59 70 1438
114 21 57 36 38 849
115 0 5 0 0 78
116 0 0 0 0 0
117 23 39 35 81 925
118 29 78 68 64 1518
119 28 95 26 67 1946
120 23 37 36 89 914
121 1 19 7 3 778
122 29 71 67 87 1713
123 17 40 30 48 895
124 29 52 55 62 1756
125 12 40 3 32 701
126 2 12 10 4 285
127 21 55 46 70 1774
128 25 29 34 90 1071
129 29 46 49 91 1582
130 2 9 1 1 256
131 0 9 0 0 98
132 18 55 33 39 1358
133 1 3 0 0 41
134 21 58 48 45 1771
135 0 3 5 0 42
136 4 16 8 7 528
137 0 0 0 0 0
138 25 45 35 75 1026
139 26 38 21 52 1296
140 0 4 0 0 81
141 4 13 0 1 257
142 17 23 15 49 914
143 21 50 50 69 1178
144 22 19 17 56 1080
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) TNOLI NOBC NOSFBM TNOPV
5.565984 -0.011371 -0.002144 0.233460 0.001509
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.7445 -3.1380 -0.5892 2.2378 14.0051
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.565984 0.794575 7.005 9.71e-11 ***
TNOLI -0.011371 0.017952 -0.633 0.528
NOBC -0.002144 0.025527 -0.084 0.933
NOSFBM 0.233460 0.016165 14.442 < 2e-16 ***
TNOPV 0.001509 0.000946 1.595 0.113
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.251 on 139 degrees of freedom
Multiple R-squared: 0.8007, Adjusted R-squared: 0.7949
F-statistic: 139.6 on 4 and 139 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.7513710 0.4972579195 0.2486289598
[2,] 0.8114633 0.3770733719 0.1885366859
[3,] 0.7472722 0.5054556855 0.2527278428
[4,] 0.6774750 0.6450500175 0.3225250087
[5,] 0.5888005 0.8223989187 0.4111994593
[6,] 0.6434655 0.7130690181 0.3565345090
[7,] 0.7234649 0.5530701563 0.2765350782
[8,] 0.7259907 0.5480185541 0.2740092771
[9,] 0.6843458 0.6313083113 0.3156541556
[10,] 0.6115947 0.7768105607 0.3884052803
[11,] 0.5970588 0.8058823300 0.4029411650
[12,] 0.6080369 0.7839262983 0.3919631491
[13,] 0.5376780 0.9246440440 0.4623220220
[14,] 0.4630933 0.9261865283 0.5369067358
[15,] 0.3943748 0.7887496584 0.6056251708
[16,] 0.3703229 0.7406457050 0.6296771475
[17,] 0.4978353 0.9956705635 0.5021647182
[18,] 0.4314803 0.8629605097 0.5685197451
[19,] 0.4426519 0.8853037051 0.5573481475
[20,] 0.5173894 0.9652212952 0.4826106476
[21,] 0.6016459 0.7967082594 0.3983541297
[22,] 0.5672944 0.8654111370 0.4327055685
[23,] 0.5995848 0.8008304157 0.4004152078
[24,] 0.5414851 0.9170298521 0.4585149260
[25,] 0.5055510 0.9888980334 0.4944490167
[26,] 0.4446994 0.8893987930 0.5553006035
[27,] 0.3919892 0.7839784382 0.6080107809
[28,] 0.4189760 0.8379519690 0.5810240155
[29,] 0.5399509 0.9200982146 0.4600491073
[30,] 0.4935754 0.9871507336 0.5064246332
[31,] 0.4725818 0.9451636413 0.5274181794
[32,] 0.4615771 0.9231541796 0.5384229102
[33,] 0.4924448 0.9848896577 0.5075551712
[34,] 0.5132119 0.9735761499 0.4867880750
[35,] 0.4608373 0.9216745705 0.5391627147
[36,] 0.4099241 0.8198482869 0.5900758565
[37,] 0.3627831 0.7255661430 0.6372169285
[38,] 0.3357830 0.6715659445 0.6642170278
[39,] 0.2889738 0.5779476698 0.7110261651
[40,] 0.7761794 0.4476411175 0.2238205588
[41,] 0.8116277 0.3767446133 0.1883723067
[42,] 0.7921915 0.4156170062 0.2078085031
[43,] 0.7582485 0.4835030548 0.2417515274
[44,] 0.8018837 0.3962325452 0.1981162726
[45,] 0.7697823 0.4604354137 0.2302177069
[46,] 0.7567182 0.4865635948 0.2432817974
[47,] 0.7616720 0.4766559659 0.2383279830
[48,] 0.7263425 0.5473150238 0.2736575119
[49,] 0.7356057 0.5287885992 0.2643942996
[50,] 0.7150415 0.5699169658 0.2849584829
[51,] 0.6771130 0.6457740700 0.3228870350
[52,] 0.6628559 0.6742881853 0.3371440926
[53,] 0.7962943 0.4074113076 0.2037056538
[54,] 0.7795573 0.4408853702 0.2204426851
[55,] 0.7690524 0.4618951467 0.2309475733
[56,] 0.7305801 0.5388398996 0.2694199498
[57,] 0.7144016 0.5711967510 0.2855983755
[58,] 0.6822777 0.6354445489 0.3177222745
[59,] 0.6424048 0.7151904760 0.3575952380
[60,] 0.6321337 0.7357326989 0.3678663495
[61,] 0.6173205 0.7653590506 0.3826795253
[62,] 0.5698633 0.8602734069 0.4301367034
[63,] 0.6145486 0.7709028311 0.3854514155
[64,] 0.5919715 0.8160569369 0.4080284684
[65,] 0.5518983 0.8962034636 0.4481017318
[66,] 0.5357445 0.9285110842 0.4642555421
[67,] 0.5152537 0.9694926669 0.4847463334
[68,] 0.5205204 0.9589591556 0.4794795778
[69,] 0.5122753 0.9754493319 0.4877246660
[70,] 0.5624347 0.8751306908 0.4375653454
[71,] 0.5805631 0.8388737811 0.4194368905
[72,] 0.5718749 0.8562502396 0.4281251198
[73,] 0.8190167 0.3619666050 0.1809833025
[74,] 0.8328560 0.3342879989 0.1671439994
[75,] 0.8133558 0.3732884001 0.1866442000
[76,] 0.9741987 0.0516026531 0.0258013266
[77,] 0.9686779 0.0626442416 0.0313221208
[78,] 0.9659748 0.0680504807 0.0340252404
[79,] 0.9675264 0.0649472429 0.0324736214
[80,] 0.9690991 0.0618018262 0.0309009131
[81,] 0.9593777 0.0812446272 0.0406223136
[82,] 0.9473769 0.1052461796 0.0526230898
[83,] 0.9396078 0.1207844183 0.0603922092
[84,] 0.9379020 0.1241959063 0.0620979531
[85,] 0.9291759 0.1416482960 0.0708241480
[86,] 0.9108440 0.1783119948 0.0891559974
[87,] 0.9315884 0.1368232322 0.0684116161
[88,] 0.9168546 0.1662908836 0.0831454418
[89,] 0.9035398 0.1929204979 0.0964602490
[90,] 0.9168646 0.1662708312 0.0831354156
[91,] 0.9276207 0.1447585104 0.0723792552
[92,] 0.9716042 0.0567916132 0.0283958066
[93,] 0.9641816 0.0716367151 0.0358183576
[94,] 0.9643679 0.0712642712 0.0356321356
[95,] 0.9577256 0.0845488507 0.0422744254
[96,] 0.9438377 0.1123246220 0.0561623110
[97,] 0.9400406 0.1199187710 0.0599593855
[98,] 0.9225884 0.1548232667 0.0774116333
[99,] 0.9737985 0.0524030978 0.0262015489
[100,] 0.9713611 0.0572778413 0.0286389207
[101,] 0.9632309 0.0735382331 0.0367691166
[102,] 0.9625239 0.0749522761 0.0374761381
[103,] 0.9856101 0.0287797197 0.0143898598
[104,] 0.9872712 0.0254576463 0.0127288231
[105,] 0.9829507 0.0340985863 0.0170492932
[106,] 0.9872314 0.0255372346 0.0127686173
[107,] 0.9943570 0.0112859079 0.0056429540
[108,] 0.9931506 0.0136987692 0.0068493846
[109,] 0.9911928 0.0176144169 0.0088072084
[110,] 0.9863438 0.0273123548 0.0136561774
[111,] 0.9941637 0.0116725157 0.0058362579
[112,] 0.9909714 0.0180571845 0.0090285922
[113,] 0.9888132 0.0223735927 0.0111867963
[114,] 0.9965398 0.0069203248 0.0034601624
[115,] 0.9937080 0.0125840205 0.0062920103
[116,] 0.9895652 0.0208696130 0.0104348065
[117,] 0.9969474 0.0061051675 0.0030525837
[118,] 0.9981223 0.0037554779 0.0018777390
[119,] 0.9963864 0.0072272022 0.0036136011
[120,] 0.9998781 0.0002438353 0.0001219177
[121,] 0.9998318 0.0003363765 0.0001681883
[122,] 0.9996361 0.0007278538 0.0003639269
[123,] 0.9989910 0.0020179572 0.0010089786
[124,] 0.9979193 0.0041614722 0.0020807361
[125,] 0.9958518 0.0082963183 0.0041481591
[126,] 0.9894480 0.0211040403 0.0105520202
[127,] 0.9713116 0.0573767518 0.0286883759
[128,] 0.9481999 0.1036001019 0.0518000509
[129,] 0.9250609 0.1498782551 0.0749391275
> postscript(file="/var/wessaorg/rcomp/tmp/17u8m1324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/231sf1324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/3z3vj1324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/4m8tt1324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/5lg431324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 144
Frequency = 1
1 2 3 4 5 6
-3.81494398 -0.31952171 -5.65104614 4.28487390 -5.07573249 -8.74445856
7 8 9 10 11 12
-0.86074090 -2.03773396 10.81188410 -1.06296501 2.90992441 1.04814626
13 14 15 16 17 18
4.70673887 -4.96908551 -3.15754196 -3.01600908 -4.85604446 -2.21957222
19 20 21 22 23 24
0.22682067 2.06737719 -0.04062844 2.05705545 2.08251325 9.92934549
25 26 27 28 29 30
0.17815083 -0.27366107 -2.25091777 7.02926701 -0.04694637 -3.78539356
31 32 33 34 35 36
1.01866400 -0.79415931 1.24887652 -0.83484514 -5.19134897 -5.55612221
37 38 39 40 41 42
1.67668263 -2.36817857 2.20714373 -5.56525002 -4.03508096 -0.87748403
43 44 45 46 47 48
-1.36971587 1.20537406 -3.43576691 0.13721590 14.00513918 -5.97727668
49 50 51 52 53 54
-2.98728037 -0.15970541 6.68025073 -1.03933097 -2.88698443 4.64295890
55 56 57 58 59 60
-1.74700409 -3.40835920 3.41970093 1.21888183 -3.75829135 9.51589198
61 62 63 64 65 66
-3.22572170 -2.65473770 -0.14297021 3.44016288 -1.98908350 1.31354940
67 68 69 70 71 72
-3.53452752 -0.57482485 -0.13948585 5.29691989 0.91267527 3.48947556
73 74 75 76 77 78
3.09272888 4.41762723 -2.12018507 3.58435853 -3.81896733 -0.91503853
79 80 81 82 83 84
3.64316915 10.44450212 3.80775950 -0.89355488 12.54074312 3.55570300
85 86 87 88 89 90
2.68117550 5.77022939 -2.78428486 0.93150231 0.31759237 -1.71506406
91 92 93 94 95 96
5.02106826 1.62309052 -1.07585632 -4.59931804 0.33461654 1.57399130
97 98 99 100 101 102
-1.02868145 -4.73817930 -3.13882967 2.41771082 -3.13778682 0.48506844
103 104 105 106 107 108
1.57369775 4.27744657 0.25597453 5.82025757 -2.45128736 -1.29800109
109 110 111 112 113 114
-5.56598397 6.42437940 -3.21006072 2.32980164 -2.25804699 6.00669240
115 116 117 118 119 120
-5.62683548 -5.56598397 -2.35357611 7.23458680 4.99159177 -4.22525095
121 122 123 124 125 126
-6.20934689 1.48901258 -0.60348750 7.01883979 -1.63326745 -4.77201054
127 128 129 130 131 132
-2.86118342 -2.79088526 0.42999670 -4.08127797 -5.61153315 1.97595482
133 134 135 136 137 138
-4.59374241 3.01823394 -5.58453141 -3.79789222 -5.56598397 0.96299268
139 140 141 142 143 144
6.81550903 -5.64273344 -2.03944778 -1.09108294 -1.77661052 1.98300308
> postscript(file="/var/wessaorg/rcomp/tmp/6kqpj1324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 144
Frequency = 1
lag(myerror, k = 1) myerror
0 -3.81494398 NA
1 -0.31952171 -3.81494398
2 -5.65104614 -0.31952171
3 4.28487390 -5.65104614
4 -5.07573249 4.28487390
5 -8.74445856 -5.07573249
6 -0.86074090 -8.74445856
7 -2.03773396 -0.86074090
8 10.81188410 -2.03773396
9 -1.06296501 10.81188410
10 2.90992441 -1.06296501
11 1.04814626 2.90992441
12 4.70673887 1.04814626
13 -4.96908551 4.70673887
14 -3.15754196 -4.96908551
15 -3.01600908 -3.15754196
16 -4.85604446 -3.01600908
17 -2.21957222 -4.85604446
18 0.22682067 -2.21957222
19 2.06737719 0.22682067
20 -0.04062844 2.06737719
21 2.05705545 -0.04062844
22 2.08251325 2.05705545
23 9.92934549 2.08251325
24 0.17815083 9.92934549
25 -0.27366107 0.17815083
26 -2.25091777 -0.27366107
27 7.02926701 -2.25091777
28 -0.04694637 7.02926701
29 -3.78539356 -0.04694637
30 1.01866400 -3.78539356
31 -0.79415931 1.01866400
32 1.24887652 -0.79415931
33 -0.83484514 1.24887652
34 -5.19134897 -0.83484514
35 -5.55612221 -5.19134897
36 1.67668263 -5.55612221
37 -2.36817857 1.67668263
38 2.20714373 -2.36817857
39 -5.56525002 2.20714373
40 -4.03508096 -5.56525002
41 -0.87748403 -4.03508096
42 -1.36971587 -0.87748403
43 1.20537406 -1.36971587
44 -3.43576691 1.20537406
45 0.13721590 -3.43576691
46 14.00513918 0.13721590
47 -5.97727668 14.00513918
48 -2.98728037 -5.97727668
49 -0.15970541 -2.98728037
50 6.68025073 -0.15970541
51 -1.03933097 6.68025073
52 -2.88698443 -1.03933097
53 4.64295890 -2.88698443
54 -1.74700409 4.64295890
55 -3.40835920 -1.74700409
56 3.41970093 -3.40835920
57 1.21888183 3.41970093
58 -3.75829135 1.21888183
59 9.51589198 -3.75829135
60 -3.22572170 9.51589198
61 -2.65473770 -3.22572170
62 -0.14297021 -2.65473770
63 3.44016288 -0.14297021
64 -1.98908350 3.44016288
65 1.31354940 -1.98908350
66 -3.53452752 1.31354940
67 -0.57482485 -3.53452752
68 -0.13948585 -0.57482485
69 5.29691989 -0.13948585
70 0.91267527 5.29691989
71 3.48947556 0.91267527
72 3.09272888 3.48947556
73 4.41762723 3.09272888
74 -2.12018507 4.41762723
75 3.58435853 -2.12018507
76 -3.81896733 3.58435853
77 -0.91503853 -3.81896733
78 3.64316915 -0.91503853
79 10.44450212 3.64316915
80 3.80775950 10.44450212
81 -0.89355488 3.80775950
82 12.54074312 -0.89355488
83 3.55570300 12.54074312
84 2.68117550 3.55570300
85 5.77022939 2.68117550
86 -2.78428486 5.77022939
87 0.93150231 -2.78428486
88 0.31759237 0.93150231
89 -1.71506406 0.31759237
90 5.02106826 -1.71506406
91 1.62309052 5.02106826
92 -1.07585632 1.62309052
93 -4.59931804 -1.07585632
94 0.33461654 -4.59931804
95 1.57399130 0.33461654
96 -1.02868145 1.57399130
97 -4.73817930 -1.02868145
98 -3.13882967 -4.73817930
99 2.41771082 -3.13882967
100 -3.13778682 2.41771082
101 0.48506844 -3.13778682
102 1.57369775 0.48506844
103 4.27744657 1.57369775
104 0.25597453 4.27744657
105 5.82025757 0.25597453
106 -2.45128736 5.82025757
107 -1.29800109 -2.45128736
108 -5.56598397 -1.29800109
109 6.42437940 -5.56598397
110 -3.21006072 6.42437940
111 2.32980164 -3.21006072
112 -2.25804699 2.32980164
113 6.00669240 -2.25804699
114 -5.62683548 6.00669240
115 -5.56598397 -5.62683548
116 -2.35357611 -5.56598397
117 7.23458680 -2.35357611
118 4.99159177 7.23458680
119 -4.22525095 4.99159177
120 -6.20934689 -4.22525095
121 1.48901258 -6.20934689
122 -0.60348750 1.48901258
123 7.01883979 -0.60348750
124 -1.63326745 7.01883979
125 -4.77201054 -1.63326745
126 -2.86118342 -4.77201054
127 -2.79088526 -2.86118342
128 0.42999670 -2.79088526
129 -4.08127797 0.42999670
130 -5.61153315 -4.08127797
131 1.97595482 -5.61153315
132 -4.59374241 1.97595482
133 3.01823394 -4.59374241
134 -5.58453141 3.01823394
135 -3.79789222 -5.58453141
136 -5.56598397 -3.79789222
137 0.96299268 -5.56598397
138 6.81550903 0.96299268
139 -5.64273344 6.81550903
140 -2.03944778 -5.64273344
141 -1.09108294 -2.03944778
142 -1.77661052 -1.09108294
143 1.98300308 -1.77661052
144 NA 1.98300308
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.31952171 -3.81494398
[2,] -5.65104614 -0.31952171
[3,] 4.28487390 -5.65104614
[4,] -5.07573249 4.28487390
[5,] -8.74445856 -5.07573249
[6,] -0.86074090 -8.74445856
[7,] -2.03773396 -0.86074090
[8,] 10.81188410 -2.03773396
[9,] -1.06296501 10.81188410
[10,] 2.90992441 -1.06296501
[11,] 1.04814626 2.90992441
[12,] 4.70673887 1.04814626
[13,] -4.96908551 4.70673887
[14,] -3.15754196 -4.96908551
[15,] -3.01600908 -3.15754196
[16,] -4.85604446 -3.01600908
[17,] -2.21957222 -4.85604446
[18,] 0.22682067 -2.21957222
[19,] 2.06737719 0.22682067
[20,] -0.04062844 2.06737719
[21,] 2.05705545 -0.04062844
[22,] 2.08251325 2.05705545
[23,] 9.92934549 2.08251325
[24,] 0.17815083 9.92934549
[25,] -0.27366107 0.17815083
[26,] -2.25091777 -0.27366107
[27,] 7.02926701 -2.25091777
[28,] -0.04694637 7.02926701
[29,] -3.78539356 -0.04694637
[30,] 1.01866400 -3.78539356
[31,] -0.79415931 1.01866400
[32,] 1.24887652 -0.79415931
[33,] -0.83484514 1.24887652
[34,] -5.19134897 -0.83484514
[35,] -5.55612221 -5.19134897
[36,] 1.67668263 -5.55612221
[37,] -2.36817857 1.67668263
[38,] 2.20714373 -2.36817857
[39,] -5.56525002 2.20714373
[40,] -4.03508096 -5.56525002
[41,] -0.87748403 -4.03508096
[42,] -1.36971587 -0.87748403
[43,] 1.20537406 -1.36971587
[44,] -3.43576691 1.20537406
[45,] 0.13721590 -3.43576691
[46,] 14.00513918 0.13721590
[47,] -5.97727668 14.00513918
[48,] -2.98728037 -5.97727668
[49,] -0.15970541 -2.98728037
[50,] 6.68025073 -0.15970541
[51,] -1.03933097 6.68025073
[52,] -2.88698443 -1.03933097
[53,] 4.64295890 -2.88698443
[54,] -1.74700409 4.64295890
[55,] -3.40835920 -1.74700409
[56,] 3.41970093 -3.40835920
[57,] 1.21888183 3.41970093
[58,] -3.75829135 1.21888183
[59,] 9.51589198 -3.75829135
[60,] -3.22572170 9.51589198
[61,] -2.65473770 -3.22572170
[62,] -0.14297021 -2.65473770
[63,] 3.44016288 -0.14297021
[64,] -1.98908350 3.44016288
[65,] 1.31354940 -1.98908350
[66,] -3.53452752 1.31354940
[67,] -0.57482485 -3.53452752
[68,] -0.13948585 -0.57482485
[69,] 5.29691989 -0.13948585
[70,] 0.91267527 5.29691989
[71,] 3.48947556 0.91267527
[72,] 3.09272888 3.48947556
[73,] 4.41762723 3.09272888
[74,] -2.12018507 4.41762723
[75,] 3.58435853 -2.12018507
[76,] -3.81896733 3.58435853
[77,] -0.91503853 -3.81896733
[78,] 3.64316915 -0.91503853
[79,] 10.44450212 3.64316915
[80,] 3.80775950 10.44450212
[81,] -0.89355488 3.80775950
[82,] 12.54074312 -0.89355488
[83,] 3.55570300 12.54074312
[84,] 2.68117550 3.55570300
[85,] 5.77022939 2.68117550
[86,] -2.78428486 5.77022939
[87,] 0.93150231 -2.78428486
[88,] 0.31759237 0.93150231
[89,] -1.71506406 0.31759237
[90,] 5.02106826 -1.71506406
[91,] 1.62309052 5.02106826
[92,] -1.07585632 1.62309052
[93,] -4.59931804 -1.07585632
[94,] 0.33461654 -4.59931804
[95,] 1.57399130 0.33461654
[96,] -1.02868145 1.57399130
[97,] -4.73817930 -1.02868145
[98,] -3.13882967 -4.73817930
[99,] 2.41771082 -3.13882967
[100,] -3.13778682 2.41771082
[101,] 0.48506844 -3.13778682
[102,] 1.57369775 0.48506844
[103,] 4.27744657 1.57369775
[104,] 0.25597453 4.27744657
[105,] 5.82025757 0.25597453
[106,] -2.45128736 5.82025757
[107,] -1.29800109 -2.45128736
[108,] -5.56598397 -1.29800109
[109,] 6.42437940 -5.56598397
[110,] -3.21006072 6.42437940
[111,] 2.32980164 -3.21006072
[112,] -2.25804699 2.32980164
[113,] 6.00669240 -2.25804699
[114,] -5.62683548 6.00669240
[115,] -5.56598397 -5.62683548
[116,] -2.35357611 -5.56598397
[117,] 7.23458680 -2.35357611
[118,] 4.99159177 7.23458680
[119,] -4.22525095 4.99159177
[120,] -6.20934689 -4.22525095
[121,] 1.48901258 -6.20934689
[122,] -0.60348750 1.48901258
[123,] 7.01883979 -0.60348750
[124,] -1.63326745 7.01883979
[125,] -4.77201054 -1.63326745
[126,] -2.86118342 -4.77201054
[127,] -2.79088526 -2.86118342
[128,] 0.42999670 -2.79088526
[129,] -4.08127797 0.42999670
[130,] -5.61153315 -4.08127797
[131,] 1.97595482 -5.61153315
[132,] -4.59374241 1.97595482
[133,] 3.01823394 -4.59374241
[134,] -5.58453141 3.01823394
[135,] -3.79789222 -5.58453141
[136,] -5.56598397 -3.79789222
[137,] 0.96299268 -5.56598397
[138,] 6.81550903 0.96299268
[139,] -5.64273344 6.81550903
[140,] -2.03944778 -5.64273344
[141,] -1.09108294 -2.03944778
[142,] -1.77661052 -1.09108294
[143,] 1.98300308 -1.77661052
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.31952171 -3.81494398
2 -5.65104614 -0.31952171
3 4.28487390 -5.65104614
4 -5.07573249 4.28487390
5 -8.74445856 -5.07573249
6 -0.86074090 -8.74445856
7 -2.03773396 -0.86074090
8 10.81188410 -2.03773396
9 -1.06296501 10.81188410
10 2.90992441 -1.06296501
11 1.04814626 2.90992441
12 4.70673887 1.04814626
13 -4.96908551 4.70673887
14 -3.15754196 -4.96908551
15 -3.01600908 -3.15754196
16 -4.85604446 -3.01600908
17 -2.21957222 -4.85604446
18 0.22682067 -2.21957222
19 2.06737719 0.22682067
20 -0.04062844 2.06737719
21 2.05705545 -0.04062844
22 2.08251325 2.05705545
23 9.92934549 2.08251325
24 0.17815083 9.92934549
25 -0.27366107 0.17815083
26 -2.25091777 -0.27366107
27 7.02926701 -2.25091777
28 -0.04694637 7.02926701
29 -3.78539356 -0.04694637
30 1.01866400 -3.78539356
31 -0.79415931 1.01866400
32 1.24887652 -0.79415931
33 -0.83484514 1.24887652
34 -5.19134897 -0.83484514
35 -5.55612221 -5.19134897
36 1.67668263 -5.55612221
37 -2.36817857 1.67668263
38 2.20714373 -2.36817857
39 -5.56525002 2.20714373
40 -4.03508096 -5.56525002
41 -0.87748403 -4.03508096
42 -1.36971587 -0.87748403
43 1.20537406 -1.36971587
44 -3.43576691 1.20537406
45 0.13721590 -3.43576691
46 14.00513918 0.13721590
47 -5.97727668 14.00513918
48 -2.98728037 -5.97727668
49 -0.15970541 -2.98728037
50 6.68025073 -0.15970541
51 -1.03933097 6.68025073
52 -2.88698443 -1.03933097
53 4.64295890 -2.88698443
54 -1.74700409 4.64295890
55 -3.40835920 -1.74700409
56 3.41970093 -3.40835920
57 1.21888183 3.41970093
58 -3.75829135 1.21888183
59 9.51589198 -3.75829135
60 -3.22572170 9.51589198
61 -2.65473770 -3.22572170
62 -0.14297021 -2.65473770
63 3.44016288 -0.14297021
64 -1.98908350 3.44016288
65 1.31354940 -1.98908350
66 -3.53452752 1.31354940
67 -0.57482485 -3.53452752
68 -0.13948585 -0.57482485
69 5.29691989 -0.13948585
70 0.91267527 5.29691989
71 3.48947556 0.91267527
72 3.09272888 3.48947556
73 4.41762723 3.09272888
74 -2.12018507 4.41762723
75 3.58435853 -2.12018507
76 -3.81896733 3.58435853
77 -0.91503853 -3.81896733
78 3.64316915 -0.91503853
79 10.44450212 3.64316915
80 3.80775950 10.44450212
81 -0.89355488 3.80775950
82 12.54074312 -0.89355488
83 3.55570300 12.54074312
84 2.68117550 3.55570300
85 5.77022939 2.68117550
86 -2.78428486 5.77022939
87 0.93150231 -2.78428486
88 0.31759237 0.93150231
89 -1.71506406 0.31759237
90 5.02106826 -1.71506406
91 1.62309052 5.02106826
92 -1.07585632 1.62309052
93 -4.59931804 -1.07585632
94 0.33461654 -4.59931804
95 1.57399130 0.33461654
96 -1.02868145 1.57399130
97 -4.73817930 -1.02868145
98 -3.13882967 -4.73817930
99 2.41771082 -3.13882967
100 -3.13778682 2.41771082
101 0.48506844 -3.13778682
102 1.57369775 0.48506844
103 4.27744657 1.57369775
104 0.25597453 4.27744657
105 5.82025757 0.25597453
106 -2.45128736 5.82025757
107 -1.29800109 -2.45128736
108 -5.56598397 -1.29800109
109 6.42437940 -5.56598397
110 -3.21006072 6.42437940
111 2.32980164 -3.21006072
112 -2.25804699 2.32980164
113 6.00669240 -2.25804699
114 -5.62683548 6.00669240
115 -5.56598397 -5.62683548
116 -2.35357611 -5.56598397
117 7.23458680 -2.35357611
118 4.99159177 7.23458680
119 -4.22525095 4.99159177
120 -6.20934689 -4.22525095
121 1.48901258 -6.20934689
122 -0.60348750 1.48901258
123 7.01883979 -0.60348750
124 -1.63326745 7.01883979
125 -4.77201054 -1.63326745
126 -2.86118342 -4.77201054
127 -2.79088526 -2.86118342
128 0.42999670 -2.79088526
129 -4.08127797 0.42999670
130 -5.61153315 -4.08127797
131 1.97595482 -5.61153315
132 -4.59374241 1.97595482
133 3.01823394 -4.59374241
134 -5.58453141 3.01823394
135 -3.79789222 -5.58453141
136 -5.56598397 -3.79789222
137 0.96299268 -5.56598397
138 6.81550903 0.96299268
139 -5.64273344 6.81550903
140 -2.03944778 -5.64273344
141 -1.09108294 -2.03944778
142 -1.77661052 -1.09108294
143 1.98300308 -1.77661052
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/7fai21324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/8d6ql1324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/90y831324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/wessaorg/rcomp/tmp/1000j01324373126.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/113ejq1324373126.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12mck71324373126.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13toae1324373126.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/14ezxu1324373126.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/15agxn1324373126.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/16mn9m1324373126.tab")
+ }
>
> try(system("convert tmp/17u8m1324373126.ps tmp/17u8m1324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/231sf1324373126.ps tmp/231sf1324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/3z3vj1324373126.ps tmp/3z3vj1324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/4m8tt1324373126.ps tmp/4m8tt1324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/5lg431324373126.ps tmp/5lg431324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/6kqpj1324373126.ps tmp/6kqpj1324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/7fai21324373126.ps tmp/7fai21324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/8d6ql1324373126.ps tmp/8d6ql1324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/90y831324373126.ps tmp/90y831324373126.png",intern=TRUE))
character(0)
> try(system("convert tmp/1000j01324373126.ps tmp/1000j01324373126.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.750 0.829 5.618