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(13
+ ,26
+ ,9
+ ,15
+ ,6
+ ,25
+ ,25
+ ,16
+ ,20
+ ,9
+ ,15
+ ,6
+ ,25
+ ,24
+ ,19
+ ,21
+ ,9
+ ,14
+ ,13
+ ,19
+ ,21
+ ,15
+ ,31
+ ,14
+ ,10
+ ,8
+ ,18
+ ,23
+ ,14
+ ,21
+ ,8
+ ,10
+ ,7
+ ,18
+ ,17
+ ,13
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,19
+ ,26
+ ,11
+ ,18
+ ,5
+ ,29
+ ,18
+ ,15
+ ,22
+ ,10
+ ,12
+ ,8
+ ,26
+ ,27
+ ,14
+ ,22
+ ,9
+ ,14
+ ,9
+ ,25
+ ,23
+ ,15
+ ,29
+ ,15
+ ,18
+ ,11
+ ,23
+ ,23
+ ,16
+ ,15
+ ,14
+ ,9
+ ,8
+ ,23
+ ,29
+ ,16
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,16
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,17
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,15
+ ,19
+ ,20
+ ,8
+ ,7
+ ,19
+ ,25
+ ,15
+ ,22
+ ,9
+ ,16
+ ,9
+ ,24
+ ,23
+ ,20
+ ,31
+ ,10
+ ,21
+ ,12
+ ,32
+ ,26
+ ,18
+ ,28
+ ,8
+ ,24
+ ,20
+ ,30
+ ,20
+ ,16
+ ,38
+ ,11
+ ,21
+ ,7
+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8
+ ,23
+ ,22
+ ,16
+ ,21
+ ,12
+ ,14
+ ,9
+ ,22
+ ,24
+ ,14
+ ,27
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,10
+ ,22
+ ,13
+ ,12
+ ,13
+ ,22
+ ,15
+ ,17
+ ,9
+ ,6
+ ,8
+ ,11
+ ,29
+ ,23
+ ,13
+ ,29
+ ,11
+ ,7
+ ,4
+ ,26
+ ,22
+ ,15
+ ,20
+ ,7
+ ,11
+ ,9
+ ,26
+ ,22
+ ,16
+ ,16
+ ,8
+ ,13
+ ,5
+ ,21
+ ,24
+ ,12
+ ,16
+ ,8
+ ,9
+ ,4
+ ,18
+ ,23
+ ,13
+ ,16
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13)
+ ,dim=c(7
+ ,150)
+ ,dimnames=list(c('Learning'
+ ,'Concern'
+ ,'Doubts'
+ ,'Expectations'
+ ,'Criticism'
+ ,'Standards'
+ ,'Organization')
+ ,1:150))
> y <- array(NA,dim=c(7,150),dimnames=list(c('Learning','Concern','Doubts','Expectations','Criticism','Standards','Organization'),1:150))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Learning Concern Doubts Expectations Criticism Standards Organization
1 13 26 9 15 6 25 25
2 16 20 9 15 6 25 24
3 19 21 9 14 13 19 21
4 15 31 14 10 8 18 23
5 14 21 8 10 7 18 17
6 13 18 8 12 9 22 19
7 19 26 11 18 5 29 18
8 15 22 10 12 8 26 27
9 14 22 9 14 9 25 23
10 15 29 15 18 11 23 23
11 16 15 14 9 8 23 29
12 16 16 11 11 11 23 21
13 16 24 14 11 12 24 26
14 17 17 6 17 8 30 25
15 15 19 20 8 7 19 25
16 15 22 9 16 9 24 23
17 20 31 10 21 12 32 26
18 18 28 8 24 20 30 20
19 16 38 11 21 7 29 29
20 16 26 14 14 8 17 24
21 19 25 11 7 8 25 23
22 16 25 16 18 16 26 24
23 17 29 14 18 10 26 30
24 17 28 11 13 6 25 22
25 16 15 11 11 8 23 22
26 15 18 12 13 9 21 13
27 14 21 9 13 9 19 24
28 15 25 7 18 11 35 17
29 12 23 13 14 12 19 24
30 14 23 10 12 8 20 21
31 16 19 9 9 7 21 23
32 14 18 9 12 8 21 24
33 7 18 13 8 9 24 24
34 10 26 16 5 4 23 24
35 14 18 12 10 8 19 23
36 16 18 6 11 8 17 26
37 16 28 14 11 8 24 24
38 16 17 14 12 6 15 21
39 14 29 10 12 8 25 23
40 20 12 4 15 4 27 28
41 14 25 12 12 7 29 23
42 14 28 12 16 14 27 22
43 11 20 14 14 10 18 24
44 15 17 9 17 9 25 21
45 16 17 9 13 6 22 23
46 14 20 10 10 8 26 23
47 16 31 14 17 11 23 20
48 14 21 10 12 8 16 23
49 12 19 9 13 8 27 21
50 16 23 14 13 10 25 27
51 9 15 8 11 8 14 12
52 14 24 9 13 10 19 15
53 16 28 8 12 7 20 22
54 16 16 9 12 8 16 21
55 15 19 9 12 7 18 21
56 16 21 9 9 9 22 20
57 12 21 15 7 5 21 24
58 16 20 8 17 7 22 24
59 16 16 10 12 7 22 29
60 14 25 8 12 7 32 25
61 16 30 14 9 9 23 14
62 17 29 11 9 5 31 30
63 18 22 10 13 8 18 19
64 18 19 12 10 8 23 29
65 12 33 14 11 8 26 25
66 16 17 9 12 9 24 25
67 10 9 13 10 6 19 25
68 14 14 15 13 8 14 16
69 18 15 8 6 6 20 25
70 18 12 7 7 4 22 28
71 16 21 10 13 6 24 24
72 16 20 10 11 4 25 25
73 16 29 13 18 12 21 21
74 13 33 11 9 6 28 22
75 16 21 8 9 11 24 20
76 16 15 12 11 8 20 25
77 20 19 9 11 10 21 27
78 16 23 10 15 10 23 21
79 15 20 11 8 4 13 13
80 15 20 11 11 8 24 26
81 16 18 10 14 9 21 26
82 14 31 16 14 9 21 25
83 15 18 16 12 7 17 22
84 12 13 8 12 7 14 19
85 17 9 6 8 11 29 23
86 16 20 11 11 8 25 25
87 15 18 12 10 8 16 15
88 13 23 14 17 7 25 21
89 16 17 9 16 5 25 23
90 16 17 11 13 7 21 25
91 16 16 8 15 9 23 24
92 16 31 8 11 8 22 24
93 14 15 7 12 6 19 21
94 16 28 16 16 8 24 24
95 16 26 13 20 10 26 22
96 20 20 8 16 10 25 24
97 15 19 11 11 8 20 28
98 16 25 14 15 11 22 21
99 13 18 10 15 8 14 17
100 17 20 10 12 8 20 28
101 16 33 14 9 6 32 24
102 12 24 14 24 20 21 10
103 16 22 10 15 6 22 20
104 16 32 12 18 12 28 22
105 17 31 9 17 9 25 19
106 13 13 16 12 5 17 22
107 12 18 8 15 10 21 22
108 18 17 9 11 5 23 26
109 14 29 16 11 6 27 24
110 14 22 13 15 10 22 22
111 13 18 13 12 6 19 20
112 16 22 8 14 10 20 20
113 13 25 14 11 5 17 15
114 16 20 11 20 13 24 20
115 13 20 9 11 7 21 20
116 16 17 8 12 9 21 24
117 15 21 13 17 11 23 22
118 16 26 13 12 8 24 29
119 15 10 10 11 5 19 23
120 17 15 8 10 4 22 24
121 15 20 7 11 9 26 22
122 12 14 11 12 7 17 16
123 16 16 11 9 5 17 23
124 10 23 14 8 5 19 27
125 16 11 6 6 4 15 16
126 14 19 10 12 7 17 21
127 15 30 9 15 9 27 26
128 13 21 12 13 8 19 22
129 15 20 11 17 8 21 23
130 11 22 14 14 11 25 19
131 12 30 12 16 10 19 18
132 8 25 14 15 9 22 24
133 16 28 8 16 12 18 24
134 15 23 14 11 10 20 29
135 17 23 8 11 10 15 22
136 16 21 11 16 7 20 24
137 10 30 12 15 10 29 22
138 18 22 9 14 6 19 12
139 13 32 16 9 6 29 26
140 15 22 11 13 11 24 18
141 16 15 11 11 8 23 22
142 16 21 12 14 9 22 24
143 14 27 15 11 9 23 21
144 10 22 13 12 13 22 15
145 17 9 6 8 11 29 23
146 13 29 11 7 4 26 22
147 15 20 7 11 9 26 22
148 16 16 8 13 5 21 24
149 12 16 8 9 4 18 23
150 13 16 9 12 9 10 13
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Concern Doubts Expectations Criticism
12.325616 0.006185 -0.278785 0.103633 0.008670
Standards Organization
0.027180 0.157966
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.1633 -1.1053 0.1497 1.3253 4.4789
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 12.325616 1.462481 8.428 3.43e-14 ***
Concern 0.006185 0.037772 0.164 0.87017
Doubts -0.278785 0.069179 -4.030 9.03e-05 ***
Expectations 0.103633 0.062960 1.646 0.10196
Criticism 0.008670 0.079066 0.110 0.91283
Standards 0.027180 0.049093 0.554 0.58069
Organization 0.157966 0.049734 3.176 0.00183 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.066 on 143 degrees of freedom
Multiple R-squared: 0.2072, Adjusted R-squared: 0.174
F-statistic: 6.23 on 6 and 143 DF, p-value: 7.82e-06
> 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.92916237 0.14167525 0.07083763
[2,] 0.87587095 0.24825811 0.12412905
[3,] 0.79967379 0.40065242 0.20032621
[4,] 0.70821724 0.58356552 0.29178276
[5,] 0.62904737 0.74190525 0.37095263
[6,] 0.54886434 0.90227132 0.45113566
[7,] 0.46461161 0.92922322 0.53538839
[8,] 0.44945728 0.89891456 0.55054272
[9,] 0.45454300 0.90908600 0.54545700
[10,] 0.36987399 0.73974798 0.63012601
[11,] 0.31656004 0.63312008 0.68343996
[12,] 0.46031512 0.92063023 0.53968488
[13,] 0.44377572 0.88755144 0.55622428
[14,] 0.38509652 0.77019305 0.61490348
[15,] 0.32686104 0.65372207 0.67313896
[16,] 0.26943345 0.53886689 0.73056655
[17,] 0.22973448 0.45946896 0.77026552
[18,] 0.18408338 0.36816676 0.81591662
[19,] 0.26561983 0.53123967 0.73438017
[20,] 0.36404281 0.72808562 0.63595719
[21,] 0.31463927 0.62927854 0.68536073
[22,] 0.27260253 0.54520506 0.72739747
[23,] 0.23264867 0.46529734 0.76735133
[24,] 0.92204214 0.15591572 0.07795786
[25,] 0.95190467 0.09619066 0.04809533
[26,] 0.93564395 0.12871211 0.06435605
[27,] 0.92131793 0.15736413 0.07868207
[28,] 0.90958768 0.18082464 0.09041232
[29,] 0.90369399 0.19261201 0.09630601
[30,] 0.88555045 0.22889909 0.11444955
[31,] 0.90363979 0.19272042 0.09636021
[32,] 0.88226655 0.23546689 0.11773345
[33,] 0.86398357 0.27203286 0.13601643
[34,] 0.92026208 0.15947584 0.07973792
[35,] 0.90533201 0.18933597 0.09466799
[36,] 0.88183947 0.23632105 0.11816053
[37,] 0.85832113 0.28335773 0.14167887
[38,] 0.83995631 0.32008738 0.16004369
[39,] 0.81360073 0.37279854 0.18639927
[40,] 0.85969521 0.28060959 0.14030479
[41,] 0.83703636 0.32592729 0.16296364
[42,] 0.92551654 0.14896692 0.07448346
[43,] 0.90706086 0.18587828 0.09293914
[44,] 0.88873847 0.22252306 0.11126153
[45,] 0.87334287 0.25331426 0.12665713
[46,] 0.84604971 0.30790058 0.15395029
[47,] 0.83617751 0.32764498 0.16382249
[48,] 0.81815811 0.36368378 0.18184189
[49,] 0.78457545 0.43084909 0.21542455
[50,] 0.74650479 0.50699043 0.25349521
[51,] 0.74768973 0.50462054 0.25231027
[52,] 0.80804694 0.38390613 0.19195306
[53,] 0.78501609 0.42996781 0.21498391
[54,] 0.83809998 0.32380005 0.16190002
[55,] 0.86127623 0.27744754 0.13872377
[56,] 0.87424047 0.25151906 0.12575953
[57,] 0.84826786 0.30346428 0.15173214
[58,] 0.92192779 0.15614442 0.07807221
[59,] 0.91060686 0.17878629 0.08939314
[60,] 0.92904363 0.14191275 0.07095637
[61,] 0.92758719 0.14482562 0.07241281
[62,] 0.91014053 0.17971895 0.08985947
[63,] 0.89005339 0.21989322 0.10994661
[64,] 0.87719330 0.24561339 0.12280670
[65,] 0.86805420 0.26389161 0.13194580
[66,] 0.84731564 0.30536873 0.15268436
[67,] 0.82822318 0.34355363 0.17177682
[68,] 0.90519289 0.18961423 0.09480711
[69,] 0.88635764 0.22728472 0.11364236
[70,] 0.89170253 0.21659494 0.10829747
[71,] 0.86758542 0.26482917 0.13241458
[72,] 0.84000274 0.31999453 0.15999726
[73,] 0.81302999 0.37394001 0.18697001
[74,] 0.81425290 0.37149420 0.18574710
[75,] 0.84318411 0.31363179 0.15681589
[76,] 0.81854951 0.36290099 0.18145049
[77,] 0.79090305 0.41819390 0.20909695
[78,] 0.79894194 0.40211612 0.20105806
[79,] 0.78252310 0.43495379 0.21747690
[80,] 0.74989209 0.50021581 0.25010791
[81,] 0.71376096 0.57247808 0.28623904
[82,] 0.67172291 0.65655417 0.32827709
[83,] 0.62671510 0.74656979 0.37328490
[84,] 0.61845754 0.76308492 0.38154246
[85,] 0.62100672 0.75798655 0.37899328
[86,] 0.57802797 0.84394405 0.42197203
[87,] 0.66516200 0.66967601 0.33483800
[88,] 0.61902895 0.76194210 0.38097105
[89,] 0.64826816 0.70346368 0.35173184
[90,] 0.61868524 0.76262951 0.38131476
[91,] 0.59820774 0.80358452 0.40179226
[92,] 0.61111675 0.77776649 0.38888325
[93,] 0.57777196 0.84445608 0.42222804
[94,] 0.53239737 0.93520525 0.46760263
[95,] 0.51112139 0.97775721 0.48887861
[96,] 0.50397991 0.99204019 0.49602009
[97,] 0.45017114 0.90034227 0.54982886
[98,] 0.58660369 0.82679262 0.41339631
[99,] 0.59000615 0.81998771 0.40999385
[100,] 0.58644988 0.82710023 0.41355012
[101,] 0.53551944 0.92896112 0.46448056
[102,] 0.48143838 0.96287676 0.51856162
[103,] 0.42951657 0.85903314 0.57048343
[104,] 0.39781760 0.79563519 0.60218240
[105,] 0.36025719 0.72051437 0.63974281
[106,] 0.34379479 0.68758958 0.65620521
[107,] 0.29025869 0.58051738 0.70974131
[108,] 0.26478682 0.52957363 0.73521318
[109,] 0.26751933 0.53503866 0.73248067
[110,] 0.21900938 0.43801877 0.78099062
[111,] 0.18792434 0.37584869 0.81207566
[112,] 0.15440735 0.30881470 0.84559265
[113,] 0.14053714 0.28107428 0.85946286
[114,] 0.13110620 0.26221239 0.86889380
[115,] 0.17743381 0.35486762 0.82256619
[116,] 0.14286271 0.28572543 0.85713729
[117,] 0.11046370 0.22092740 0.88953630
[118,] 0.08326754 0.16653507 0.91673246
[119,] 0.06299011 0.12598022 0.93700989
[120,] 0.04431208 0.08862416 0.95568792
[121,] 0.03631640 0.07263279 0.96368360
[122,] 0.02690943 0.05381887 0.97309057
[123,] 0.19617354 0.39234708 0.80382646
[124,] 0.14283935 0.28567871 0.85716065
[125,] 0.10327202 0.20654403 0.89672798
[126,] 0.31528380 0.63056759 0.68471620
[127,] 0.24258855 0.48517710 0.75741145
[128,] 0.58448193 0.83103615 0.41551807
[129,] 0.57540536 0.84918928 0.42459464
[130,] 0.43855980 0.87711961 0.56144020
[131,] 0.31320890 0.62641779 0.68679110
> postscript(file="/var/www/html/rcomp/tmp/1v3gg1292371182.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/2v3gg1292371182.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/36cyj1292371182.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/46cyj1292371182.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/56cyj1292371182.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 = 150
Frequency = 1
1 2 3 4 5 6
-3.21251175 -0.01743734 3.65629533 1.15750535 -0.49689394 -2.12759783
7 8 9 10 11 12
4.03986969 -0.95854183 -1.79422013 0.45768669 1.27640002 1.46430772
13 14 15 16 17 18
1.42550629 -0.35371155 2.77725863 -0.97430515 3.01330377 1.09618016
19 20 21 22 23 24
-1.10020840 1.64311348 4.47889476 1.47835250 1.00027201 2.01385118
25 26 27 28 29 30
1.33853832 1.85888436 -1.67928698 -1.12622500 -2.70615968 -0.85385166
31 32 33 34 35 36
0.86855921 -1.60278994 -7.16332965 -2.99502191 -0.34684294 -0.54272334
37 38 39 40 41 42
1.75138019 2.45164013 -1.34279278 1.96923295 -0.86053353 -1.14198566
43 44 45 46 47 48
-3.36429888 -0.75826278 0.44788857 -1.10704456 1.74406130 -1.04869238
49 50 51 52 53 54
-3.40179187 1.05662096 -4.67353931 -0.28482139 0.40835874 1.01937760
55 56 57 58 59 60
-0.04486678 1.28556527 -1.40445841 -0.43061763 -0.11997289 -2.37314635
61 62 63 64 65 66
3.54444166 1.00406115 3.41899218 2.59045773 -2.49186986 0.15521812
67 68 69 70 71 72
-4.31098478 1.44501446 2.64533051 1.77055073 0.48960855 0.53525371
73 74 75 76 77 78
1.26173741 -1.68408300 0.93507865 1.22496740 4.00342012 0.73636887
79 80 81 82 83 84
2.34668676 -0.35142833 0.14412837 -0.10559702 1.78202928 -2.86189111
85 86 87 88 89 90
0.94556046 0.77935706 1.99842258 -1.38410446 0.06412051 0.70803757
91 92 93 94 95 96
-0.24313435 0.11447483 -1.59620780 1.79078755 0.79650080 3.56546292
97 98 99 100 101 102
-0.55245385 1.85764996 -1.33888176 1.05894349 1.72762060 -1.38209117
103 104 105 106 107 108
0.96238138 0.61617062 1.47108124 -0.16970578 -3.89388276 2.16274724
109 110 111 112 113 114
0.23856614 -0.55187601 -0.78408518 0.52812210 0.40789802 0.62031937
115 116 117 118 119 120
-1.87099401 0.11593916 0.21119285 0.59150390 0.06744378 1.35174613
121 122 123 124 125 126
-0.89773775 -1.63936405 1.57074590 -4.21878224 1.68743176 -0.73890132
127 128 129 130 131 132
-1.47558841 -1.51832960 -0.41778657 -2.78577247 -2.27036917 -6.59890592
133 134 135 136 137 138
-0.31109487 0.08385610 1.65280506 0.55754634 -5.07040120 4.13249430
139 140 141 142 143 144
-0.94301468 0.66665028 1.33853832 0.97189543 0.52875680 -3.16123031
145 146 147 148 149 150
0.94556046 -1.38037717 -0.89773775 0.05317322 -3.28411955 -0.56248669
> postscript(file="/var/www/html/rcomp/tmp/6ymxm1292371182.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 = 150
Frequency = 1
lag(myerror, k = 1) myerror
0 -3.21251175 NA
1 -0.01743734 -3.21251175
2 3.65629533 -0.01743734
3 1.15750535 3.65629533
4 -0.49689394 1.15750535
5 -2.12759783 -0.49689394
6 4.03986969 -2.12759783
7 -0.95854183 4.03986969
8 -1.79422013 -0.95854183
9 0.45768669 -1.79422013
10 1.27640002 0.45768669
11 1.46430772 1.27640002
12 1.42550629 1.46430772
13 -0.35371155 1.42550629
14 2.77725863 -0.35371155
15 -0.97430515 2.77725863
16 3.01330377 -0.97430515
17 1.09618016 3.01330377
18 -1.10020840 1.09618016
19 1.64311348 -1.10020840
20 4.47889476 1.64311348
21 1.47835250 4.47889476
22 1.00027201 1.47835250
23 2.01385118 1.00027201
24 1.33853832 2.01385118
25 1.85888436 1.33853832
26 -1.67928698 1.85888436
27 -1.12622500 -1.67928698
28 -2.70615968 -1.12622500
29 -0.85385166 -2.70615968
30 0.86855921 -0.85385166
31 -1.60278994 0.86855921
32 -7.16332965 -1.60278994
33 -2.99502191 -7.16332965
34 -0.34684294 -2.99502191
35 -0.54272334 -0.34684294
36 1.75138019 -0.54272334
37 2.45164013 1.75138019
38 -1.34279278 2.45164013
39 1.96923295 -1.34279278
40 -0.86053353 1.96923295
41 -1.14198566 -0.86053353
42 -3.36429888 -1.14198566
43 -0.75826278 -3.36429888
44 0.44788857 -0.75826278
45 -1.10704456 0.44788857
46 1.74406130 -1.10704456
47 -1.04869238 1.74406130
48 -3.40179187 -1.04869238
49 1.05662096 -3.40179187
50 -4.67353931 1.05662096
51 -0.28482139 -4.67353931
52 0.40835874 -0.28482139
53 1.01937760 0.40835874
54 -0.04486678 1.01937760
55 1.28556527 -0.04486678
56 -1.40445841 1.28556527
57 -0.43061763 -1.40445841
58 -0.11997289 -0.43061763
59 -2.37314635 -0.11997289
60 3.54444166 -2.37314635
61 1.00406115 3.54444166
62 3.41899218 1.00406115
63 2.59045773 3.41899218
64 -2.49186986 2.59045773
65 0.15521812 -2.49186986
66 -4.31098478 0.15521812
67 1.44501446 -4.31098478
68 2.64533051 1.44501446
69 1.77055073 2.64533051
70 0.48960855 1.77055073
71 0.53525371 0.48960855
72 1.26173741 0.53525371
73 -1.68408300 1.26173741
74 0.93507865 -1.68408300
75 1.22496740 0.93507865
76 4.00342012 1.22496740
77 0.73636887 4.00342012
78 2.34668676 0.73636887
79 -0.35142833 2.34668676
80 0.14412837 -0.35142833
81 -0.10559702 0.14412837
82 1.78202928 -0.10559702
83 -2.86189111 1.78202928
84 0.94556046 -2.86189111
85 0.77935706 0.94556046
86 1.99842258 0.77935706
87 -1.38410446 1.99842258
88 0.06412051 -1.38410446
89 0.70803757 0.06412051
90 -0.24313435 0.70803757
91 0.11447483 -0.24313435
92 -1.59620780 0.11447483
93 1.79078755 -1.59620780
94 0.79650080 1.79078755
95 3.56546292 0.79650080
96 -0.55245385 3.56546292
97 1.85764996 -0.55245385
98 -1.33888176 1.85764996
99 1.05894349 -1.33888176
100 1.72762060 1.05894349
101 -1.38209117 1.72762060
102 0.96238138 -1.38209117
103 0.61617062 0.96238138
104 1.47108124 0.61617062
105 -0.16970578 1.47108124
106 -3.89388276 -0.16970578
107 2.16274724 -3.89388276
108 0.23856614 2.16274724
109 -0.55187601 0.23856614
110 -0.78408518 -0.55187601
111 0.52812210 -0.78408518
112 0.40789802 0.52812210
113 0.62031937 0.40789802
114 -1.87099401 0.62031937
115 0.11593916 -1.87099401
116 0.21119285 0.11593916
117 0.59150390 0.21119285
118 0.06744378 0.59150390
119 1.35174613 0.06744378
120 -0.89773775 1.35174613
121 -1.63936405 -0.89773775
122 1.57074590 -1.63936405
123 -4.21878224 1.57074590
124 1.68743176 -4.21878224
125 -0.73890132 1.68743176
126 -1.47558841 -0.73890132
127 -1.51832960 -1.47558841
128 -0.41778657 -1.51832960
129 -2.78577247 -0.41778657
130 -2.27036917 -2.78577247
131 -6.59890592 -2.27036917
132 -0.31109487 -6.59890592
133 0.08385610 -0.31109487
134 1.65280506 0.08385610
135 0.55754634 1.65280506
136 -5.07040120 0.55754634
137 4.13249430 -5.07040120
138 -0.94301468 4.13249430
139 0.66665028 -0.94301468
140 1.33853832 0.66665028
141 0.97189543 1.33853832
142 0.52875680 0.97189543
143 -3.16123031 0.52875680
144 0.94556046 -3.16123031
145 -1.38037717 0.94556046
146 -0.89773775 -1.38037717
147 0.05317322 -0.89773775
148 -3.28411955 0.05317322
149 -0.56248669 -3.28411955
150 NA -0.56248669
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.01743734 -3.21251175
[2,] 3.65629533 -0.01743734
[3,] 1.15750535 3.65629533
[4,] -0.49689394 1.15750535
[5,] -2.12759783 -0.49689394
[6,] 4.03986969 -2.12759783
[7,] -0.95854183 4.03986969
[8,] -1.79422013 -0.95854183
[9,] 0.45768669 -1.79422013
[10,] 1.27640002 0.45768669
[11,] 1.46430772 1.27640002
[12,] 1.42550629 1.46430772
[13,] -0.35371155 1.42550629
[14,] 2.77725863 -0.35371155
[15,] -0.97430515 2.77725863
[16,] 3.01330377 -0.97430515
[17,] 1.09618016 3.01330377
[18,] -1.10020840 1.09618016
[19,] 1.64311348 -1.10020840
[20,] 4.47889476 1.64311348
[21,] 1.47835250 4.47889476
[22,] 1.00027201 1.47835250
[23,] 2.01385118 1.00027201
[24,] 1.33853832 2.01385118
[25,] 1.85888436 1.33853832
[26,] -1.67928698 1.85888436
[27,] -1.12622500 -1.67928698
[28,] -2.70615968 -1.12622500
[29,] -0.85385166 -2.70615968
[30,] 0.86855921 -0.85385166
[31,] -1.60278994 0.86855921
[32,] -7.16332965 -1.60278994
[33,] -2.99502191 -7.16332965
[34,] -0.34684294 -2.99502191
[35,] -0.54272334 -0.34684294
[36,] 1.75138019 -0.54272334
[37,] 2.45164013 1.75138019
[38,] -1.34279278 2.45164013
[39,] 1.96923295 -1.34279278
[40,] -0.86053353 1.96923295
[41,] -1.14198566 -0.86053353
[42,] -3.36429888 -1.14198566
[43,] -0.75826278 -3.36429888
[44,] 0.44788857 -0.75826278
[45,] -1.10704456 0.44788857
[46,] 1.74406130 -1.10704456
[47,] -1.04869238 1.74406130
[48,] -3.40179187 -1.04869238
[49,] 1.05662096 -3.40179187
[50,] -4.67353931 1.05662096
[51,] -0.28482139 -4.67353931
[52,] 0.40835874 -0.28482139
[53,] 1.01937760 0.40835874
[54,] -0.04486678 1.01937760
[55,] 1.28556527 -0.04486678
[56,] -1.40445841 1.28556527
[57,] -0.43061763 -1.40445841
[58,] -0.11997289 -0.43061763
[59,] -2.37314635 -0.11997289
[60,] 3.54444166 -2.37314635
[61,] 1.00406115 3.54444166
[62,] 3.41899218 1.00406115
[63,] 2.59045773 3.41899218
[64,] -2.49186986 2.59045773
[65,] 0.15521812 -2.49186986
[66,] -4.31098478 0.15521812
[67,] 1.44501446 -4.31098478
[68,] 2.64533051 1.44501446
[69,] 1.77055073 2.64533051
[70,] 0.48960855 1.77055073
[71,] 0.53525371 0.48960855
[72,] 1.26173741 0.53525371
[73,] -1.68408300 1.26173741
[74,] 0.93507865 -1.68408300
[75,] 1.22496740 0.93507865
[76,] 4.00342012 1.22496740
[77,] 0.73636887 4.00342012
[78,] 2.34668676 0.73636887
[79,] -0.35142833 2.34668676
[80,] 0.14412837 -0.35142833
[81,] -0.10559702 0.14412837
[82,] 1.78202928 -0.10559702
[83,] -2.86189111 1.78202928
[84,] 0.94556046 -2.86189111
[85,] 0.77935706 0.94556046
[86,] 1.99842258 0.77935706
[87,] -1.38410446 1.99842258
[88,] 0.06412051 -1.38410446
[89,] 0.70803757 0.06412051
[90,] -0.24313435 0.70803757
[91,] 0.11447483 -0.24313435
[92,] -1.59620780 0.11447483
[93,] 1.79078755 -1.59620780
[94,] 0.79650080 1.79078755
[95,] 3.56546292 0.79650080
[96,] -0.55245385 3.56546292
[97,] 1.85764996 -0.55245385
[98,] -1.33888176 1.85764996
[99,] 1.05894349 -1.33888176
[100,] 1.72762060 1.05894349
[101,] -1.38209117 1.72762060
[102,] 0.96238138 -1.38209117
[103,] 0.61617062 0.96238138
[104,] 1.47108124 0.61617062
[105,] -0.16970578 1.47108124
[106,] -3.89388276 -0.16970578
[107,] 2.16274724 -3.89388276
[108,] 0.23856614 2.16274724
[109,] -0.55187601 0.23856614
[110,] -0.78408518 -0.55187601
[111,] 0.52812210 -0.78408518
[112,] 0.40789802 0.52812210
[113,] 0.62031937 0.40789802
[114,] -1.87099401 0.62031937
[115,] 0.11593916 -1.87099401
[116,] 0.21119285 0.11593916
[117,] 0.59150390 0.21119285
[118,] 0.06744378 0.59150390
[119,] 1.35174613 0.06744378
[120,] -0.89773775 1.35174613
[121,] -1.63936405 -0.89773775
[122,] 1.57074590 -1.63936405
[123,] -4.21878224 1.57074590
[124,] 1.68743176 -4.21878224
[125,] -0.73890132 1.68743176
[126,] -1.47558841 -0.73890132
[127,] -1.51832960 -1.47558841
[128,] -0.41778657 -1.51832960
[129,] -2.78577247 -0.41778657
[130,] -2.27036917 -2.78577247
[131,] -6.59890592 -2.27036917
[132,] -0.31109487 -6.59890592
[133,] 0.08385610 -0.31109487
[134,] 1.65280506 0.08385610
[135,] 0.55754634 1.65280506
[136,] -5.07040120 0.55754634
[137,] 4.13249430 -5.07040120
[138,] -0.94301468 4.13249430
[139,] 0.66665028 -0.94301468
[140,] 1.33853832 0.66665028
[141,] 0.97189543 1.33853832
[142,] 0.52875680 0.97189543
[143,] -3.16123031 0.52875680
[144,] 0.94556046 -3.16123031
[145,] -1.38037717 0.94556046
[146,] -0.89773775 -1.38037717
[147,] 0.05317322 -0.89773775
[148,] -3.28411955 0.05317322
[149,] -0.56248669 -3.28411955
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.01743734 -3.21251175
2 3.65629533 -0.01743734
3 1.15750535 3.65629533
4 -0.49689394 1.15750535
5 -2.12759783 -0.49689394
6 4.03986969 -2.12759783
7 -0.95854183 4.03986969
8 -1.79422013 -0.95854183
9 0.45768669 -1.79422013
10 1.27640002 0.45768669
11 1.46430772 1.27640002
12 1.42550629 1.46430772
13 -0.35371155 1.42550629
14 2.77725863 -0.35371155
15 -0.97430515 2.77725863
16 3.01330377 -0.97430515
17 1.09618016 3.01330377
18 -1.10020840 1.09618016
19 1.64311348 -1.10020840
20 4.47889476 1.64311348
21 1.47835250 4.47889476
22 1.00027201 1.47835250
23 2.01385118 1.00027201
24 1.33853832 2.01385118
25 1.85888436 1.33853832
26 -1.67928698 1.85888436
27 -1.12622500 -1.67928698
28 -2.70615968 -1.12622500
29 -0.85385166 -2.70615968
30 0.86855921 -0.85385166
31 -1.60278994 0.86855921
32 -7.16332965 -1.60278994
33 -2.99502191 -7.16332965
34 -0.34684294 -2.99502191
35 -0.54272334 -0.34684294
36 1.75138019 -0.54272334
37 2.45164013 1.75138019
38 -1.34279278 2.45164013
39 1.96923295 -1.34279278
40 -0.86053353 1.96923295
41 -1.14198566 -0.86053353
42 -3.36429888 -1.14198566
43 -0.75826278 -3.36429888
44 0.44788857 -0.75826278
45 -1.10704456 0.44788857
46 1.74406130 -1.10704456
47 -1.04869238 1.74406130
48 -3.40179187 -1.04869238
49 1.05662096 -3.40179187
50 -4.67353931 1.05662096
51 -0.28482139 -4.67353931
52 0.40835874 -0.28482139
53 1.01937760 0.40835874
54 -0.04486678 1.01937760
55 1.28556527 -0.04486678
56 -1.40445841 1.28556527
57 -0.43061763 -1.40445841
58 -0.11997289 -0.43061763
59 -2.37314635 -0.11997289
60 3.54444166 -2.37314635
61 1.00406115 3.54444166
62 3.41899218 1.00406115
63 2.59045773 3.41899218
64 -2.49186986 2.59045773
65 0.15521812 -2.49186986
66 -4.31098478 0.15521812
67 1.44501446 -4.31098478
68 2.64533051 1.44501446
69 1.77055073 2.64533051
70 0.48960855 1.77055073
71 0.53525371 0.48960855
72 1.26173741 0.53525371
73 -1.68408300 1.26173741
74 0.93507865 -1.68408300
75 1.22496740 0.93507865
76 4.00342012 1.22496740
77 0.73636887 4.00342012
78 2.34668676 0.73636887
79 -0.35142833 2.34668676
80 0.14412837 -0.35142833
81 -0.10559702 0.14412837
82 1.78202928 -0.10559702
83 -2.86189111 1.78202928
84 0.94556046 -2.86189111
85 0.77935706 0.94556046
86 1.99842258 0.77935706
87 -1.38410446 1.99842258
88 0.06412051 -1.38410446
89 0.70803757 0.06412051
90 -0.24313435 0.70803757
91 0.11447483 -0.24313435
92 -1.59620780 0.11447483
93 1.79078755 -1.59620780
94 0.79650080 1.79078755
95 3.56546292 0.79650080
96 -0.55245385 3.56546292
97 1.85764996 -0.55245385
98 -1.33888176 1.85764996
99 1.05894349 -1.33888176
100 1.72762060 1.05894349
101 -1.38209117 1.72762060
102 0.96238138 -1.38209117
103 0.61617062 0.96238138
104 1.47108124 0.61617062
105 -0.16970578 1.47108124
106 -3.89388276 -0.16970578
107 2.16274724 -3.89388276
108 0.23856614 2.16274724
109 -0.55187601 0.23856614
110 -0.78408518 -0.55187601
111 0.52812210 -0.78408518
112 0.40789802 0.52812210
113 0.62031937 0.40789802
114 -1.87099401 0.62031937
115 0.11593916 -1.87099401
116 0.21119285 0.11593916
117 0.59150390 0.21119285
118 0.06744378 0.59150390
119 1.35174613 0.06744378
120 -0.89773775 1.35174613
121 -1.63936405 -0.89773775
122 1.57074590 -1.63936405
123 -4.21878224 1.57074590
124 1.68743176 -4.21878224
125 -0.73890132 1.68743176
126 -1.47558841 -0.73890132
127 -1.51832960 -1.47558841
128 -0.41778657 -1.51832960
129 -2.78577247 -0.41778657
130 -2.27036917 -2.78577247
131 -6.59890592 -2.27036917
132 -0.31109487 -6.59890592
133 0.08385610 -0.31109487
134 1.65280506 0.08385610
135 0.55754634 1.65280506
136 -5.07040120 0.55754634
137 4.13249430 -5.07040120
138 -0.94301468 4.13249430
139 0.66665028 -0.94301468
140 1.33853832 0.66665028
141 0.97189543 1.33853832
142 0.52875680 0.97189543
143 -3.16123031 0.52875680
144 0.94556046 -3.16123031
145 -1.38037717 0.94556046
146 -0.89773775 -1.38037717
147 0.05317322 -0.89773775
148 -3.28411955 0.05317322
149 -0.56248669 -3.28411955
> 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/7rvep1292371182.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/8rvep1292371182.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/9rvep1292371182.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/10k4da1292371182.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/11gxft1292371183.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/121fdh1292371183.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/13fpb71292371183.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/14ip9v1292371183.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/15m8qj1292371183.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/16pr6p1292371183.tab")
+ }
>
> try(system("convert tmp/1v3gg1292371182.ps tmp/1v3gg1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/2v3gg1292371182.ps tmp/2v3gg1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/36cyj1292371182.ps tmp/36cyj1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/46cyj1292371182.ps tmp/46cyj1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/56cyj1292371182.ps tmp/56cyj1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ymxm1292371182.ps tmp/6ymxm1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/7rvep1292371182.ps tmp/7rvep1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/8rvep1292371182.ps tmp/8rvep1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/9rvep1292371182.ps tmp/9rvep1292371182.png",intern=TRUE))
character(0)
> try(system("convert tmp/10k4da1292371182.ps tmp/10k4da1292371182.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.944 1.836 9.595