R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(9
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,9
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,9
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,9
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,9
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,9
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,10
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,10
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,10
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,10
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,10
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,10
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,10
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,10
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,10
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,10
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,10
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,10
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,10
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,10
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,10
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,10
+ ,16
+ ,18
+ ,11
+ ,21
+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ards','Organization
'),1:159))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '5'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
PersonalStandards Maand DoubtsAboutActions ParentalExpectations
1 24 9 14 11
2 25 9 11 7
3 30 9 6 17
4 19 9 12 10
5 22 9 8 12
6 22 9 10 12
7 25 10 10 11
8 23 10 11 11
9 17 10 16 12
10 21 10 11 13
11 19 10 13 14
12 19 10 12 16
13 15 10 8 11
14 16 10 12 10
15 23 10 11 11
16 27 10 4 15
17 22 10 9 9
18 14 10 8 11
19 22 10 8 17
20 23 10 14 17
21 23 10 15 11
22 21 10 16 18
23 19 10 9 14
24 18 10 14 10
25 20 10 11 11
26 23 10 8 15
27 25 10 9 15
28 19 10 9 13
29 24 10 9 16
30 22 10 9 13
31 25 10 10 9
32 26 10 16 18
33 29 10 11 18
34 32 10 8 12
35 25 10 9 17
36 29 10 16 9
37 28 10 11 9
38 17 10 16 12
39 28 10 12 18
40 29 10 12 12
41 26 10 14 18
42 25 10 9 14
43 14 10 10 15
44 25 10 9 16
45 26 10 10 10
46 20 10 12 11
47 18 10 14 14
48 32 10 14 9
49 25 10 10 12
50 25 10 14 17
51 23 10 16 5
52 21 10 9 12
53 20 10 10 12
54 15 10 6 6
55 30 10 8 24
56 24 10 13 12
57 26 10 10 12
58 24 10 8 14
59 22 10 7 7
60 14 10 15 13
61 24 10 9 12
62 24 10 10 13
63 24 10 12 14
64 24 10 13 8
65 19 10 10 11
66 31 10 11 9
67 22 10 8 11
68 27 10 9 13
69 19 10 13 10
70 25 10 11 11
71 20 10 8 12
72 21 10 9 9
73 27 10 9 15
74 23 10 15 18
75 25 10 9 15
76 20 10 10 12
77 21 10 14 13
78 22 10 12 14
79 23 10 12 10
80 25 10 11 13
81 25 10 14 13
82 17 10 6 11
83 19 10 12 13
84 25 10 8 16
85 19 10 14 8
86 20 10 11 16
87 26 10 10 11
88 23 10 14 9
89 27 10 12 16
90 17 10 10 12
91 17 10 14 14
92 19 10 5 8
93 17 10 11 9
94 22 10 10 15
95 21 10 9 11
96 32 10 10 21
97 21 10 16 14
98 21 10 13 18
99 18 10 9 12
100 18 10 10 13
101 23 10 10 15
102 19 10 7 12
103 20 10 9 19
104 21 10 8 15
105 20 10 14 11
106 17 10 14 11
107 18 10 8 10
108 19 10 9 13
109 22 10 14 15
110 15 10 14 12
111 14 10 8 12
112 18 10 8 16
113 24 10 8 9
114 35 10 7 18
115 29 10 6 8
116 21 10 8 13
117 25 10 6 17
118 20 10 11 9
119 22 10 14 15
120 13 10 11 8
121 26 10 11 7
122 17 10 11 12
123 25 10 14 14
124 20 10 8 6
125 19 10 20 8
126 21 10 11 17
127 22 10 8 10
128 24 10 11 11
129 21 10 10 14
130 26 10 14 11
131 24 10 11 13
132 16 10 9 12
133 23 10 9 11
134 18 10 8 9
135 16 10 10 12
136 26 10 13 20
137 19 10 13 12
138 21 10 12 13
139 21 10 8 12
140 22 10 13 12
141 23 10 14 9
142 29 10 12 15
143 21 10 14 24
144 21 10 15 7
145 23 10 13 17
146 27 10 16 11
147 25 10 9 17
148 21 10 9 11
149 10 10 9 12
150 20 10 8 14
151 26 10 7 11
152 24 10 16 16
153 29 10 11 21
154 19 10 9 14
155 24 10 11 20
156 19 10 9 13
157 24 10 14 11
158 22 10 13 15
159 17 10 16 19
ParentalCriticism Organization\r
1 12 26
2 8 23
3 8 25
4 8 23
5 9 19
6 7 29
7 4 25
8 11 21
9 7 22
10 7 25
11 12 24
12 10 18
13 10 22
14 8 15
15 8 22
16 4 28
17 9 20
18 8 12
19 7 24
20 11 20
21 9 21
22 11 20
23 13 21
24 8 23
25 8 28
26 9 24
27 6 24
28 9 24
29 9 23
30 6 23
31 6 29
32 16 24
33 5 18
34 7 25
35 9 21
36 6 26
37 6 22
38 5 22
39 12 22
40 7 23
41 10 30
42 9 23
43 8 17
44 5 23
45 8 23
46 8 25
47 10 24
48 6 24
49 8 23
50 7 21
51 4 24
52 8 24
53 8 28
54 4 16
55 20 20
56 8 29
57 8 27
58 6 22
59 4 28
60 8 16
61 9 25
62 6 24
63 7 28
64 9 24
65 5 23
66 5 30
67 8 24
68 8 21
69 6 25
70 8 25
71 7 22
72 7 23
73 9 26
74 11 23
75 6 25
76 8 21
77 6 25
78 9 24
79 8 29
80 6 22
81 10 27
82 8 26
83 8 22
84 10 24
85 5 27
86 7 24
87 5 24
88 8 29
89 14 22
90 7 21
91 8 24
92 6 24
93 5 23
94 6 20
95 10 27
96 12 26
97 9 25
98 12 21
99 7 21
100 8 19
101 10 21
102 6 21
103 10 16
104 10 22
105 10 29
106 5 15
107 7 17
108 10 15
109 11 21
110 6 21
111 7 19
112 12 24
113 11 20
114 11 17
115 11 23
116 5 24
117 8 14
118 6 19
119 9 24
120 4 13
121 4 22
122 7 16
123 11 19
124 6 25
125 7 25
126 8 23
127 4 24
128 8 26
129 9 26
130 8 25
131 11 18
132 8 21
133 5 26
134 4 23
135 8 23
136 10 22
137 6 20
138 9 13
139 9 24
140 13 15
141 9 14
142 10 22
143 20 10
144 5 24
145 11 22
146 6 24
147 9 19
148 7 20
149 9 13
150 10 20
151 9 22
152 8 24
153 7 29
154 6 12
155 13 20
156 6 21
157 8 24
158 10 22
159 16 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Maand DoubtsAboutActions
19.30221 -1.09313 -0.11310
ParentalExpectations ParentalCriticism `Organization\r`
0.33962 0.09261 0.44045
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.9878 -2.5712 -0.3581 2.2162 12.8013
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 19.30221 16.14539 1.196 0.23373
Maand -1.09313 1.59491 -0.685 0.49414
DoubtsAboutActions -0.11310 0.10972 -1.031 0.30427
ParentalExpectations 0.33962 0.10946 3.103 0.00228 **
ParentalCriticism 0.09261 0.14260 0.649 0.51702
`Organization\r` 0.44045 0.07941 5.546 1.25e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.772 on 153 degrees of freedom
Multiple R-squared: 0.2251, Adjusted R-squared: 0.1997
F-statistic: 8.886 on 5 and 153 DF, p-value: 1.99e-07
> 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.51948148 0.96103704 0.4805185
[2,] 0.42387524 0.84775049 0.5761248
[3,] 0.36276480 0.72552959 0.6372352
[4,] 0.24398160 0.48796320 0.7560184
[5,] 0.60722829 0.78554343 0.3927717
[6,] 0.50480730 0.99038540 0.4951927
[7,] 0.47229107 0.94458213 0.5277089
[8,] 0.37589848 0.75179696 0.6241015
[9,] 0.31603957 0.63207914 0.6839604
[10,] 0.30189407 0.60378813 0.6981059
[11,] 0.23688105 0.47376210 0.7631190
[12,] 0.24695338 0.49390677 0.7530466
[13,] 0.26279172 0.52558345 0.7372083
[14,] 0.20424515 0.40849030 0.7957549
[15,] 0.16445551 0.32891102 0.8355445
[16,] 0.13709630 0.27419259 0.8629037
[17,] 0.12034097 0.24068194 0.8796590
[18,] 0.08800163 0.17600326 0.9119984
[19,] 0.06947008 0.13894016 0.9305299
[20,] 0.06199069 0.12398137 0.9380093
[21,] 0.04657161 0.09314321 0.9534284
[22,] 0.03201229 0.06402459 0.9679877
[23,] 0.02603452 0.05206905 0.9739655
[24,] 0.02991791 0.05983582 0.9700821
[25,] 0.06722343 0.13444686 0.9327766
[26,] 0.27407423 0.54814846 0.7259258
[27,] 0.23472970 0.46945941 0.7652703
[28,] 0.36016902 0.72033805 0.6398310
[29,] 0.49261932 0.98523865 0.5073807
[30,] 0.56006106 0.87987788 0.4399389
[31,] 0.59059313 0.81881373 0.4094069
[32,] 0.69076090 0.61847821 0.3092391
[33,] 0.64637460 0.70725079 0.3536254
[34,] 0.60769578 0.78460844 0.3923042
[35,] 0.70738055 0.58523890 0.2926194
[36,] 0.66555740 0.66888520 0.3344426
[37,] 0.67635393 0.64729214 0.3236461
[38,] 0.65575722 0.68848557 0.3442428
[39,] 0.68426992 0.63146016 0.3157301
[40,] 0.89048626 0.21902748 0.1095137
[41,] 0.87635082 0.24729835 0.1236492
[42,] 0.85883570 0.28232860 0.1411643
[43,] 0.84514566 0.30970868 0.1548543
[44,] 0.82259838 0.35480323 0.1774016
[45,] 0.83860064 0.32279871 0.1613994
[46,] 0.82651283 0.34697434 0.1734872
[47,] 0.87031348 0.25937304 0.1296865
[48,] 0.84462303 0.31075394 0.1553770
[49,] 0.82127178 0.35745644 0.1787282
[50,] 0.79258403 0.41483193 0.2074160
[51,] 0.75996556 0.48006889 0.2400344
[52,] 0.78473995 0.43052009 0.2152600
[53,] 0.74898553 0.50202894 0.2510145
[54,] 0.71353538 0.57292924 0.2864646
[55,] 0.67739878 0.64520244 0.3226012
[56,] 0.65866073 0.68267855 0.3413393
[57,] 0.63938711 0.72122577 0.3606129
[58,] 0.73365318 0.53269365 0.2663468
[59,] 0.69459310 0.61081380 0.3054069
[60,] 0.73206155 0.53587689 0.2679384
[61,] 0.72012934 0.55974133 0.2798707
[62,] 0.69571780 0.60856439 0.3042822
[63,] 0.66448790 0.67102420 0.3355121
[64,] 0.62142545 0.75714909 0.3785745
[65,] 0.59400624 0.81198753 0.4059938
[66,] 0.55057367 0.89885266 0.4494263
[67,] 0.51150856 0.97698288 0.4884914
[68,] 0.46981634 0.93963267 0.5301837
[69,] 0.43710798 0.87421597 0.5628920
[70,] 0.39579882 0.79159764 0.6042012
[71,] 0.35687796 0.71375593 0.6431220
[72,] 0.34818019 0.69636039 0.6518198
[73,] 0.30993408 0.61986816 0.6900659
[74,] 0.39334331 0.78668662 0.6066567
[75,] 0.37243500 0.74486999 0.6275650
[76,] 0.33088389 0.66176778 0.6691161
[77,] 0.31419084 0.62838168 0.6858092
[78,] 0.31107840 0.62215680 0.6889216
[79,] 0.32173742 0.64347485 0.6782626
[80,] 0.28193192 0.56386384 0.7180681
[81,] 0.27887960 0.55775920 0.7211204
[82,] 0.28346427 0.56692854 0.7165357
[83,] 0.33220453 0.66440906 0.6677955
[84,] 0.30734682 0.61469365 0.6926532
[85,] 0.30190847 0.60381693 0.6980915
[86,] 0.26282265 0.52564531 0.7371773
[87,] 0.24554980 0.49109960 0.7544502
[88,] 0.28163835 0.56327670 0.7183617
[89,] 0.25292560 0.50585120 0.7470744
[90,] 0.22792561 0.45585122 0.7720744
[91,] 0.21571034 0.43142068 0.7842897
[92,] 0.19722678 0.39445356 0.8027732
[93,] 0.16611476 0.33222952 0.8338852
[94,] 0.14676806 0.29353612 0.8532319
[95,] 0.12463865 0.24927731 0.8753613
[96,] 0.10767925 0.21535850 0.8923208
[97,] 0.11284501 0.22569003 0.8871550
[98,] 0.09120968 0.18241936 0.9087903
[99,] 0.07429961 0.14859922 0.9257004
[100,] 0.05951208 0.11902415 0.9404879
[101,] 0.04629173 0.09258347 0.9537083
[102,] 0.06049811 0.12099621 0.9395019
[103,] 0.09530943 0.19061886 0.9046906
[104,] 0.15157493 0.30314985 0.8484251
[105,] 0.14169681 0.28339362 0.8583032
[106,] 0.58436580 0.83126839 0.4156342
[107,] 0.72432723 0.55134554 0.2756728
[108,] 0.68648614 0.62702771 0.3135139
[109,] 0.73618525 0.52762949 0.2638147
[110,] 0.69033018 0.61933963 0.3096698
[111,] 0.65094316 0.69811368 0.3490568
[112,] 0.65284862 0.69430276 0.3471514
[113,] 0.72716762 0.54566476 0.2728324
[114,] 0.69716835 0.60566330 0.3028316
[115,] 0.69282443 0.61435114 0.3071756
[116,] 0.63976250 0.72047500 0.3602375
[117,] 0.66655048 0.66689905 0.3334495
[118,] 0.63663606 0.72672788 0.3633639
[119,] 0.57922394 0.84155211 0.4207761
[120,] 0.52223241 0.95553518 0.4777676
[121,] 0.48839032 0.97678064 0.5116097
[122,] 0.45655353 0.91310706 0.5434465
[123,] 0.45456848 0.90913696 0.5454315
[124,] 0.49238466 0.98476931 0.5076153
[125,] 0.42503711 0.85007422 0.5749629
[126,] 0.39906560 0.79813120 0.6009344
[127,] 0.52686396 0.94627207 0.4731360
[128,] 0.46463251 0.92926502 0.5353675
[129,] 0.43737438 0.87474875 0.5626256
[130,] 0.38612328 0.77224656 0.6138767
[131,] 0.33790666 0.67581331 0.6620933
[132,] 0.30444242 0.60888484 0.6955576
[133,] 0.41601710 0.83203419 0.5839829
[134,] 0.54094788 0.91810424 0.4590521
[135,] 0.67276668 0.65446664 0.3272333
[136,] 0.60908688 0.78182624 0.3909131
[137,] 0.50732142 0.98535716 0.4926786
[138,] 0.51306230 0.97387540 0.4869377
[139,] 0.49534768 0.99069537 0.5046523
[140,] 0.36853589 0.73707179 0.6314641
[141,] 0.56233817 0.87532366 0.4376618
[142,] 0.46732018 0.93464036 0.5326798
> postscript(file="/var/www/html/rcomp/tmp/1j39j1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2j39j1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3uuqm1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4uuqm1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5uuqm1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 159
Frequency = 1
1 2 3 4 5 6
-0.179509832 3.531459870 3.688889684 -3.374289281 0.163279338 -3.829829778
7 8 9 10 11 12
2.642566116 1.869200442 -3.974924333 -2.201400197 -4.337419333 -2.301810850
13 14 15 16 17 18
-6.817941543 -1.757530724 1.706580840 1.284141089 1.947908715 -3.228187686
19 20 21 22 23 24
-2.458712608 0.611255295 2.506822831 -1.502161079 -3.561071092 -3.054955906
25 26 27 28 29 30
-3.936138056 -0.964702202 1.426231351 -4.172369425 0.249234568 -0.454082728
31 32 33 34 35 36
1.374763925 1.272970412 7.368912285 8.798916171 1.790524480 7.374723409
37 38 39 40 41 42
7.571035976 -3.789701968 4.071921416 7.132222493 -1.040281401 1.928467339
43 44 45 46 47 48
-6.562718963 1.619679297 4.492644070 -2.501678602 -5.039096962 11.029429696
49 50 51 52 53 54
2.813411299 2.541246876 3.799317616 -1.740141856 -4.388854447 -2.147673637
55 56 57 58 59 60
3.721839917 -0.490007578 2.051598702 1.533654030 -0.659627807 -4.877533012
61 62 63 64 65 66
0.726793812 1.218564129 -0.749276024 2.978112528 -2.569138768 7.140021965
67 68 69 70 71 72
-0.513625477 5.241601206 -2.863739845 2.385221392 -1.879724381 -0.188228368
73 74 75 76 77 78
2.267491506 -0.936620532 0.985778202 -1.305682403 -1.769488996 -1.172685792
79 80 81 82 83 84
-0.923874813 3.212570433 0.979159975 -6.620731787 -2.859551925 0.603070230
85 86 87 88 89 90
-2.859702184 -3.779796205 3.990408083 -0.358058415 3.565931823 -4.213071220
91 92 93 94 95 96
-5.853874598 -2.648853973 -3.776805991 0.301143955 -2.907107283 5.065059650
97 98 99 100 101 102
-2.160738917 -2.374525428 -3.326171226 -2.764392490 0.490246075 -2.459760056
103 104 105 106 107 108
-1.779053727 -2.176407086 -4.222513552 -0.593113550 -0.998225864 -0.300902264
109 110 111 112 113 114
-0.149965083 -5.668060013 -6.558364934 -6.582152135 3.649586344 12.801298315
115 116 117 118 119 120
7.441643270 -1.915024701 4.627007690 0.892395424 -1.286102166 -2.940046930
121 122 123 124 125 126
6.435491112 -1.897705468 4.070557601 -1.070774333 -1.485418214 -2.771570623
127 128 129 130 131 132
0.196435639 0.944768243 -3.279792103 3.724521410 3.511327118 -5.418782409
133 134 135 136 137 138
-0.003598222 -3.023494826 -6.186588701 1.691011016 -1.340706870 3.011915235
139 140 141 142 143 144
-1.945853045 3.213280599 6.156127641 6.275992938 -0.195028554 0.914373656
145 146 147 148 149 150
-0.382751010 5.576396937 2.671430779 0.453898309 -7.987768397 -1.955884402
151 152 153 154 155 156
4.161569633 0.693092643 1.319856121 1.051285528 0.067883755 -2.573176429
157 158 159
2.164974560 -0.610907056 -6.304833377
> postscript(file="/var/www/html/rcomp/tmp/653771293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.179509832 NA
1 3.531459870 -0.179509832
2 3.688889684 3.531459870
3 -3.374289281 3.688889684
4 0.163279338 -3.374289281
5 -3.829829778 0.163279338
6 2.642566116 -3.829829778
7 1.869200442 2.642566116
8 -3.974924333 1.869200442
9 -2.201400197 -3.974924333
10 -4.337419333 -2.201400197
11 -2.301810850 -4.337419333
12 -6.817941543 -2.301810850
13 -1.757530724 -6.817941543
14 1.706580840 -1.757530724
15 1.284141089 1.706580840
16 1.947908715 1.284141089
17 -3.228187686 1.947908715
18 -2.458712608 -3.228187686
19 0.611255295 -2.458712608
20 2.506822831 0.611255295
21 -1.502161079 2.506822831
22 -3.561071092 -1.502161079
23 -3.054955906 -3.561071092
24 -3.936138056 -3.054955906
25 -0.964702202 -3.936138056
26 1.426231351 -0.964702202
27 -4.172369425 1.426231351
28 0.249234568 -4.172369425
29 -0.454082728 0.249234568
30 1.374763925 -0.454082728
31 1.272970412 1.374763925
32 7.368912285 1.272970412
33 8.798916171 7.368912285
34 1.790524480 8.798916171
35 7.374723409 1.790524480
36 7.571035976 7.374723409
37 -3.789701968 7.571035976
38 4.071921416 -3.789701968
39 7.132222493 4.071921416
40 -1.040281401 7.132222493
41 1.928467339 -1.040281401
42 -6.562718963 1.928467339
43 1.619679297 -6.562718963
44 4.492644070 1.619679297
45 -2.501678602 4.492644070
46 -5.039096962 -2.501678602
47 11.029429696 -5.039096962
48 2.813411299 11.029429696
49 2.541246876 2.813411299
50 3.799317616 2.541246876
51 -1.740141856 3.799317616
52 -4.388854447 -1.740141856
53 -2.147673637 -4.388854447
54 3.721839917 -2.147673637
55 -0.490007578 3.721839917
56 2.051598702 -0.490007578
57 1.533654030 2.051598702
58 -0.659627807 1.533654030
59 -4.877533012 -0.659627807
60 0.726793812 -4.877533012
61 1.218564129 0.726793812
62 -0.749276024 1.218564129
63 2.978112528 -0.749276024
64 -2.569138768 2.978112528
65 7.140021965 -2.569138768
66 -0.513625477 7.140021965
67 5.241601206 -0.513625477
68 -2.863739845 5.241601206
69 2.385221392 -2.863739845
70 -1.879724381 2.385221392
71 -0.188228368 -1.879724381
72 2.267491506 -0.188228368
73 -0.936620532 2.267491506
74 0.985778202 -0.936620532
75 -1.305682403 0.985778202
76 -1.769488996 -1.305682403
77 -1.172685792 -1.769488996
78 -0.923874813 -1.172685792
79 3.212570433 -0.923874813
80 0.979159975 3.212570433
81 -6.620731787 0.979159975
82 -2.859551925 -6.620731787
83 0.603070230 -2.859551925
84 -2.859702184 0.603070230
85 -3.779796205 -2.859702184
86 3.990408083 -3.779796205
87 -0.358058415 3.990408083
88 3.565931823 -0.358058415
89 -4.213071220 3.565931823
90 -5.853874598 -4.213071220
91 -2.648853973 -5.853874598
92 -3.776805991 -2.648853973
93 0.301143955 -3.776805991
94 -2.907107283 0.301143955
95 5.065059650 -2.907107283
96 -2.160738917 5.065059650
97 -2.374525428 -2.160738917
98 -3.326171226 -2.374525428
99 -2.764392490 -3.326171226
100 0.490246075 -2.764392490
101 -2.459760056 0.490246075
102 -1.779053727 -2.459760056
103 -2.176407086 -1.779053727
104 -4.222513552 -2.176407086
105 -0.593113550 -4.222513552
106 -0.998225864 -0.593113550
107 -0.300902264 -0.998225864
108 -0.149965083 -0.300902264
109 -5.668060013 -0.149965083
110 -6.558364934 -5.668060013
111 -6.582152135 -6.558364934
112 3.649586344 -6.582152135
113 12.801298315 3.649586344
114 7.441643270 12.801298315
115 -1.915024701 7.441643270
116 4.627007690 -1.915024701
117 0.892395424 4.627007690
118 -1.286102166 0.892395424
119 -2.940046930 -1.286102166
120 6.435491112 -2.940046930
121 -1.897705468 6.435491112
122 4.070557601 -1.897705468
123 -1.070774333 4.070557601
124 -1.485418214 -1.070774333
125 -2.771570623 -1.485418214
126 0.196435639 -2.771570623
127 0.944768243 0.196435639
128 -3.279792103 0.944768243
129 3.724521410 -3.279792103
130 3.511327118 3.724521410
131 -5.418782409 3.511327118
132 -0.003598222 -5.418782409
133 -3.023494826 -0.003598222
134 -6.186588701 -3.023494826
135 1.691011016 -6.186588701
136 -1.340706870 1.691011016
137 3.011915235 -1.340706870
138 -1.945853045 3.011915235
139 3.213280599 -1.945853045
140 6.156127641 3.213280599
141 6.275992938 6.156127641
142 -0.195028554 6.275992938
143 0.914373656 -0.195028554
144 -0.382751010 0.914373656
145 5.576396937 -0.382751010
146 2.671430779 5.576396937
147 0.453898309 2.671430779
148 -7.987768397 0.453898309
149 -1.955884402 -7.987768397
150 4.161569633 -1.955884402
151 0.693092643 4.161569633
152 1.319856121 0.693092643
153 1.051285528 1.319856121
154 0.067883755 1.051285528
155 -2.573176429 0.067883755
156 2.164974560 -2.573176429
157 -0.610907056 2.164974560
158 -6.304833377 -0.610907056
159 NA -6.304833377
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.531459870 -0.179509832
[2,] 3.688889684 3.531459870
[3,] -3.374289281 3.688889684
[4,] 0.163279338 -3.374289281
[5,] -3.829829778 0.163279338
[6,] 2.642566116 -3.829829778
[7,] 1.869200442 2.642566116
[8,] -3.974924333 1.869200442
[9,] -2.201400197 -3.974924333
[10,] -4.337419333 -2.201400197
[11,] -2.301810850 -4.337419333
[12,] -6.817941543 -2.301810850
[13,] -1.757530724 -6.817941543
[14,] 1.706580840 -1.757530724
[15,] 1.284141089 1.706580840
[16,] 1.947908715 1.284141089
[17,] -3.228187686 1.947908715
[18,] -2.458712608 -3.228187686
[19,] 0.611255295 -2.458712608
[20,] 2.506822831 0.611255295
[21,] -1.502161079 2.506822831
[22,] -3.561071092 -1.502161079
[23,] -3.054955906 -3.561071092
[24,] -3.936138056 -3.054955906
[25,] -0.964702202 -3.936138056
[26,] 1.426231351 -0.964702202
[27,] -4.172369425 1.426231351
[28,] 0.249234568 -4.172369425
[29,] -0.454082728 0.249234568
[30,] 1.374763925 -0.454082728
[31,] 1.272970412 1.374763925
[32,] 7.368912285 1.272970412
[33,] 8.798916171 7.368912285
[34,] 1.790524480 8.798916171
[35,] 7.374723409 1.790524480
[36,] 7.571035976 7.374723409
[37,] -3.789701968 7.571035976
[38,] 4.071921416 -3.789701968
[39,] 7.132222493 4.071921416
[40,] -1.040281401 7.132222493
[41,] 1.928467339 -1.040281401
[42,] -6.562718963 1.928467339
[43,] 1.619679297 -6.562718963
[44,] 4.492644070 1.619679297
[45,] -2.501678602 4.492644070
[46,] -5.039096962 -2.501678602
[47,] 11.029429696 -5.039096962
[48,] 2.813411299 11.029429696
[49,] 2.541246876 2.813411299
[50,] 3.799317616 2.541246876
[51,] -1.740141856 3.799317616
[52,] -4.388854447 -1.740141856
[53,] -2.147673637 -4.388854447
[54,] 3.721839917 -2.147673637
[55,] -0.490007578 3.721839917
[56,] 2.051598702 -0.490007578
[57,] 1.533654030 2.051598702
[58,] -0.659627807 1.533654030
[59,] -4.877533012 -0.659627807
[60,] 0.726793812 -4.877533012
[61,] 1.218564129 0.726793812
[62,] -0.749276024 1.218564129
[63,] 2.978112528 -0.749276024
[64,] -2.569138768 2.978112528
[65,] 7.140021965 -2.569138768
[66,] -0.513625477 7.140021965
[67,] 5.241601206 -0.513625477
[68,] -2.863739845 5.241601206
[69,] 2.385221392 -2.863739845
[70,] -1.879724381 2.385221392
[71,] -0.188228368 -1.879724381
[72,] 2.267491506 -0.188228368
[73,] -0.936620532 2.267491506
[74,] 0.985778202 -0.936620532
[75,] -1.305682403 0.985778202
[76,] -1.769488996 -1.305682403
[77,] -1.172685792 -1.769488996
[78,] -0.923874813 -1.172685792
[79,] 3.212570433 -0.923874813
[80,] 0.979159975 3.212570433
[81,] -6.620731787 0.979159975
[82,] -2.859551925 -6.620731787
[83,] 0.603070230 -2.859551925
[84,] -2.859702184 0.603070230
[85,] -3.779796205 -2.859702184
[86,] 3.990408083 -3.779796205
[87,] -0.358058415 3.990408083
[88,] 3.565931823 -0.358058415
[89,] -4.213071220 3.565931823
[90,] -5.853874598 -4.213071220
[91,] -2.648853973 -5.853874598
[92,] -3.776805991 -2.648853973
[93,] 0.301143955 -3.776805991
[94,] -2.907107283 0.301143955
[95,] 5.065059650 -2.907107283
[96,] -2.160738917 5.065059650
[97,] -2.374525428 -2.160738917
[98,] -3.326171226 -2.374525428
[99,] -2.764392490 -3.326171226
[100,] 0.490246075 -2.764392490
[101,] -2.459760056 0.490246075
[102,] -1.779053727 -2.459760056
[103,] -2.176407086 -1.779053727
[104,] -4.222513552 -2.176407086
[105,] -0.593113550 -4.222513552
[106,] -0.998225864 -0.593113550
[107,] -0.300902264 -0.998225864
[108,] -0.149965083 -0.300902264
[109,] -5.668060013 -0.149965083
[110,] -6.558364934 -5.668060013
[111,] -6.582152135 -6.558364934
[112,] 3.649586344 -6.582152135
[113,] 12.801298315 3.649586344
[114,] 7.441643270 12.801298315
[115,] -1.915024701 7.441643270
[116,] 4.627007690 -1.915024701
[117,] 0.892395424 4.627007690
[118,] -1.286102166 0.892395424
[119,] -2.940046930 -1.286102166
[120,] 6.435491112 -2.940046930
[121,] -1.897705468 6.435491112
[122,] 4.070557601 -1.897705468
[123,] -1.070774333 4.070557601
[124,] -1.485418214 -1.070774333
[125,] -2.771570623 -1.485418214
[126,] 0.196435639 -2.771570623
[127,] 0.944768243 0.196435639
[128,] -3.279792103 0.944768243
[129,] 3.724521410 -3.279792103
[130,] 3.511327118 3.724521410
[131,] -5.418782409 3.511327118
[132,] -0.003598222 -5.418782409
[133,] -3.023494826 -0.003598222
[134,] -6.186588701 -3.023494826
[135,] 1.691011016 -6.186588701
[136,] -1.340706870 1.691011016
[137,] 3.011915235 -1.340706870
[138,] -1.945853045 3.011915235
[139,] 3.213280599 -1.945853045
[140,] 6.156127641 3.213280599
[141,] 6.275992938 6.156127641
[142,] -0.195028554 6.275992938
[143,] 0.914373656 -0.195028554
[144,] -0.382751010 0.914373656
[145,] 5.576396937 -0.382751010
[146,] 2.671430779 5.576396937
[147,] 0.453898309 2.671430779
[148,] -7.987768397 0.453898309
[149,] -1.955884402 -7.987768397
[150,] 4.161569633 -1.955884402
[151,] 0.693092643 4.161569633
[152,] 1.319856121 0.693092643
[153,] 1.051285528 1.319856121
[154,] 0.067883755 1.051285528
[155,] -2.573176429 0.067883755
[156,] 2.164974560 -2.573176429
[157,] -0.610907056 2.164974560
[158,] -6.304833377 -0.610907056
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.531459870 -0.179509832
2 3.688889684 3.531459870
3 -3.374289281 3.688889684
4 0.163279338 -3.374289281
5 -3.829829778 0.163279338
6 2.642566116 -3.829829778
7 1.869200442 2.642566116
8 -3.974924333 1.869200442
9 -2.201400197 -3.974924333
10 -4.337419333 -2.201400197
11 -2.301810850 -4.337419333
12 -6.817941543 -2.301810850
13 -1.757530724 -6.817941543
14 1.706580840 -1.757530724
15 1.284141089 1.706580840
16 1.947908715 1.284141089
17 -3.228187686 1.947908715
18 -2.458712608 -3.228187686
19 0.611255295 -2.458712608
20 2.506822831 0.611255295
21 -1.502161079 2.506822831
22 -3.561071092 -1.502161079
23 -3.054955906 -3.561071092
24 -3.936138056 -3.054955906
25 -0.964702202 -3.936138056
26 1.426231351 -0.964702202
27 -4.172369425 1.426231351
28 0.249234568 -4.172369425
29 -0.454082728 0.249234568
30 1.374763925 -0.454082728
31 1.272970412 1.374763925
32 7.368912285 1.272970412
33 8.798916171 7.368912285
34 1.790524480 8.798916171
35 7.374723409 1.790524480
36 7.571035976 7.374723409
37 -3.789701968 7.571035976
38 4.071921416 -3.789701968
39 7.132222493 4.071921416
40 -1.040281401 7.132222493
41 1.928467339 -1.040281401
42 -6.562718963 1.928467339
43 1.619679297 -6.562718963
44 4.492644070 1.619679297
45 -2.501678602 4.492644070
46 -5.039096962 -2.501678602
47 11.029429696 -5.039096962
48 2.813411299 11.029429696
49 2.541246876 2.813411299
50 3.799317616 2.541246876
51 -1.740141856 3.799317616
52 -4.388854447 -1.740141856
53 -2.147673637 -4.388854447
54 3.721839917 -2.147673637
55 -0.490007578 3.721839917
56 2.051598702 -0.490007578
57 1.533654030 2.051598702
58 -0.659627807 1.533654030
59 -4.877533012 -0.659627807
60 0.726793812 -4.877533012
61 1.218564129 0.726793812
62 -0.749276024 1.218564129
63 2.978112528 -0.749276024
64 -2.569138768 2.978112528
65 7.140021965 -2.569138768
66 -0.513625477 7.140021965
67 5.241601206 -0.513625477
68 -2.863739845 5.241601206
69 2.385221392 -2.863739845
70 -1.879724381 2.385221392
71 -0.188228368 -1.879724381
72 2.267491506 -0.188228368
73 -0.936620532 2.267491506
74 0.985778202 -0.936620532
75 -1.305682403 0.985778202
76 -1.769488996 -1.305682403
77 -1.172685792 -1.769488996
78 -0.923874813 -1.172685792
79 3.212570433 -0.923874813
80 0.979159975 3.212570433
81 -6.620731787 0.979159975
82 -2.859551925 -6.620731787
83 0.603070230 -2.859551925
84 -2.859702184 0.603070230
85 -3.779796205 -2.859702184
86 3.990408083 -3.779796205
87 -0.358058415 3.990408083
88 3.565931823 -0.358058415
89 -4.213071220 3.565931823
90 -5.853874598 -4.213071220
91 -2.648853973 -5.853874598
92 -3.776805991 -2.648853973
93 0.301143955 -3.776805991
94 -2.907107283 0.301143955
95 5.065059650 -2.907107283
96 -2.160738917 5.065059650
97 -2.374525428 -2.160738917
98 -3.326171226 -2.374525428
99 -2.764392490 -3.326171226
100 0.490246075 -2.764392490
101 -2.459760056 0.490246075
102 -1.779053727 -2.459760056
103 -2.176407086 -1.779053727
104 -4.222513552 -2.176407086
105 -0.593113550 -4.222513552
106 -0.998225864 -0.593113550
107 -0.300902264 -0.998225864
108 -0.149965083 -0.300902264
109 -5.668060013 -0.149965083
110 -6.558364934 -5.668060013
111 -6.582152135 -6.558364934
112 3.649586344 -6.582152135
113 12.801298315 3.649586344
114 7.441643270 12.801298315
115 -1.915024701 7.441643270
116 4.627007690 -1.915024701
117 0.892395424 4.627007690
118 -1.286102166 0.892395424
119 -2.940046930 -1.286102166
120 6.435491112 -2.940046930
121 -1.897705468 6.435491112
122 4.070557601 -1.897705468
123 -1.070774333 4.070557601
124 -1.485418214 -1.070774333
125 -2.771570623 -1.485418214
126 0.196435639 -2.771570623
127 0.944768243 0.196435639
128 -3.279792103 0.944768243
129 3.724521410 -3.279792103
130 3.511327118 3.724521410
131 -5.418782409 3.511327118
132 -0.003598222 -5.418782409
133 -3.023494826 -0.003598222
134 -6.186588701 -3.023494826
135 1.691011016 -6.186588701
136 -1.340706870 1.691011016
137 3.011915235 -1.340706870
138 -1.945853045 3.011915235
139 3.213280599 -1.945853045
140 6.156127641 3.213280599
141 6.275992938 6.156127641
142 -0.195028554 6.275992938
143 0.914373656 -0.195028554
144 -0.382751010 0.914373656
145 5.576396937 -0.382751010
146 2.671430779 5.576396937
147 0.453898309 2.671430779
148 -7.987768397 0.453898309
149 -1.955884402 -7.987768397
150 4.161569633 -1.955884402
151 0.693092643 4.161569633
152 1.319856121 0.693092643
153 1.051285528 1.319856121
154 0.067883755 1.051285528
155 -2.573176429 0.067883755
156 2.164974560 -2.573176429
157 -0.610907056 2.164974560
158 -6.304833377 -0.610907056
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7xd7s1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8xd7s1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9xd7s1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10q4ov1293535830.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11un4j1293535830.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12f5lp1293535830.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13tx1f1293535830.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14exz31293535830.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15igyr1293535830.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16lgwx1293535830.tab")
+ }
>
> try(system("convert tmp/1j39j1293535830.ps tmp/1j39j1293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/2j39j1293535830.ps tmp/2j39j1293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/3uuqm1293535830.ps tmp/3uuqm1293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/4uuqm1293535830.ps tmp/4uuqm1293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/5uuqm1293535830.ps tmp/5uuqm1293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/653771293535830.ps tmp/653771293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/7xd7s1293535830.ps tmp/7xd7s1293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/8xd7s1293535830.ps tmp/8xd7s1293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/9xd7s1293535830.ps tmp/9xd7s1293535830.png",intern=TRUE))
character(0)
> try(system("convert tmp/10q4ov1293535830.ps tmp/10q4ov1293535830.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.106 1.845 12.282