R version 2.11.1 (2010-05-31)
Copyright (C) 2010 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(14
+ ,26
+ ,9
+ ,15
+ ,6
+ ,25
+ ,25
+ ,11
+ ,18
+ ,20
+ ,9
+ ,15
+ ,6
+ ,25
+ ,24
+ ,12
+ ,11
+ ,21
+ ,9
+ ,14
+ ,13
+ ,19
+ ,21
+ ,15
+ ,12
+ ,31
+ ,14
+ ,10
+ ,8
+ ,18
+ ,23
+ ,10
+ ,16
+ ,21
+ ,8
+ ,10
+ ,7
+ ,18
+ ,17
+ ,12
+ ,18
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,11
+ ,14
+ ,26
+ ,11
+ ,18
+ ,5
+ ,29
+ ,18
+ ,5
+ ,14
+ ,22
+ ,10
+ ,12
+ ,8
+ ,26
+ ,27
+ ,16
+ ,15
+ ,22
+ ,9
+ ,14
+ ,9
+ ,25
+ ,23
+ ,11
+ ,15
+ ,29
+ ,15
+ ,18
+ ,11
+ ,23
+ ,23
+ ,15
+ ,17
+ ,15
+ ,14
+ ,9
+ ,8
+ ,23
+ ,29
+ ,12
+ ,19
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,9
+ ,10
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,11
+ ,18
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,15
+ ,14
+ ,19
+ ,20
+ ,8
+ ,7
+ ,19
+ ,25
+ ,12
+ ,14
+ ,22
+ ,9
+ ,16
+ ,9
+ ,24
+ ,23
+ ,16
+ ,17
+ ,31
+ ,10
+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,13
+ ,5
+ ,21
+ ,24
+ ,12)
+ ,dim=c(8
+ ,145)
+ ,dimnames=list(c('Happines'
+ ,'Concern_over_Mistakes'
+ ,'Doubts_about_actions'
+ ,'Parental_Expectations'
+ ,'Parental_Criticism'
+ ,'Personal_Standards'
+ ,'Organization'
+ ,'Popularity')
+ ,1:145))
> y <- array(NA,dim=c(8,145),dimnames=list(c('Happines','Concern_over_Mistakes','Doubts_about_actions','Parental_Expectations','Parental_Criticism','Personal_Standards','Organization','Popularity'),1:145))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Happines Concern_over_Mistakes Doubts_about_actions Parental_Expectations
1 14 26 9 15
2 18 20 9 15
3 11 21 9 14
4 12 31 14 10
5 16 21 8 10
6 18 18 8 12
7 14 26 11 18
8 14 22 10 12
9 15 22 9 14
10 15 29 15 18
11 17 15 14 9
12 19 16 11 11
13 10 24 14 11
14 18 17 6 17
15 14 19 20 8
16 14 22 9 16
17 17 31 10 21
18 14 28 8 24
19 16 38 11 21
20 18 26 14 14
21 14 25 11 7
22 12 25 16 18
23 17 29 14 18
24 9 28 11 13
25 16 15 11 11
26 14 18 12 13
27 11 21 9 13
28 16 25 7 18
29 13 23 13 14
30 17 23 10 12
31 15 19 9 9
32 14 18 9 12
33 16 18 13 8
34 9 26 16 5
35 15 18 12 10
36 17 18 6 11
37 13 28 14 11
38 15 17 14 12
39 16 29 10 12
40 16 12 4 15
41 12 28 12 16
42 11 20 14 14
43 15 17 9 17
44 17 17 9 13
45 13 20 10 10
46 16 31 14 17
47 14 21 10 12
48 11 19 9 13
49 12 23 14 13
50 12 15 8 11
51 15 24 9 13
52 16 28 8 12
53 15 16 9 12
54 12 19 9 12
55 12 21 9 9
56 8 21 15 7
57 13 20 8 17
58 11 16 10 12
59 14 25 8 12
60 15 30 14 9
61 10 29 11 9
62 11 22 10 13
63 12 19 12 10
64 15 33 14 11
65 15 17 9 12
66 14 9 13 10
67 16 14 15 13
68 15 15 8 6
69 15 12 7 7
70 13 21 10 13
71 17 20 10 11
72 13 29 13 18
73 15 33 11 9
74 13 21 8 9
75 15 15 12 11
76 16 19 9 11
77 15 23 10 15
78 16 20 11 8
79 15 20 11 11
80 14 18 10 14
81 15 31 16 14
82 7 18 16 12
83 17 13 8 12
84 13 9 6 8
85 15 20 11 11
86 14 18 12 10
87 13 23 14 17
88 16 17 9 16
89 12 17 11 13
90 14 16 8 15
91 17 31 8 11
92 15 15 7 12
93 17 28 16 16
94 12 26 13 20
95 16 20 8 16
96 11 19 11 11
97 15 25 14 15
98 9 18 10 15
99 16 20 10 12
100 10 33 14 9
101 10 24 14 24
102 15 22 10 15
103 11 32 12 18
104 13 31 9 17
105 14 13 16 12
106 18 18 8 15
107 16 17 9 11
108 14 29 16 11
109 14 22 13 15
110 14 18 13 12
111 14 22 8 14
112 12 25 14 11
113 14 20 11 20
114 15 20 9 11
115 15 17 8 12
116 13 26 13 12
117 17 10 10 11
118 17 15 8 10
119 19 20 7 11
120 15 14 11 12
121 13 16 11 9
122 9 23 14 8
123 15 11 6 6
124 15 19 10 12
125 16 30 9 15
126 11 21 12 13
127 14 20 11 17
128 11 22 14 14
129 15 30 12 16
130 13 25 14 15
131 16 23 14 11
132 14 23 8 11
133 15 21 11 16
134 16 30 12 15
135 16 22 9 14
136 11 32 16 9
137 13 22 11 13
138 16 15 11 11
139 12 21 12 14
140 9 27 15 11
141 13 22 13 12
142 13 9 6 8
143 14 29 11 7
144 19 20 7 11
145 13 16 8 13
Parental_Criticism Personal_Standards Organization Popularity
1 6 25 25 11
2 6 25 24 12
3 13 19 21 15
4 8 18 23 10
5 7 18 17 12
6 9 22 19 11
7 5 29 18 5
8 8 26 27 16
9 9 25 23 11
10 11 23 23 15
11 8 23 29 12
12 11 23 21 9
13 12 24 26 11
14 8 30 25 15
15 7 19 25 12
16 9 24 23 16
17 12 32 26 14
18 20 30 20 11
19 7 29 29 10
20 8 17 24 7
21 8 25 23 11
22 16 26 24 10
23 10 26 30 11
24 6 25 22 16
25 8 23 22 14
26 9 21 13 12
27 9 19 24 12
28 11 35 17 11
29 12 19 24 6
30 8 20 21 14
31 7 21 23 9
32 8 21 24 15
33 9 24 24 12
34 4 23 24 12
35 8 19 23 9
36 8 17 26 13
37 8 24 24 15
38 6 15 21 11
39 8 25 23 10
40 4 27 28 13
41 14 27 22 16
42 10 18 24 13
43 9 25 21 14
44 6 22 23 14
45 8 26 23 16
46 11 23 20 9
47 8 16 23 8
48 8 27 21 8
49 10 25 27 12
50 8 14 12 10
51 10 19 15 16
52 7 20 22 13
53 8 16 21 11
54 7 18 21 14
55 9 22 20 15
56 5 21 24 8
57 7 22 24 9
58 7 22 29 17
59 7 32 25 9
60 9 23 14 13
61 5 31 30 6
62 8 18 19 13
63 8 23 29 8
64 8 26 25 12
65 9 24 25 13
66 6 19 25 14
67 8 14 16 11
68 6 20 25 15
69 4 22 28 7
70 6 24 24 16
71 4 25 25 16
72 12 21 21 14
73 6 28 22 11
74 11 24 20 13
75 8 20 25 13
76 10 21 27 7
77 10 23 21 15
78 4 13 13 11
79 8 24 26 15
80 9 21 26 13
81 9 21 25 11
82 7 17 22 12
83 7 14 19 10
84 11 29 23 12
85 8 25 25 12
86 8 16 15 12
87 7 25 21 14
88 5 25 23 6
89 7 21 25 14
90 9 23 24 15
91 8 22 24 8
92 6 19 21 12
93 8 24 24 10
94 10 26 22 15
95 10 25 24 11
96 8 20 28 9
97 11 22 21 14
98 8 14 17 10
99 8 20 28 16
100 6 32 24 5
101 20 21 10 8
102 6 22 20 13
103 12 28 22 16
104 9 25 19 16
105 5 17 22 14
106 10 21 22 14
107 5 23 26 10
108 6 27 24 9
109 10 22 22 14
110 6 19 20 8
111 10 20 20 8
112 5 17 15 16
113 13 24 20 12
114 7 21 20 9
115 9 21 24 15
116 8 24 29 12
117 5 19 23 14
118 4 22 24 12
119 9 26 22 16
120 7 17 16 12
121 5 17 23 14
122 5 19 27 8
123 4 15 16 15
124 7 17 21 16
125 9 27 26 12
126 8 19 22 4
127 8 21 23 8
128 11 25 19 11
129 10 19 18 4
130 9 22 24 14
131 10 20 29 14
132 10 15 22 13
133 7 20 24 14
134 10 29 22 7
135 6 19 12 19
136 6 29 26 12
137 11 24 18 10
138 8 23 22 14
139 9 22 24 16
140 9 23 21 11
141 13 22 15 16
142 11 29 23 12
143 4 26 22 12
144 9 26 22 16
145 5 21 24 12
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Concern_over_Mistakes Doubts_about_actions
15.920986 -0.013924 -0.281152
Parental_Expectations Parental_Criticism Personal_Standards
0.110618 -0.109305 -0.003641
Organization Popularity
0.029138 0.038808
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.7790 -1.3222 0.2064 1.5832 5.5026
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 15.920986 1.884379 8.449 3.83e-14 ***
Concern_over_Mistakes -0.013924 0.042239 -0.330 0.74217
Doubts_about_actions -0.281152 0.077754 -3.616 0.00042 ***
Parental_Expectations 0.110618 0.068768 1.609 0.11001
Parental_Criticism -0.109305 0.087307 -1.252 0.21272
Personal_Standards -0.003641 0.056468 -0.064 0.94868
Organization 0.029138 0.055070 0.529 0.59759
Popularity 0.038808 0.063735 0.609 0.54360
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.247 on 137 degrees of freedom
Multiple R-squared: 0.1491, Adjusted R-squared: 0.1056
F-statistic: 3.428 on 7 and 137 DF, p-value: 0.002075
> 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.6876606 0.62467879 0.31233940
[2,] 0.7366706 0.52665885 0.26332943
[3,] 0.7155601 0.56887982 0.28443991
[4,] 0.6255183 0.74896341 0.37448171
[5,] 0.6991894 0.60162116 0.30081058
[6,] 0.6367801 0.72643983 0.36321991
[7,] 0.8000139 0.39997224 0.19998612
[8,] 0.7297678 0.54046450 0.27023225
[9,] 0.7303213 0.53935747 0.26967873
[10,] 0.7312239 0.53755225 0.26877612
[11,] 0.7091395 0.58172108 0.29086054
[12,] 0.6770108 0.64597831 0.32298916
[13,] 0.6548068 0.69038647 0.34519323
[14,] 0.7501491 0.49970185 0.24985093
[15,] 0.7004357 0.59912869 0.29956435
[16,] 0.6430347 0.71393053 0.35696526
[17,] 0.8498655 0.30026896 0.15013448
[18,] 0.8193244 0.36135126 0.18067563
[19,] 0.8200797 0.35984053 0.17992026
[20,] 0.8584400 0.28312004 0.14156002
[21,] 0.8235426 0.35291480 0.17645740
[22,] 0.7925732 0.41485367 0.20742683
[23,] 0.7900144 0.41997124 0.20998562
[24,] 0.8251460 0.34970799 0.17485399
[25,] 0.7943219 0.41135611 0.20567806
[26,] 0.7580787 0.48384253 0.24192127
[27,] 0.7223343 0.55533131 0.27766565
[28,] 0.6873080 0.62538399 0.31269200
[29,] 0.6921262 0.61574753 0.30787376
[30,] 0.7419030 0.51619392 0.25809696
[31,] 0.7018563 0.59628743 0.29814371
[32,] 0.7364019 0.52719619 0.26359809
[33,] 0.6937062 0.61258754 0.30629377
[34,] 0.6703708 0.65925840 0.32962920
[35,] 0.6290161 0.74196784 0.37098392
[36,] 0.6543142 0.69137161 0.34568580
[37,] 0.6209940 0.75801201 0.37900601
[38,] 0.7665602 0.46687966 0.23343983
[39,] 0.7486147 0.50277060 0.25138530
[40,] 0.7606673 0.47866538 0.23933269
[41,] 0.7445066 0.51098688 0.25549344
[42,] 0.7216509 0.55669820 0.27834910
[43,] 0.6778738 0.64425249 0.32212624
[44,] 0.6996808 0.60063841 0.30031921
[45,] 0.6868960 0.62620794 0.31310397
[46,] 0.8348722 0.33025565 0.16512783
[47,] 0.8533806 0.29323882 0.14661941
[48,] 0.8989227 0.20215468 0.10107734
[49,] 0.8779176 0.24416485 0.12208243
[50,] 0.8885322 0.22293557 0.11146778
[51,] 0.9226759 0.15464816 0.07732408
[52,] 0.9432097 0.11358069 0.05679035
[53,] 0.9345381 0.13092387 0.06546193
[54,] 0.9329198 0.13416049 0.06708025
[55,] 0.9159378 0.16812430 0.08406215
[56,] 0.8954726 0.20905489 0.10452745
[57,] 0.9164576 0.16708480 0.08354240
[58,] 0.9003731 0.19925378 0.09962689
[59,] 0.8781582 0.24368359 0.12184179
[60,] 0.8729666 0.25406683 0.12703341
[61,] 0.8697729 0.26045424 0.13022712
[62,] 0.8449308 0.31013841 0.15506920
[63,] 0.8254241 0.34915170 0.17457585
[64,] 0.8014543 0.39709142 0.19854571
[65,] 0.7775483 0.44490346 0.22245173
[66,] 0.7663960 0.46720808 0.23360404
[67,] 0.7278126 0.54437477 0.27218739
[68,] 0.7276186 0.54476276 0.27238138
[69,] 0.6911877 0.61762454 0.30881227
[70,] 0.6491118 0.70177640 0.35088820
[71,] 0.6650327 0.66993453 0.33496727
[72,] 0.8583120 0.28337606 0.14168803
[73,] 0.8564814 0.28703730 0.14351865
[74,] 0.8520955 0.29580897 0.14790448
[75,] 0.8260094 0.34798117 0.17399059
[76,] 0.8006646 0.39867081 0.19933541
[77,] 0.7698515 0.46029692 0.23014846
[78,] 0.7330394 0.53392115 0.26696058
[79,] 0.7447189 0.51056221 0.25528111
[80,] 0.7291576 0.54168474 0.27084237
[81,] 0.7510957 0.49780868 0.24890434
[82,] 0.7103032 0.57939363 0.28969681
[83,] 0.8350698 0.32986046 0.16493023
[84,] 0.8418695 0.31626105 0.15813052
[85,] 0.8092164 0.38156719 0.19078359
[86,] 0.8323063 0.33538741 0.16769371
[87,] 0.8320680 0.33586401 0.16793200
[88,] 0.9462320 0.10753603 0.05376802
[89,] 0.9339225 0.13215495 0.06607747
[90,] 0.9349540 0.13009197 0.06504598
[91,] 0.9305494 0.13890119 0.06945060
[92,] 0.9092773 0.18144540 0.09072270
[93,] 0.9373119 0.12537624 0.06268812
[94,] 0.9587184 0.08256312 0.04128156
[95,] 0.9563256 0.08734880 0.04367440
[96,] 0.9569701 0.08605987 0.04302993
[97,] 0.9438641 0.11227179 0.05613589
[98,] 0.9463292 0.10734170 0.05367085
[99,] 0.9274627 0.14507462 0.07253731
[100,] 0.9242031 0.15159374 0.07579687
[101,] 0.9050195 0.18996092 0.09498046
[102,] 0.8784447 0.24311061 0.12155530
[103,] 0.8544394 0.29112117 0.14556058
[104,] 0.8171910 0.36561795 0.18280897
[105,] 0.7802065 0.43958691 0.21979346
[106,] 0.7274471 0.54510581 0.27255290
[107,] 0.7767148 0.44657032 0.22328516
[108,] 0.7824604 0.43507914 0.21753957
[109,] 0.8029172 0.39416551 0.19708276
[110,] 0.8203851 0.35922990 0.17961495
[111,] 0.7708400 0.45832004 0.22916002
[112,] 0.7562499 0.48750026 0.24375013
[113,] 0.7028498 0.59430032 0.29715016
[114,] 0.6327065 0.73458708 0.36729354
[115,] 0.6130791 0.77384180 0.38692090
[116,] 0.5338876 0.93222481 0.46611241
[117,] 0.4416431 0.88328616 0.55835692
[118,] 0.3680691 0.73613822 0.63193089
[119,] 0.3583252 0.71665045 0.64167478
[120,] 0.2770942 0.55418832 0.72290584
[121,] 0.4538948 0.90778952 0.54610524
[122,] 0.3476452 0.69529035 0.65235483
[123,] 0.2499687 0.49993731 0.75003134
[124,] 0.1960676 0.39213519 0.80393240
> postscript(file="/var/www/rcomp/tmp/1m5cn1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/2wxbq1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/3wxbq1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/4wxbq1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/5pobt1290529095.ps",horizontal=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 = 145
Frequency = 1
1 2 3 4 5 6
-1.09634675 2.81043959 -3.35074206 -0.77767040 1.38408393 3.33478333
7 8 9 10 11 12
-0.52382379 -0.56910058 0.34476675 1.74276708 3.87592922 5.50260228
13 14 15 16 17 18
-2.65290982 1.79522896 2.72183635 -1.07415247 2.12647079 -0.65105100
19 20 21 22 23 24
1.01546067 4.79388247 0.61386600 -0.30942408 3.31450230 -5.39158607
25 26 27 28 29 30
1.93758438 0.48115032 -3.64833236 0.81161016 -0.04573036 2.67541890
31 32 33 34 35 36
0.70052841 -0.79793280 3.00580235 -3.25766181 1.52146477 1.47400532
37 38 39 40 41 42
-0.13139179 1.59609224 1.87412582 -1.07339841 -1.56056654 -2.30025891
43 44 45 46 47 48
-0.11485685 1.93050223 -1.25916044 2.92034396 -0.19241999 -3.51370867
49 50 51 52 53 54
-1.17098521 -2.49203227 0.60975135 1.08309961 0.39865948 -2.77801614
55 56 57 58 59 60
-2.19480868 -4.57241446 -2.47714324 -3.87359766 -0.84715721 2.59235076
61 62 63 64 65 66
-3.86766601 -3.35932204 -1.58606478 2.03279701 0.35685083 0.20637519
67 68 69 70 71 72
3.08551199 0.29146471 -0.13035220 -1.83212201 2.13108432 -0.62043070
73 74 75 76 77 78
1.32547175 -1.17245168 1.15920751 1.76827205 0.53428936 2.24409095
79 80 81 82 83 84
0.85548559 -0.60937158 2.36530518 -5.77903831 2.05623212 -1.82162259
85 86 87 88 89 90
1.00468937 0.62721853 -0.84416349 0.81073185 -2.45980552 -1.32220014
91 92 93 94 95 96
2.48784277 -0.42406294 4.07186165 -2.15178877 0.89469746 -2.99842944
97 98 99 100 101 102
1.83121723 -5.47611900 1.35206632 -2.64193320 -2.64480303 0.18625847
103 104 105 106 107 108
-2.94107656 -1.93926363 0.85511585 2.90475389 1.11389484 1.46999938
109 110 111 112 113 114
0.36985080 0.48899164 -0.64144851 -1.30313544 -0.30230324 0.58062889
115 116 117 118 119 120
0.01629630 -0.58027413 2.21519514 1.78322625 3.92520788 0.93433275
121 122 123 124 125 126
-1.20615541 -4.03103302 -0.30111110 0.42187815 1.22660024 -2.54543974
127 128 129 130 131 132
-0.46007735 -1.91431191 1.58318112 -0.47480614 2.89615316 -0.56619264
133 134 135 136 137 138
0.28953137 2.49723624 1.00505383 -1.43441006 -0.58284488 1.93758438
139 140 141 142 143 144
-2.05980380 -3.51585355 0.15596895 -1.82162259 0.22631223 3.92520788
145
-2.42904124
> postscript(file="/var/www/rcomp/tmp/6pobt1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 145
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.09634675 NA
1 2.81043959 -1.09634675
2 -3.35074206 2.81043959
3 -0.77767040 -3.35074206
4 1.38408393 -0.77767040
5 3.33478333 1.38408393
6 -0.52382379 3.33478333
7 -0.56910058 -0.52382379
8 0.34476675 -0.56910058
9 1.74276708 0.34476675
10 3.87592922 1.74276708
11 5.50260228 3.87592922
12 -2.65290982 5.50260228
13 1.79522896 -2.65290982
14 2.72183635 1.79522896
15 -1.07415247 2.72183635
16 2.12647079 -1.07415247
17 -0.65105100 2.12647079
18 1.01546067 -0.65105100
19 4.79388247 1.01546067
20 0.61386600 4.79388247
21 -0.30942408 0.61386600
22 3.31450230 -0.30942408
23 -5.39158607 3.31450230
24 1.93758438 -5.39158607
25 0.48115032 1.93758438
26 -3.64833236 0.48115032
27 0.81161016 -3.64833236
28 -0.04573036 0.81161016
29 2.67541890 -0.04573036
30 0.70052841 2.67541890
31 -0.79793280 0.70052841
32 3.00580235 -0.79793280
33 -3.25766181 3.00580235
34 1.52146477 -3.25766181
35 1.47400532 1.52146477
36 -0.13139179 1.47400532
37 1.59609224 -0.13139179
38 1.87412582 1.59609224
39 -1.07339841 1.87412582
40 -1.56056654 -1.07339841
41 -2.30025891 -1.56056654
42 -0.11485685 -2.30025891
43 1.93050223 -0.11485685
44 -1.25916044 1.93050223
45 2.92034396 -1.25916044
46 -0.19241999 2.92034396
47 -3.51370867 -0.19241999
48 -1.17098521 -3.51370867
49 -2.49203227 -1.17098521
50 0.60975135 -2.49203227
51 1.08309961 0.60975135
52 0.39865948 1.08309961
53 -2.77801614 0.39865948
54 -2.19480868 -2.77801614
55 -4.57241446 -2.19480868
56 -2.47714324 -4.57241446
57 -3.87359766 -2.47714324
58 -0.84715721 -3.87359766
59 2.59235076 -0.84715721
60 -3.86766601 2.59235076
61 -3.35932204 -3.86766601
62 -1.58606478 -3.35932204
63 2.03279701 -1.58606478
64 0.35685083 2.03279701
65 0.20637519 0.35685083
66 3.08551199 0.20637519
67 0.29146471 3.08551199
68 -0.13035220 0.29146471
69 -1.83212201 -0.13035220
70 2.13108432 -1.83212201
71 -0.62043070 2.13108432
72 1.32547175 -0.62043070
73 -1.17245168 1.32547175
74 1.15920751 -1.17245168
75 1.76827205 1.15920751
76 0.53428936 1.76827205
77 2.24409095 0.53428936
78 0.85548559 2.24409095
79 -0.60937158 0.85548559
80 2.36530518 -0.60937158
81 -5.77903831 2.36530518
82 2.05623212 -5.77903831
83 -1.82162259 2.05623212
84 1.00468937 -1.82162259
85 0.62721853 1.00468937
86 -0.84416349 0.62721853
87 0.81073185 -0.84416349
88 -2.45980552 0.81073185
89 -1.32220014 -2.45980552
90 2.48784277 -1.32220014
91 -0.42406294 2.48784277
92 4.07186165 -0.42406294
93 -2.15178877 4.07186165
94 0.89469746 -2.15178877
95 -2.99842944 0.89469746
96 1.83121723 -2.99842944
97 -5.47611900 1.83121723
98 1.35206632 -5.47611900
99 -2.64193320 1.35206632
100 -2.64480303 -2.64193320
101 0.18625847 -2.64480303
102 -2.94107656 0.18625847
103 -1.93926363 -2.94107656
104 0.85511585 -1.93926363
105 2.90475389 0.85511585
106 1.11389484 2.90475389
107 1.46999938 1.11389484
108 0.36985080 1.46999938
109 0.48899164 0.36985080
110 -0.64144851 0.48899164
111 -1.30313544 -0.64144851
112 -0.30230324 -1.30313544
113 0.58062889 -0.30230324
114 0.01629630 0.58062889
115 -0.58027413 0.01629630
116 2.21519514 -0.58027413
117 1.78322625 2.21519514
118 3.92520788 1.78322625
119 0.93433275 3.92520788
120 -1.20615541 0.93433275
121 -4.03103302 -1.20615541
122 -0.30111110 -4.03103302
123 0.42187815 -0.30111110
124 1.22660024 0.42187815
125 -2.54543974 1.22660024
126 -0.46007735 -2.54543974
127 -1.91431191 -0.46007735
128 1.58318112 -1.91431191
129 -0.47480614 1.58318112
130 2.89615316 -0.47480614
131 -0.56619264 2.89615316
132 0.28953137 -0.56619264
133 2.49723624 0.28953137
134 1.00505383 2.49723624
135 -1.43441006 1.00505383
136 -0.58284488 -1.43441006
137 1.93758438 -0.58284488
138 -2.05980380 1.93758438
139 -3.51585355 -2.05980380
140 0.15596895 -3.51585355
141 -1.82162259 0.15596895
142 0.22631223 -1.82162259
143 3.92520788 0.22631223
144 -2.42904124 3.92520788
145 NA -2.42904124
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.81043959 -1.09634675
[2,] -3.35074206 2.81043959
[3,] -0.77767040 -3.35074206
[4,] 1.38408393 -0.77767040
[5,] 3.33478333 1.38408393
[6,] -0.52382379 3.33478333
[7,] -0.56910058 -0.52382379
[8,] 0.34476675 -0.56910058
[9,] 1.74276708 0.34476675
[10,] 3.87592922 1.74276708
[11,] 5.50260228 3.87592922
[12,] -2.65290982 5.50260228
[13,] 1.79522896 -2.65290982
[14,] 2.72183635 1.79522896
[15,] -1.07415247 2.72183635
[16,] 2.12647079 -1.07415247
[17,] -0.65105100 2.12647079
[18,] 1.01546067 -0.65105100
[19,] 4.79388247 1.01546067
[20,] 0.61386600 4.79388247
[21,] -0.30942408 0.61386600
[22,] 3.31450230 -0.30942408
[23,] -5.39158607 3.31450230
[24,] 1.93758438 -5.39158607
[25,] 0.48115032 1.93758438
[26,] -3.64833236 0.48115032
[27,] 0.81161016 -3.64833236
[28,] -0.04573036 0.81161016
[29,] 2.67541890 -0.04573036
[30,] 0.70052841 2.67541890
[31,] -0.79793280 0.70052841
[32,] 3.00580235 -0.79793280
[33,] -3.25766181 3.00580235
[34,] 1.52146477 -3.25766181
[35,] 1.47400532 1.52146477
[36,] -0.13139179 1.47400532
[37,] 1.59609224 -0.13139179
[38,] 1.87412582 1.59609224
[39,] -1.07339841 1.87412582
[40,] -1.56056654 -1.07339841
[41,] -2.30025891 -1.56056654
[42,] -0.11485685 -2.30025891
[43,] 1.93050223 -0.11485685
[44,] -1.25916044 1.93050223
[45,] 2.92034396 -1.25916044
[46,] -0.19241999 2.92034396
[47,] -3.51370867 -0.19241999
[48,] -1.17098521 -3.51370867
[49,] -2.49203227 -1.17098521
[50,] 0.60975135 -2.49203227
[51,] 1.08309961 0.60975135
[52,] 0.39865948 1.08309961
[53,] -2.77801614 0.39865948
[54,] -2.19480868 -2.77801614
[55,] -4.57241446 -2.19480868
[56,] -2.47714324 -4.57241446
[57,] -3.87359766 -2.47714324
[58,] -0.84715721 -3.87359766
[59,] 2.59235076 -0.84715721
[60,] -3.86766601 2.59235076
[61,] -3.35932204 -3.86766601
[62,] -1.58606478 -3.35932204
[63,] 2.03279701 -1.58606478
[64,] 0.35685083 2.03279701
[65,] 0.20637519 0.35685083
[66,] 3.08551199 0.20637519
[67,] 0.29146471 3.08551199
[68,] -0.13035220 0.29146471
[69,] -1.83212201 -0.13035220
[70,] 2.13108432 -1.83212201
[71,] -0.62043070 2.13108432
[72,] 1.32547175 -0.62043070
[73,] -1.17245168 1.32547175
[74,] 1.15920751 -1.17245168
[75,] 1.76827205 1.15920751
[76,] 0.53428936 1.76827205
[77,] 2.24409095 0.53428936
[78,] 0.85548559 2.24409095
[79,] -0.60937158 0.85548559
[80,] 2.36530518 -0.60937158
[81,] -5.77903831 2.36530518
[82,] 2.05623212 -5.77903831
[83,] -1.82162259 2.05623212
[84,] 1.00468937 -1.82162259
[85,] 0.62721853 1.00468937
[86,] -0.84416349 0.62721853
[87,] 0.81073185 -0.84416349
[88,] -2.45980552 0.81073185
[89,] -1.32220014 -2.45980552
[90,] 2.48784277 -1.32220014
[91,] -0.42406294 2.48784277
[92,] 4.07186165 -0.42406294
[93,] -2.15178877 4.07186165
[94,] 0.89469746 -2.15178877
[95,] -2.99842944 0.89469746
[96,] 1.83121723 -2.99842944
[97,] -5.47611900 1.83121723
[98,] 1.35206632 -5.47611900
[99,] -2.64193320 1.35206632
[100,] -2.64480303 -2.64193320
[101,] 0.18625847 -2.64480303
[102,] -2.94107656 0.18625847
[103,] -1.93926363 -2.94107656
[104,] 0.85511585 -1.93926363
[105,] 2.90475389 0.85511585
[106,] 1.11389484 2.90475389
[107,] 1.46999938 1.11389484
[108,] 0.36985080 1.46999938
[109,] 0.48899164 0.36985080
[110,] -0.64144851 0.48899164
[111,] -1.30313544 -0.64144851
[112,] -0.30230324 -1.30313544
[113,] 0.58062889 -0.30230324
[114,] 0.01629630 0.58062889
[115,] -0.58027413 0.01629630
[116,] 2.21519514 -0.58027413
[117,] 1.78322625 2.21519514
[118,] 3.92520788 1.78322625
[119,] 0.93433275 3.92520788
[120,] -1.20615541 0.93433275
[121,] -4.03103302 -1.20615541
[122,] -0.30111110 -4.03103302
[123,] 0.42187815 -0.30111110
[124,] 1.22660024 0.42187815
[125,] -2.54543974 1.22660024
[126,] -0.46007735 -2.54543974
[127,] -1.91431191 -0.46007735
[128,] 1.58318112 -1.91431191
[129,] -0.47480614 1.58318112
[130,] 2.89615316 -0.47480614
[131,] -0.56619264 2.89615316
[132,] 0.28953137 -0.56619264
[133,] 2.49723624 0.28953137
[134,] 1.00505383 2.49723624
[135,] -1.43441006 1.00505383
[136,] -0.58284488 -1.43441006
[137,] 1.93758438 -0.58284488
[138,] -2.05980380 1.93758438
[139,] -3.51585355 -2.05980380
[140,] 0.15596895 -3.51585355
[141,] -1.82162259 0.15596895
[142,] 0.22631223 -1.82162259
[143,] 3.92520788 0.22631223
[144,] -2.42904124 3.92520788
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.81043959 -1.09634675
2 -3.35074206 2.81043959
3 -0.77767040 -3.35074206
4 1.38408393 -0.77767040
5 3.33478333 1.38408393
6 -0.52382379 3.33478333
7 -0.56910058 -0.52382379
8 0.34476675 -0.56910058
9 1.74276708 0.34476675
10 3.87592922 1.74276708
11 5.50260228 3.87592922
12 -2.65290982 5.50260228
13 1.79522896 -2.65290982
14 2.72183635 1.79522896
15 -1.07415247 2.72183635
16 2.12647079 -1.07415247
17 -0.65105100 2.12647079
18 1.01546067 -0.65105100
19 4.79388247 1.01546067
20 0.61386600 4.79388247
21 -0.30942408 0.61386600
22 3.31450230 -0.30942408
23 -5.39158607 3.31450230
24 1.93758438 -5.39158607
25 0.48115032 1.93758438
26 -3.64833236 0.48115032
27 0.81161016 -3.64833236
28 -0.04573036 0.81161016
29 2.67541890 -0.04573036
30 0.70052841 2.67541890
31 -0.79793280 0.70052841
32 3.00580235 -0.79793280
33 -3.25766181 3.00580235
34 1.52146477 -3.25766181
35 1.47400532 1.52146477
36 -0.13139179 1.47400532
37 1.59609224 -0.13139179
38 1.87412582 1.59609224
39 -1.07339841 1.87412582
40 -1.56056654 -1.07339841
41 -2.30025891 -1.56056654
42 -0.11485685 -2.30025891
43 1.93050223 -0.11485685
44 -1.25916044 1.93050223
45 2.92034396 -1.25916044
46 -0.19241999 2.92034396
47 -3.51370867 -0.19241999
48 -1.17098521 -3.51370867
49 -2.49203227 -1.17098521
50 0.60975135 -2.49203227
51 1.08309961 0.60975135
52 0.39865948 1.08309961
53 -2.77801614 0.39865948
54 -2.19480868 -2.77801614
55 -4.57241446 -2.19480868
56 -2.47714324 -4.57241446
57 -3.87359766 -2.47714324
58 -0.84715721 -3.87359766
59 2.59235076 -0.84715721
60 -3.86766601 2.59235076
61 -3.35932204 -3.86766601
62 -1.58606478 -3.35932204
63 2.03279701 -1.58606478
64 0.35685083 2.03279701
65 0.20637519 0.35685083
66 3.08551199 0.20637519
67 0.29146471 3.08551199
68 -0.13035220 0.29146471
69 -1.83212201 -0.13035220
70 2.13108432 -1.83212201
71 -0.62043070 2.13108432
72 1.32547175 -0.62043070
73 -1.17245168 1.32547175
74 1.15920751 -1.17245168
75 1.76827205 1.15920751
76 0.53428936 1.76827205
77 2.24409095 0.53428936
78 0.85548559 2.24409095
79 -0.60937158 0.85548559
80 2.36530518 -0.60937158
81 -5.77903831 2.36530518
82 2.05623212 -5.77903831
83 -1.82162259 2.05623212
84 1.00468937 -1.82162259
85 0.62721853 1.00468937
86 -0.84416349 0.62721853
87 0.81073185 -0.84416349
88 -2.45980552 0.81073185
89 -1.32220014 -2.45980552
90 2.48784277 -1.32220014
91 -0.42406294 2.48784277
92 4.07186165 -0.42406294
93 -2.15178877 4.07186165
94 0.89469746 -2.15178877
95 -2.99842944 0.89469746
96 1.83121723 -2.99842944
97 -5.47611900 1.83121723
98 1.35206632 -5.47611900
99 -2.64193320 1.35206632
100 -2.64480303 -2.64193320
101 0.18625847 -2.64480303
102 -2.94107656 0.18625847
103 -1.93926363 -2.94107656
104 0.85511585 -1.93926363
105 2.90475389 0.85511585
106 1.11389484 2.90475389
107 1.46999938 1.11389484
108 0.36985080 1.46999938
109 0.48899164 0.36985080
110 -0.64144851 0.48899164
111 -1.30313544 -0.64144851
112 -0.30230324 -1.30313544
113 0.58062889 -0.30230324
114 0.01629630 0.58062889
115 -0.58027413 0.01629630
116 2.21519514 -0.58027413
117 1.78322625 2.21519514
118 3.92520788 1.78322625
119 0.93433275 3.92520788
120 -1.20615541 0.93433275
121 -4.03103302 -1.20615541
122 -0.30111110 -4.03103302
123 0.42187815 -0.30111110
124 1.22660024 0.42187815
125 -2.54543974 1.22660024
126 -0.46007735 -2.54543974
127 -1.91431191 -0.46007735
128 1.58318112 -1.91431191
129 -0.47480614 1.58318112
130 2.89615316 -0.47480614
131 -0.56619264 2.89615316
132 0.28953137 -0.56619264
133 2.49723624 0.28953137
134 1.00505383 2.49723624
135 -1.43441006 1.00505383
136 -0.58284488 -1.43441006
137 1.93758438 -0.58284488
138 -2.05980380 1.93758438
139 -3.51585355 -2.05980380
140 0.15596895 -3.51585355
141 -1.82162259 0.15596895
142 0.22631223 -1.82162259
143 3.92520788 0.22631223
144 -2.42904124 3.92520788
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/7ifsw1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/8ifsw1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/9s6rz1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/rcomp/tmp/10s6rz1290529095.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/11w7751290529095.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/12h8ot1290529095.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/1369ln1290529095.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/14hik81290529095.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/15ki1d1290529095.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/169kjh1290529096.tab")
+ }
>
> try(system("convert tmp/1m5cn1290529095.ps tmp/1m5cn1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/2wxbq1290529095.ps tmp/2wxbq1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wxbq1290529095.ps tmp/3wxbq1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/4wxbq1290529095.ps tmp/4wxbq1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/5pobt1290529095.ps tmp/5pobt1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/6pobt1290529095.ps tmp/6pobt1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ifsw1290529095.ps tmp/7ifsw1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ifsw1290529095.ps tmp/8ifsw1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/9s6rz1290529095.ps tmp/9s6rz1290529095.png",intern=TRUE))
character(0)
> try(system("convert tmp/10s6rz1290529095.ps tmp/10s6rz1290529095.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.490 2.120 7.604