R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-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(93.7
+ ,76.6
+ ,76.4
+ ,85.7
+ ,114.7
+ ,83.8
+ ,83.8
+ ,116
+ ,121.2
+ ,95.1
+ ,95
+ ,130.6
+ ,98.6
+ ,82.2
+ ,82
+ ,105.1
+ ,111.5
+ ,89.2
+ ,89
+ ,130.7
+ ,107.5
+ ,86.9
+ ,86.7
+ ,113.9
+ ,69.1
+ ,72
+ ,71.8
+ ,40.1
+ ,88.3
+ ,79.4
+ ,79.2
+ ,112.2
+ ,114.7
+ ,89.1
+ ,89.1
+ ,120.6
+ ,115.5
+ ,89.8
+ ,89.7
+ ,123.1
+ ,109.5
+ ,88.9
+ ,88.8
+ ,112.2
+ ,97.7
+ ,83.2
+ ,83.1
+ ,90.5
+ ,102
+ ,90.8
+ ,90.7
+ ,89.2
+ ,107.5
+ ,89.3
+ ,89.4
+ ,107.9
+ ,120.5
+ ,99.2
+ ,99.2
+ ,111.1
+ ,101.9
+ ,86.7
+ ,86.6
+ ,92
+ ,107.6
+ ,93.5
+ ,93.3
+ ,115
+ ,113.9
+ ,96.7
+ ,96.7
+ ,116.4
+ ,70.9
+ ,80.5
+ ,80.2
+ ,53.4
+ ,93.4
+ ,84.1
+ ,83.8
+ ,109
+ ,114.8
+ ,92.9
+ ,92.9
+ ,105.3
+ ,117.8
+ ,97.2
+ ,97.3
+ ,120.4
+ ,105.2
+ ,92.4
+ ,92.4
+ ,102.3
+ ,95.1
+ ,83.6
+ ,83.5
+ ,68.6
+ ,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,121.1
+ ,104.5
+ ,105.4
+ ,105.5
+ ,98.1
+ ,97.4
+ ,101.2
+ ,101.2
+ ,89.1
+ ,115.8
+ ,115
+ ,115.1
+ ,116.1
+ ,73.1
+ ,94.4
+ ,94.2
+ ,48.9
+ ,90.6
+ ,95.5
+ ,95.4
+ ,98.6
+ ,124.1
+ ,113.3
+ ,113.5
+ ,114.8
+ ,110.1
+ ,108.7
+ ,108.8
+ ,109.2
+ ,103.4
+ ,106.9
+ ,107
+ ,91.4
+ ,109.4
+ ,102.8
+ ,102.8
+ ,58.6
+ ,92.1
+ ,104.7
+ ,104.7
+ ,81.9
+ ,107.8
+ ,108.2
+ ,108.5
+ ,105.2
+ ,116.2
+ ,128
+ ,128.4
+ ,122.4
+ ,97.5
+ ,108.4
+ ,108.5
+ ,92.2
+ ,104.8
+ ,115.5
+ ,115.6
+ ,113.9
+ ,106.2
+ ,111.5
+ ,111.7
+ ,104.1
+ ,73.6
+ ,93.8
+ ,93.7
+ ,43.1
+ ,100.7
+ ,106
+ ,106.1
+ ,100.1
+ ,123.4
+ ,118.4
+ ,118.7
+ ,118
+ ,109.1
+ ,110.8
+ ,111
+ ,103.8
+ ,100.1
+ ,110.5
+ ,110.8
+ ,103.4
+ ,105.9
+ ,104.1
+ ,104.2
+ ,79.5
+ ,104.8
+ ,105
+ ,105.1
+ ,87.2
+ ,110.8
+ ,102.8
+ ,102.9
+ ,98.3
+ ,118.4
+ ,113.8
+ ,114
+ ,145.7
+ ,93.1
+ ,102
+ ,102.1
+ ,107.9
+ ,105.4
+ ,106.1
+ ,106.2
+ ,107.6
+ ,113.6
+ ,109.6
+ ,109.7
+ ,111.6
+ ,75
+ ,97.3
+ ,97.3
+ ,48.9
+ ,94
+ ,98.2
+ ,98.2
+ ,104.3)
+ ,dim=c(4
+ ,152)
+ ,dimnames=list(c('vervaardigingmeubels'
+ ,'winningrondstoffen'
+ ,'industrie'
+ ,'bouw')
+ ,1:152))
> y <- array(NA,dim=c(4,152),dimnames=list(c('vervaardigingmeubels','winningrondstoffen','industrie','bouw'),1:152))
> 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'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, 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
vervaardigingmeubels winningrondstoffen industrie bouw
1 93.7 76.6 76.4 85.7
2 114.7 83.8 83.8 116.0
3 121.2 95.1 95.0 130.6
4 98.6 82.2 82.0 105.1
5 111.5 89.2 89.0 130.7
6 107.5 86.9 86.7 113.9
7 69.1 72.0 71.8 40.1
8 88.3 79.4 79.2 112.2
9 114.7 89.1 89.1 120.6
10 115.5 89.8 89.7 123.1
11 109.5 88.9 88.8 112.2
12 97.7 83.2 83.1 90.5
13 102.0 90.8 90.7 89.2
14 107.5 89.3 89.4 107.9
15 120.5 99.2 99.2 111.1
16 101.9 86.7 86.6 92.0
17 107.6 93.5 93.3 115.0
18 113.9 96.7 96.7 116.4
19 70.9 80.5 80.2 53.4
20 93.4 84.1 83.8 109.0
21 114.8 92.9 92.9 105.3
22 117.8 97.2 97.3 120.4
23 105.2 92.4 92.4 102.3
24 95.1 83.6 83.5 68.6
25 97.5 89.9 89.8 91.9
26 103.2 88.0 88.0 95.1
27 111.6 97.4 97.4 113.0
28 105.4 92.8 92.8 106.3
29 97.8 90.6 90.5 106.5
30 104.4 93.9 94.1 109.6
31 75.0 83.5 83.2 49.0
32 82.2 80.5 80.1 95.3
33 116.2 97.7 97.6 114.9
34 115.0 102.0 102.0 118.0
35 91.5 94.2 94.1 102.9
36 89.5 87.1 86.9 67.0
37 90.7 92.5 92.4 84.5
38 100.1 92.8 92.8 95.9
39 100.1 99.8 99.8 114.0
40 93.5 97.0 96.9 106.6
41 84.4 91.6 91.5 100.0
42 101.2 98.0 97.9 111.6
43 75.3 88.7 88.5 56.5
44 76.5 82.3 81.9 90.2
45 105.6 102.4 102.4 122.3
46 110.4 104.5 104.5 118.8
47 91.5 93.9 93.9 94.5
48 88.1 97.1 97.1 77.4
49 88.2 91.3 91.2 89.3
50 99.3 93.2 93.2 99.5
51 117.1 108.0 108.1 122.2
52 100.5 98.2 98.2 104.6
53 83.9 92.0 91.9 97.4
54 110.7 106.5 106.5 121.0
55 66.9 89.5 89.3 48.3
56 85.9 87.8 87.5 103.4
57 112.1 105.2 105.3 119.8
58 105.5 104.3 104.3 113.9
59 104.0 99.6 99.7 100.4
60 97.8 101.0 101.0 85.9
61 91.4 94.0 94.0 79.4
62 104.4 96.1 96.2 95.8
63 111.2 108.3 108.3 103.3
64 102.3 102.9 103.0 117.8
65 94.6 96.0 95.9 102.8
66 109.4 109.0 109.0 123.8
67 69.1 87.6 87.4 41.8
68 86.9 89.9 89.7 107.8
69 118.3 108.8 108.9 124.4
70 102.3 102.3 102.4 109.1
71 108.8 103.9 104.0 107.1
72 101.2 101.3 101.3 86.9
73 99.1 97.4 97.3 86.3
74 105.5 98.1 98.1 98.6
75 119.8 111.4 111.5 121.6
76 94.5 94.2 94.1 102.9
77 101.4 104.5 104.5 116.5
78 116.5 110.0 110.0 124.3
79 66.7 89.7 89.3 44.2
80 91.6 92.6 92.5 110.5
81 119.8 108.6 108.7 124.2
82 116.4 110.6 110.7 116.3
83 111.7 107.0 107.1 113.3
84 102.4 101.4 101.4 83.9
85 99.3 107.2 107.3 95.6
86 109.3 105.1 105.2 106.8
87 119.0 114.1 114.2 122.7
88 102.5 103.1 103.0 102.7
89 104.9 107.6 107.6 108.4
90 122.4 113.8 113.9 120.0
91 76.4 100.2 100.1 49.4
92 103.2 100.2 100.2 111.2
93 120.8 109.0 109.1 113.3
94 124.9 119.6 119.8 125.8
95 110.2 112.2 112.4 109.9
96 99.7 100.0 100.0 74.3
97 97.1 111.4 111.6 106.7
98 109.3 113.1 113.3 114.8
99 109.4 113.7 113.9 93.6
100 117.0 117.1 117.4 126.4
101 107.1 108.5 108.5 109.4
102 118.5 117.0 117.3 117.3
103 85.1 103.7 103.7 57.1
104 85.3 95.2 95.1 97.4
105 129.7 116.4 116.6 122.7
106 128.0 116.6 116.9 115.7
107 103.3 98.8 98.8 95.5
108 103.9 97.7 97.7 77.6
109 96.2 89.8 89.6 86.3
110 106.3 93.0 93.1 101.3
111 114.8 100.4 100.4 116.6
112 101.9 93.5 93.5 100.2
113 90.9 90.9 90.8 98.8
114 108.5 103.4 103.4 113.8
115 75.6 91.1 90.9 53.2
116 90.6 89.5 89.3 93.6
117 121.1 108.1 108.2 117.7
118 116.6 107.8 107.9 117.9
119 105.7 99.9 100.0 87.2
120 101.1 94.6 94.6 68.9
121 97.0 94.3 94.2 74.0
122 105.4 99.9 99.9 83.9
123 117.9 113.8 113.9 121.1
124 104.5 105.4 105.5 98.1
125 97.4 101.2 101.2 89.1
126 115.8 115.0 115.1 116.1
127 73.1 94.4 94.2 48.9
128 90.6 95.5 95.4 98.6
129 124.1 113.3 113.5 114.8
130 110.1 108.7 108.8 109.2
131 103.4 106.9 107.0 91.4
132 109.4 102.8 102.8 58.6
133 92.1 104.7 104.7 81.9
134 107.8 108.2 108.5 105.2
135 116.2 128.0 128.4 122.4
136 97.5 108.4 108.5 92.2
137 104.8 115.5 115.6 113.9
138 106.2 111.5 111.7 104.1
139 73.6 93.8 93.7 43.1
140 100.7 106.0 106.1 100.1
141 123.4 118.4 118.7 118.0
142 109.1 110.8 111.0 103.8
143 100.1 110.5 110.8 103.4
144 105.9 104.1 104.2 79.5
145 104.8 105.0 105.1 87.2
146 110.8 102.8 102.9 98.3
147 118.4 113.8 114.0 145.7
148 93.1 102.0 102.1 107.9
149 105.4 106.1 106.2 107.6
150 113.6 109.6 109.7 111.6
151 75.0 97.3 97.3 48.9
152 94.0 98.2 98.2 104.3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) winningrondstoffen industrie bouw
54.6896 -31.4214 31.5140 0.3843
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-15.6461 -5.1371 0.2099 4.7502 22.6781
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 54.68961 9.81005 5.575 1.14e-07 ***
winningrondstoffen -31.42144 6.81932 -4.608 8.72e-06 ***
industrie 31.51397 6.74180 4.674 6.58e-06 ***
bouw 0.38432 0.02944 13.054 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.708 on 148 degrees of freedom
Multiple R-squared: 0.759, Adjusted R-squared: 0.7542
F-statistic: 155.4 on 3 and 148 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.08204426 0.16408852 0.9179557
[2,] 0.41266699 0.82533397 0.5873330
[3,] 0.33945971 0.67891942 0.6605403
[4,] 0.23099837 0.46199674 0.7690016
[5,] 0.15439817 0.30879634 0.8456018
[6,] 0.10034144 0.20068288 0.8996586
[7,] 0.07791370 0.15582740 0.9220863
[8,] 0.11661677 0.23323354 0.8833832
[9,] 0.08418899 0.16837799 0.9158110
[10,] 0.05568648 0.11137295 0.9443135
[11,] 0.04366485 0.08732970 0.9563352
[12,] 0.04187180 0.08374360 0.9581282
[13,] 0.04124350 0.08248700 0.9587565
[14,] 0.03154809 0.06309618 0.9684519
[15,] 0.02581960 0.05163920 0.9741804
[16,] 0.03002934 0.06005868 0.9699707
[17,] 0.02763383 0.05526766 0.9723662
[18,] 0.03402477 0.06804954 0.9659752
[19,] 0.02865429 0.05730858 0.9713457
[20,] 0.02122324 0.04244647 0.9787768
[21,] 0.02000530 0.04001060 0.9799947
[22,] 0.02068503 0.04137005 0.9793150
[23,] 0.03310157 0.06620313 0.9668984
[24,] 0.10145523 0.20291046 0.8985448
[25,] 0.07843420 0.15686840 0.9215658
[26,] 0.08107789 0.16215579 0.9189221
[27,] 0.08626438 0.17252876 0.9137356
[28,] 0.07854372 0.15708744 0.9214563
[29,] 0.21109122 0.42218244 0.7889088
[30,] 0.20284615 0.40569230 0.7971538
[31,] 0.20595704 0.41191408 0.7940430
[32,] 0.18781159 0.37562318 0.8121884
[33,] 0.32033400 0.64066800 0.6796660
[34,] 0.43059093 0.86118185 0.5694091
[35,] 0.67922175 0.64155650 0.3207783
[36,] 0.65255488 0.69489025 0.3474451
[37,] 0.61414180 0.77171641 0.3858582
[38,] 0.62429060 0.75141880 0.3757094
[39,] 0.63412851 0.73174299 0.3658715
[40,] 0.58704326 0.82591348 0.4129567
[41,] 0.62452946 0.75094108 0.3754705
[42,] 0.60412275 0.79175450 0.3958773
[43,] 0.59194012 0.81611976 0.4080599
[44,] 0.55322133 0.89355734 0.4467787
[45,] 0.50908186 0.98183628 0.4909181
[46,] 0.47334817 0.94669634 0.5266518
[47,] 0.61393706 0.77212588 0.3860629
[48,] 0.56566651 0.86866698 0.4343335
[49,] 0.56607750 0.86784501 0.4339225
[50,] 0.56128487 0.87743026 0.4387151
[51,] 0.51611823 0.96776354 0.4838818
[52,] 0.47126943 0.94253886 0.5287306
[53,] 0.42567899 0.85135799 0.5743210
[54,] 0.38439390 0.76878780 0.6156061
[55,] 0.34060626 0.68121252 0.6593937
[56,] 0.30395727 0.60791454 0.6960427
[57,] 0.31901773 0.63803547 0.6809823
[58,] 0.37876198 0.75752396 0.6212380
[59,] 0.35456843 0.70913687 0.6454316
[60,] 0.31734256 0.63468511 0.6826574
[61,] 0.28442538 0.56885076 0.7155746
[62,] 0.35010335 0.70020670 0.6498966
[63,] 0.31561883 0.63123766 0.6843812
[64,] 0.31205427 0.62410854 0.6879457
[65,] 0.27204271 0.54408542 0.7279573
[66,] 0.25309201 0.50618401 0.7469080
[67,] 0.24828006 0.49656013 0.7517199
[68,] 0.22848379 0.45696758 0.7715162
[69,] 0.21356065 0.42712131 0.7864393
[70,] 0.19622681 0.39245361 0.8037732
[71,] 0.20380801 0.40761601 0.7961920
[72,] 0.18302095 0.36604190 0.8169791
[73,] 0.16772476 0.33544951 0.8322752
[74,] 0.21524514 0.43049027 0.7847549
[75,] 0.19553869 0.39107738 0.8044613
[76,] 0.17289272 0.34578544 0.8271073
[77,] 0.14457292 0.28914585 0.8554271
[78,] 0.13987308 0.27974615 0.8601269
[79,] 0.12962114 0.25924229 0.8703789
[80,] 0.10674489 0.21348978 0.8932551
[81,] 0.09054216 0.18108433 0.9094578
[82,] 0.07399465 0.14798930 0.9260054
[83,] 0.05976055 0.11952109 0.9402395
[84,] 0.06319708 0.12639417 0.9368029
[85,] 0.05810470 0.11620940 0.9418953
[86,] 0.04814613 0.09629226 0.9518539
[87,] 0.05997919 0.11995838 0.9400208
[88,] 0.05204617 0.10409234 0.9479538
[89,] 0.04346723 0.08693446 0.9565328
[90,] 0.04346846 0.08693693 0.9565315
[91,] 0.10889285 0.21778570 0.8911071
[92,] 0.10391081 0.20782162 0.8960892
[93,] 0.08452622 0.16905244 0.9154738
[94,] 0.08033918 0.16067837 0.9196608
[95,] 0.06346918 0.12693836 0.9365308
[96,] 0.04982489 0.09964979 0.9501751
[97,] 0.04127053 0.08254106 0.9587295
[98,] 0.07185337 0.14370673 0.9281466
[99,] 0.10399753 0.20799507 0.8960025
[100,] 0.12858484 0.25716969 0.8714152
[101,] 0.10737323 0.21474646 0.8926268
[102,] 0.13532831 0.27065661 0.8646717
[103,] 0.12749842 0.25499683 0.8725016
[104,] 0.10935160 0.21870320 0.8906484
[105,] 0.11489069 0.22978138 0.8851093
[106,] 0.09544240 0.19088480 0.9045576
[107,] 0.08647432 0.17294864 0.9135257
[108,] 0.06823970 0.13647940 0.9317603
[109,] 0.05924413 0.11848826 0.9407559
[110,] 0.04570731 0.09141461 0.9542927
[111,] 0.05857337 0.11714674 0.9414266
[112,] 0.05365637 0.10731274 0.9463436
[113,] 0.05201649 0.10403297 0.9479835
[114,] 0.08833935 0.17667871 0.9116606
[115,] 0.10379682 0.20759363 0.8962032
[116,] 0.14582573 0.29165146 0.8541743
[117,] 0.12331495 0.24662991 0.8766850
[118,] 0.09793415 0.19586830 0.9020658
[119,] 0.07495021 0.14990043 0.9250498
[120,] 0.05833732 0.11667464 0.9416627
[121,] 0.05593058 0.11186115 0.9440694
[122,] 0.04617339 0.09234678 0.9538266
[123,] 0.07904937 0.15809874 0.9209506
[124,] 0.06179906 0.12359812 0.9382009
[125,] 0.04466635 0.08933269 0.9553337
[126,] 0.40574710 0.81149419 0.5942529
[127,] 0.34273891 0.68547783 0.6572611
[128,] 0.28844428 0.57688857 0.7115557
[129,] 0.33597805 0.67195610 0.6640220
[130,] 0.29417116 0.58834231 0.7058288
[131,] 0.47240406 0.94480811 0.5275959
[132,] 0.42609928 0.85219857 0.5739007
[133,] 0.39606481 0.79212961 0.6039352
[134,] 0.33771325 0.67542650 0.6622868
[135,] 0.24857277 0.49714555 0.7514272
[136,] 0.16985516 0.33971032 0.8301448
[137,] 0.19135054 0.38270108 0.8086495
[138,] 0.17050756 0.34101511 0.8294924
[139,] 0.11969775 0.23939551 0.8803022
> postscript(file="/var/wessaorg/rcomp/tmp/1s1sk1352285486.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/2xx2t1352285486.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/3wp7b1352285486.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/416wq1352285486.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/52v7n1352285486.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 = 152
Frequency = 1
1 2 3 4 5 6
5.28996114 7.67617029 10.67102743 2.21606679 4.62986923 7.29921513
7 8 9 10 11 12
-1.35952819 -10.55353243 5.41794232 8.34377829 6.61611646 3.68319491
13 14 15 16 17 18
7.77964504 -0.07111699 13.93449819 6.98289222 6.36582301 5.52891534
19 20 21 22 23 24
-2.30599708 -1.50716860 11.04642957 4.69398499 2.64564505 9.46275571
25 26 27 28 29 30
2.32525516 3.81983107 4.47083228 1.27136349 -3.05055618 -7.40145364
31 32 33 34 35 36
3.20743859 -3.95753463 11.46426780 5.52364208 -8.30008801 7.30523619
37 38 39 40 41 42
-1.87134584 -0.03172684 -7.63553762 -7.98112576 -14.04500915 -2.29523847
43 44 45 46 47 48
-3.00745675 -7.86405036 -5.56593495 0.38488368 -8.19545498 -5.31968199
49 50 51 52 53 54
-6.10504755 -2.25228110 2.30297970 -3.47491174 -13.58279035 -0.34565949
55 56 57 58 59 60
-8.33006442 -7.19731611 -1.51559626 -2.61345265 -1.64170190 0.75277904
61 62 63 64 65 66
-2.50150174 0.84998733 6.79023458 -10.33416028 -5.32819493 -2.95305437
67 68 69 70 71 72
-3.45620497 -11.23400819 2.58346236 -6.93507869 0.18552335 3.74070435
73 74 75 76 77 78
5.38352587 3.84024984 4.91899747 -5.30008801 -7.73118437 3.86226499
79 80 81 82 83 84
-0.67007068 -10.97287218 4.17883031 3.62990135 0.41593355 6.08440691
85 86 87 88 89 90
-5.20013794 0.68979299 3.44643929 1.95333408 -1.40502337 7.91185499
91 92 93 94 95 96
-3.39419142 -3.49645516 9.33089050 4.49478774 -3.40989300 7.20339213
97 98 99 100 101 102
-15.20605742 -6.27632174 1.91571199 -6.55589603 0.32738902 -1.54934791
103 104 105 106 107 108
-1.12866381 -12.47885922 10.78224315 8.60256988 2.76687131 10.34794145
109 110 111 112 113 114
6.33808608 0.92305374 6.00972205 0.05093967 -7.01906220 0.50824855
115 116 117 118 119 120
-1.66125822 -2.03968060 8.02315962 3.47405243 5.10354238 11.17832685
121 122 123 124 125 126
8.29745692 9.22318920 2.98910493 -0.79439480 -0.89554362 2.69967029
127 128 129 130 131 132
-2.81401083 -7.66779757 8.50517396 0.23435173 0.54175511 22.67812820
133 134 135 136 137 138
-3.75227764 -6.78490782 -9.97850432 -5.80448176 -7.50109035 -5.11608215
139 140 141 142 143 144
-3.18084876 -5.41854419 2.95209919 -2.03602161 -14.00593449 7.87420241
145 146 147 148 149 150
3.73168261 5.66929752 -9.11652036 -15.64614035 -3.61018312 2.72871859
151 152
-7.48511651 -9.85961627
> postscript(file="/var/wessaorg/rcomp/tmp/6ybf61352285486.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 = 152
Frequency = 1
lag(myerror, k = 1) myerror
0 5.28996114 NA
1 7.67617029 5.28996114
2 10.67102743 7.67617029
3 2.21606679 10.67102743
4 4.62986923 2.21606679
5 7.29921513 4.62986923
6 -1.35952819 7.29921513
7 -10.55353243 -1.35952819
8 5.41794232 -10.55353243
9 8.34377829 5.41794232
10 6.61611646 8.34377829
11 3.68319491 6.61611646
12 7.77964504 3.68319491
13 -0.07111699 7.77964504
14 13.93449819 -0.07111699
15 6.98289222 13.93449819
16 6.36582301 6.98289222
17 5.52891534 6.36582301
18 -2.30599708 5.52891534
19 -1.50716860 -2.30599708
20 11.04642957 -1.50716860
21 4.69398499 11.04642957
22 2.64564505 4.69398499
23 9.46275571 2.64564505
24 2.32525516 9.46275571
25 3.81983107 2.32525516
26 4.47083228 3.81983107
27 1.27136349 4.47083228
28 -3.05055618 1.27136349
29 -7.40145364 -3.05055618
30 3.20743859 -7.40145364
31 -3.95753463 3.20743859
32 11.46426780 -3.95753463
33 5.52364208 11.46426780
34 -8.30008801 5.52364208
35 7.30523619 -8.30008801
36 -1.87134584 7.30523619
37 -0.03172684 -1.87134584
38 -7.63553762 -0.03172684
39 -7.98112576 -7.63553762
40 -14.04500915 -7.98112576
41 -2.29523847 -14.04500915
42 -3.00745675 -2.29523847
43 -7.86405036 -3.00745675
44 -5.56593495 -7.86405036
45 0.38488368 -5.56593495
46 -8.19545498 0.38488368
47 -5.31968199 -8.19545498
48 -6.10504755 -5.31968199
49 -2.25228110 -6.10504755
50 2.30297970 -2.25228110
51 -3.47491174 2.30297970
52 -13.58279035 -3.47491174
53 -0.34565949 -13.58279035
54 -8.33006442 -0.34565949
55 -7.19731611 -8.33006442
56 -1.51559626 -7.19731611
57 -2.61345265 -1.51559626
58 -1.64170190 -2.61345265
59 0.75277904 -1.64170190
60 -2.50150174 0.75277904
61 0.84998733 -2.50150174
62 6.79023458 0.84998733
63 -10.33416028 6.79023458
64 -5.32819493 -10.33416028
65 -2.95305437 -5.32819493
66 -3.45620497 -2.95305437
67 -11.23400819 -3.45620497
68 2.58346236 -11.23400819
69 -6.93507869 2.58346236
70 0.18552335 -6.93507869
71 3.74070435 0.18552335
72 5.38352587 3.74070435
73 3.84024984 5.38352587
74 4.91899747 3.84024984
75 -5.30008801 4.91899747
76 -7.73118437 -5.30008801
77 3.86226499 -7.73118437
78 -0.67007068 3.86226499
79 -10.97287218 -0.67007068
80 4.17883031 -10.97287218
81 3.62990135 4.17883031
82 0.41593355 3.62990135
83 6.08440691 0.41593355
84 -5.20013794 6.08440691
85 0.68979299 -5.20013794
86 3.44643929 0.68979299
87 1.95333408 3.44643929
88 -1.40502337 1.95333408
89 7.91185499 -1.40502337
90 -3.39419142 7.91185499
91 -3.49645516 -3.39419142
92 9.33089050 -3.49645516
93 4.49478774 9.33089050
94 -3.40989300 4.49478774
95 7.20339213 -3.40989300
96 -15.20605742 7.20339213
97 -6.27632174 -15.20605742
98 1.91571199 -6.27632174
99 -6.55589603 1.91571199
100 0.32738902 -6.55589603
101 -1.54934791 0.32738902
102 -1.12866381 -1.54934791
103 -12.47885922 -1.12866381
104 10.78224315 -12.47885922
105 8.60256988 10.78224315
106 2.76687131 8.60256988
107 10.34794145 2.76687131
108 6.33808608 10.34794145
109 0.92305374 6.33808608
110 6.00972205 0.92305374
111 0.05093967 6.00972205
112 -7.01906220 0.05093967
113 0.50824855 -7.01906220
114 -1.66125822 0.50824855
115 -2.03968060 -1.66125822
116 8.02315962 -2.03968060
117 3.47405243 8.02315962
118 5.10354238 3.47405243
119 11.17832685 5.10354238
120 8.29745692 11.17832685
121 9.22318920 8.29745692
122 2.98910493 9.22318920
123 -0.79439480 2.98910493
124 -0.89554362 -0.79439480
125 2.69967029 -0.89554362
126 -2.81401083 2.69967029
127 -7.66779757 -2.81401083
128 8.50517396 -7.66779757
129 0.23435173 8.50517396
130 0.54175511 0.23435173
131 22.67812820 0.54175511
132 -3.75227764 22.67812820
133 -6.78490782 -3.75227764
134 -9.97850432 -6.78490782
135 -5.80448176 -9.97850432
136 -7.50109035 -5.80448176
137 -5.11608215 -7.50109035
138 -3.18084876 -5.11608215
139 -5.41854419 -3.18084876
140 2.95209919 -5.41854419
141 -2.03602161 2.95209919
142 -14.00593449 -2.03602161
143 7.87420241 -14.00593449
144 3.73168261 7.87420241
145 5.66929752 3.73168261
146 -9.11652036 5.66929752
147 -15.64614035 -9.11652036
148 -3.61018312 -15.64614035
149 2.72871859 -3.61018312
150 -7.48511651 2.72871859
151 -9.85961627 -7.48511651
152 NA -9.85961627
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 7.67617029 5.28996114
[2,] 10.67102743 7.67617029
[3,] 2.21606679 10.67102743
[4,] 4.62986923 2.21606679
[5,] 7.29921513 4.62986923
[6,] -1.35952819 7.29921513
[7,] -10.55353243 -1.35952819
[8,] 5.41794232 -10.55353243
[9,] 8.34377829 5.41794232
[10,] 6.61611646 8.34377829
[11,] 3.68319491 6.61611646
[12,] 7.77964504 3.68319491
[13,] -0.07111699 7.77964504
[14,] 13.93449819 -0.07111699
[15,] 6.98289222 13.93449819
[16,] 6.36582301 6.98289222
[17,] 5.52891534 6.36582301
[18,] -2.30599708 5.52891534
[19,] -1.50716860 -2.30599708
[20,] 11.04642957 -1.50716860
[21,] 4.69398499 11.04642957
[22,] 2.64564505 4.69398499
[23,] 9.46275571 2.64564505
[24,] 2.32525516 9.46275571
[25,] 3.81983107 2.32525516
[26,] 4.47083228 3.81983107
[27,] 1.27136349 4.47083228
[28,] -3.05055618 1.27136349
[29,] -7.40145364 -3.05055618
[30,] 3.20743859 -7.40145364
[31,] -3.95753463 3.20743859
[32,] 11.46426780 -3.95753463
[33,] 5.52364208 11.46426780
[34,] -8.30008801 5.52364208
[35,] 7.30523619 -8.30008801
[36,] -1.87134584 7.30523619
[37,] -0.03172684 -1.87134584
[38,] -7.63553762 -0.03172684
[39,] -7.98112576 -7.63553762
[40,] -14.04500915 -7.98112576
[41,] -2.29523847 -14.04500915
[42,] -3.00745675 -2.29523847
[43,] -7.86405036 -3.00745675
[44,] -5.56593495 -7.86405036
[45,] 0.38488368 -5.56593495
[46,] -8.19545498 0.38488368
[47,] -5.31968199 -8.19545498
[48,] -6.10504755 -5.31968199
[49,] -2.25228110 -6.10504755
[50,] 2.30297970 -2.25228110
[51,] -3.47491174 2.30297970
[52,] -13.58279035 -3.47491174
[53,] -0.34565949 -13.58279035
[54,] -8.33006442 -0.34565949
[55,] -7.19731611 -8.33006442
[56,] -1.51559626 -7.19731611
[57,] -2.61345265 -1.51559626
[58,] -1.64170190 -2.61345265
[59,] 0.75277904 -1.64170190
[60,] -2.50150174 0.75277904
[61,] 0.84998733 -2.50150174
[62,] 6.79023458 0.84998733
[63,] -10.33416028 6.79023458
[64,] -5.32819493 -10.33416028
[65,] -2.95305437 -5.32819493
[66,] -3.45620497 -2.95305437
[67,] -11.23400819 -3.45620497
[68,] 2.58346236 -11.23400819
[69,] -6.93507869 2.58346236
[70,] 0.18552335 -6.93507869
[71,] 3.74070435 0.18552335
[72,] 5.38352587 3.74070435
[73,] 3.84024984 5.38352587
[74,] 4.91899747 3.84024984
[75,] -5.30008801 4.91899747
[76,] -7.73118437 -5.30008801
[77,] 3.86226499 -7.73118437
[78,] -0.67007068 3.86226499
[79,] -10.97287218 -0.67007068
[80,] 4.17883031 -10.97287218
[81,] 3.62990135 4.17883031
[82,] 0.41593355 3.62990135
[83,] 6.08440691 0.41593355
[84,] -5.20013794 6.08440691
[85,] 0.68979299 -5.20013794
[86,] 3.44643929 0.68979299
[87,] 1.95333408 3.44643929
[88,] -1.40502337 1.95333408
[89,] 7.91185499 -1.40502337
[90,] -3.39419142 7.91185499
[91,] -3.49645516 -3.39419142
[92,] 9.33089050 -3.49645516
[93,] 4.49478774 9.33089050
[94,] -3.40989300 4.49478774
[95,] 7.20339213 -3.40989300
[96,] -15.20605742 7.20339213
[97,] -6.27632174 -15.20605742
[98,] 1.91571199 -6.27632174
[99,] -6.55589603 1.91571199
[100,] 0.32738902 -6.55589603
[101,] -1.54934791 0.32738902
[102,] -1.12866381 -1.54934791
[103,] -12.47885922 -1.12866381
[104,] 10.78224315 -12.47885922
[105,] 8.60256988 10.78224315
[106,] 2.76687131 8.60256988
[107,] 10.34794145 2.76687131
[108,] 6.33808608 10.34794145
[109,] 0.92305374 6.33808608
[110,] 6.00972205 0.92305374
[111,] 0.05093967 6.00972205
[112,] -7.01906220 0.05093967
[113,] 0.50824855 -7.01906220
[114,] -1.66125822 0.50824855
[115,] -2.03968060 -1.66125822
[116,] 8.02315962 -2.03968060
[117,] 3.47405243 8.02315962
[118,] 5.10354238 3.47405243
[119,] 11.17832685 5.10354238
[120,] 8.29745692 11.17832685
[121,] 9.22318920 8.29745692
[122,] 2.98910493 9.22318920
[123,] -0.79439480 2.98910493
[124,] -0.89554362 -0.79439480
[125,] 2.69967029 -0.89554362
[126,] -2.81401083 2.69967029
[127,] -7.66779757 -2.81401083
[128,] 8.50517396 -7.66779757
[129,] 0.23435173 8.50517396
[130,] 0.54175511 0.23435173
[131,] 22.67812820 0.54175511
[132,] -3.75227764 22.67812820
[133,] -6.78490782 -3.75227764
[134,] -9.97850432 -6.78490782
[135,] -5.80448176 -9.97850432
[136,] -7.50109035 -5.80448176
[137,] -5.11608215 -7.50109035
[138,] -3.18084876 -5.11608215
[139,] -5.41854419 -3.18084876
[140,] 2.95209919 -5.41854419
[141,] -2.03602161 2.95209919
[142,] -14.00593449 -2.03602161
[143,] 7.87420241 -14.00593449
[144,] 3.73168261 7.87420241
[145,] 5.66929752 3.73168261
[146,] -9.11652036 5.66929752
[147,] -15.64614035 -9.11652036
[148,] -3.61018312 -15.64614035
[149,] 2.72871859 -3.61018312
[150,] -7.48511651 2.72871859
[151,] -9.85961627 -7.48511651
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 7.67617029 5.28996114
2 10.67102743 7.67617029
3 2.21606679 10.67102743
4 4.62986923 2.21606679
5 7.29921513 4.62986923
6 -1.35952819 7.29921513
7 -10.55353243 -1.35952819
8 5.41794232 -10.55353243
9 8.34377829 5.41794232
10 6.61611646 8.34377829
11 3.68319491 6.61611646
12 7.77964504 3.68319491
13 -0.07111699 7.77964504
14 13.93449819 -0.07111699
15 6.98289222 13.93449819
16 6.36582301 6.98289222
17 5.52891534 6.36582301
18 -2.30599708 5.52891534
19 -1.50716860 -2.30599708
20 11.04642957 -1.50716860
21 4.69398499 11.04642957
22 2.64564505 4.69398499
23 9.46275571 2.64564505
24 2.32525516 9.46275571
25 3.81983107 2.32525516
26 4.47083228 3.81983107
27 1.27136349 4.47083228
28 -3.05055618 1.27136349
29 -7.40145364 -3.05055618
30 3.20743859 -7.40145364
31 -3.95753463 3.20743859
32 11.46426780 -3.95753463
33 5.52364208 11.46426780
34 -8.30008801 5.52364208
35 7.30523619 -8.30008801
36 -1.87134584 7.30523619
37 -0.03172684 -1.87134584
38 -7.63553762 -0.03172684
39 -7.98112576 -7.63553762
40 -14.04500915 -7.98112576
41 -2.29523847 -14.04500915
42 -3.00745675 -2.29523847
43 -7.86405036 -3.00745675
44 -5.56593495 -7.86405036
45 0.38488368 -5.56593495
46 -8.19545498 0.38488368
47 -5.31968199 -8.19545498
48 -6.10504755 -5.31968199
49 -2.25228110 -6.10504755
50 2.30297970 -2.25228110
51 -3.47491174 2.30297970
52 -13.58279035 -3.47491174
53 -0.34565949 -13.58279035
54 -8.33006442 -0.34565949
55 -7.19731611 -8.33006442
56 -1.51559626 -7.19731611
57 -2.61345265 -1.51559626
58 -1.64170190 -2.61345265
59 0.75277904 -1.64170190
60 -2.50150174 0.75277904
61 0.84998733 -2.50150174
62 6.79023458 0.84998733
63 -10.33416028 6.79023458
64 -5.32819493 -10.33416028
65 -2.95305437 -5.32819493
66 -3.45620497 -2.95305437
67 -11.23400819 -3.45620497
68 2.58346236 -11.23400819
69 -6.93507869 2.58346236
70 0.18552335 -6.93507869
71 3.74070435 0.18552335
72 5.38352587 3.74070435
73 3.84024984 5.38352587
74 4.91899747 3.84024984
75 -5.30008801 4.91899747
76 -7.73118437 -5.30008801
77 3.86226499 -7.73118437
78 -0.67007068 3.86226499
79 -10.97287218 -0.67007068
80 4.17883031 -10.97287218
81 3.62990135 4.17883031
82 0.41593355 3.62990135
83 6.08440691 0.41593355
84 -5.20013794 6.08440691
85 0.68979299 -5.20013794
86 3.44643929 0.68979299
87 1.95333408 3.44643929
88 -1.40502337 1.95333408
89 7.91185499 -1.40502337
90 -3.39419142 7.91185499
91 -3.49645516 -3.39419142
92 9.33089050 -3.49645516
93 4.49478774 9.33089050
94 -3.40989300 4.49478774
95 7.20339213 -3.40989300
96 -15.20605742 7.20339213
97 -6.27632174 -15.20605742
98 1.91571199 -6.27632174
99 -6.55589603 1.91571199
100 0.32738902 -6.55589603
101 -1.54934791 0.32738902
102 -1.12866381 -1.54934791
103 -12.47885922 -1.12866381
104 10.78224315 -12.47885922
105 8.60256988 10.78224315
106 2.76687131 8.60256988
107 10.34794145 2.76687131
108 6.33808608 10.34794145
109 0.92305374 6.33808608
110 6.00972205 0.92305374
111 0.05093967 6.00972205
112 -7.01906220 0.05093967
113 0.50824855 -7.01906220
114 -1.66125822 0.50824855
115 -2.03968060 -1.66125822
116 8.02315962 -2.03968060
117 3.47405243 8.02315962
118 5.10354238 3.47405243
119 11.17832685 5.10354238
120 8.29745692 11.17832685
121 9.22318920 8.29745692
122 2.98910493 9.22318920
123 -0.79439480 2.98910493
124 -0.89554362 -0.79439480
125 2.69967029 -0.89554362
126 -2.81401083 2.69967029
127 -7.66779757 -2.81401083
128 8.50517396 -7.66779757
129 0.23435173 8.50517396
130 0.54175511 0.23435173
131 22.67812820 0.54175511
132 -3.75227764 22.67812820
133 -6.78490782 -3.75227764
134 -9.97850432 -6.78490782
135 -5.80448176 -9.97850432
136 -7.50109035 -5.80448176
137 -5.11608215 -7.50109035
138 -3.18084876 -5.11608215
139 -5.41854419 -3.18084876
140 2.95209919 -5.41854419
141 -2.03602161 2.95209919
142 -14.00593449 -2.03602161
143 7.87420241 -14.00593449
144 3.73168261 7.87420241
145 5.66929752 3.73168261
146 -9.11652036 5.66929752
147 -15.64614035 -9.11652036
148 -3.61018312 -15.64614035
149 2.72871859 -3.61018312
150 -7.48511651 2.72871859
151 -9.85961627 -7.48511651
> 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/7qf3y1352285486.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/8zqxk1352285486.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/96ngw1352285486.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/10v5ee1352285486.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/11tf9p1352285486.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/120p8a1352285486.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/138dkw1352285486.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/141uut1352285486.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/15gzne1352285486.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/16ba331352285486.tab")
+ }
>
> try(system("convert tmp/1s1sk1352285486.ps tmp/1s1sk1352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/2xx2t1352285486.ps tmp/2xx2t1352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wp7b1352285486.ps tmp/3wp7b1352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/416wq1352285486.ps tmp/416wq1352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/52v7n1352285486.ps tmp/52v7n1352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ybf61352285486.ps tmp/6ybf61352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qf3y1352285486.ps tmp/7qf3y1352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/8zqxk1352285486.ps tmp/8zqxk1352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/96ngw1352285486.ps tmp/96ngw1352285486.png",intern=TRUE))
character(0)
> try(system("convert tmp/10v5ee1352285486.ps tmp/10v5ee1352285486.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.271 1.031 8.302