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(24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,20
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,31
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,27
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,34
+ ,16
+ ,18
+ ,11
+ ,21
+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entalCriticism','PersonalStandards','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 = '6'
> #'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
Organization ConcernOverMistakes DoubtsAboutActions ParentalExpectations
1 26 24 14 11
2 23 25 11 7
3 25 17 6 17
4 23 18 12 10
5 19 18 8 12
6 29 16 10 12
7 25 20 10 11
8 21 16 11 11
9 22 18 16 12
10 25 17 11 13
11 24 23 13 14
12 18 30 12 16
13 22 23 8 11
14 15 18 12 10
15 22 15 11 11
16 28 12 4 15
17 20 21 9 9
18 12 15 8 11
19 24 20 8 17
20 20 31 14 17
21 21 27 15 11
22 20 34 16 18
23 21 21 9 14
24 23 31 14 10
25 28 19 11 11
26 24 16 8 15
27 24 20 9 15
28 24 21 9 13
29 23 22 9 16
30 23 17 9 13
31 29 24 10 9
32 24 25 16 18
33 18 26 11 18
34 25 25 8 12
35 21 17 9 17
36 26 32 16 9
37 22 33 11 9
38 22 13 16 12
39 22 32 12 18
40 23 25 12 12
41 30 29 14 18
42 23 22 9 14
43 17 18 10 15
44 23 17 9 16
45 23 20 10 10
46 25 15 12 11
47 24 20 14 14
48 24 33 14 9
49 23 29 10 12
50 21 23 14 17
51 24 26 16 5
52 24 18 9 12
53 28 20 10 12
54 16 11 6 6
55 20 28 8 24
56 29 26 13 12
57 27 22 10 12
58 22 15 11 11
59 28 12 7 7
60 16 14 15 13
61 25 17 9 12
62 24 21 10 13
63 29 16 10 12
64 24 18 13 8
65 23 10 10 11
66 30 29 11 9
67 24 31 8 11
68 21 19 9 13
69 25 9 13 10
70 25 20 11 11
71 22 28 8 12
72 23 19 9 9
73 26 30 9 15
74 23 29 15 18
75 25 26 9 15
76 21 23 10 12
77 25 13 14 13
78 24 21 12 14
79 29 19 12 10
80 22 28 11 13
81 27 23 14 13
82 26 18 6 11
83 22 21 12 13
84 24 20 8 16
85 27 23 14 8
86 24 21 11 16
87 25 20 10 11
88 29 15 14 9
89 22 28 12 16
90 21 19 10 12
91 24 26 14 14
92 24 10 5 8
93 23 16 11 9
94 20 22 10 15
95 27 19 9 11
96 26 31 10 21
97 25 31 16 14
98 21 29 13 18
99 21 19 9 12
100 19 22 10 13
101 21 23 10 15
102 21 15 7 12
103 18 30 12 16
104 22 18 8 15
105 29 23 14 11
106 15 25 14 11
107 17 21 8 10
108 15 24 9 13
109 21 25 14 15
110 21 17 14 12
111 19 13 8 12
112 24 28 8 16
113 20 21 8 9
114 17 25 7 18
115 23 9 6 8
116 24 16 8 13
117 14 19 6 17
118 23 18 12 10
119 24 25 14 15
120 13 20 11 8
121 22 29 11 7
122 16 14 11 12
123 19 22 14 14
124 25 15 8 6
125 25 19 20 8
126 23 20 11 17
127 24 15 8 10
128 26 20 11 11
129 26 18 10 14
130 25 33 14 11
131 18 22 11 13
132 21 16 9 12
133 26 17 9 11
134 23 16 8 9
135 23 21 10 12
136 22 26 13 20
137 20 18 13 12
138 13 18 12 13
139 24 17 8 12
140 15 22 13 12
141 14 30 14 9
142 22 30 12 15
143 10 24 14 24
144 24 21 15 7
145 22 21 13 17
146 24 29 16 11
147 19 31 9 17
148 20 20 9 11
149 13 16 9 12
150 20 22 8 14
151 22 20 7 11
152 24 28 16 16
153 29 38 11 21
154 12 22 9 14
155 20 20 11 20
156 20 21 9 9
157 24 28 14 11
158 22 22 13 15
159 18 30 12 16
ParentalCriticism PersonalStandards
1 12 24
2 8 25
3 8 30
4 8 19
5 9 22
6 7 22
7 4 25
8 11 23
9 7 17
10 7 21
11 12 19
12 10 19
13 10 15
14 8 16
15 8 23
16 4 27
17 9 22
18 8 14
19 7 22
20 11 23
21 9 23
22 11 21
23 13 19
24 8 18
25 8 20
26 9 23
27 6 25
28 9 19
29 9 24
30 6 22
31 6 25
32 16 26
33 5 29
34 7 32
35 9 25
36 6 29
37 6 28
38 5 17
39 12 28
40 7 29
41 10 26
42 9 25
43 8 14
44 5 25
45 8 26
46 8 20
47 10 18
48 6 32
49 8 25
50 7 25
51 4 23
52 8 21
53 8 20
54 4 15
55 20 30
56 8 24
57 8 26
58 8 23
59 4 22
60 8 14
61 9 24
62 6 24
63 7 22
64 9 24
65 5 19
66 5 31
67 8 22
68 8 27
69 6 19
70 8 25
71 7 20
72 7 21
73 9 27
74 11 23
75 6 25
76 8 20
77 6 21
78 9 22
79 8 23
80 6 25
81 10 25
82 8 17
83 8 19
84 10 25
85 5 19
86 7 20
87 4 25
88 8 23
89 14 27
90 7 17
91 8 17
92 6 19
93 5 17
94 6 22
95 10 21
96 12 32
97 9 21
98 12 21
99 7 18
100 8 18
101 10 23
102 6 19
103 10 19
104 10 21
105 10 20
106 5 17
107 7 18
108 10 19
109 11 22
110 6 15
111 7 14
112 12 18
113 11 24
114 11 35
115 11 29
116 5 21
117 8 25
118 8 19
119 9 22
120 4 13
121 4 26
122 7 17
123 11 25
124 6 20
125 7 19
126 8 21
127 4 22
128 8 24
129 9 21
130 8 26
131 11 24
132 8 16
133 5 23
134 4 18
135 8 16
136 10 26
137 6 19
138 9 21
139 9 21
140 13 22
141 9 23
142 10 29
143 20 21
144 5 21
145 11 23
146 6 27
147 9 25
148 7 21
149 9 10
150 10 20
151 9 26
152 8 24
153 7 29
154 6 19
155 13 24
156 9 22
157 8 24
158 10 22
159 10 19
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) ConcernOverMistakes DoubtsAboutActions
16.53478 -0.08913 0.20972
ParentalExpectations ParentalCriticism PersonalStandards
-0.13697 -0.28785 0.43316
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.1720 -1.7197 0.1331 2.1117 7.3013
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.53478 2.00538 8.245 6.98e-14 ***
ConcernOverMistakes -0.08913 0.06148 -1.450 0.1492
DoubtsAboutActions 0.20972 0.11245 1.865 0.0641 .
ParentalExpectations -0.13697 0.10478 -1.307 0.1931
ParentalCriticism -0.28785 0.13154 -2.188 0.0302 *
PersonalStandards 0.43316 0.07537 5.747 4.76e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.492 on 153 degrees of freedom
Multiple R-squared: 0.2259, Adjusted R-squared: 0.2006
F-statistic: 8.931 on 5 and 153 DF, p-value: 1.836e-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.726848395 0.546303211 0.27315161
[2,] 0.600314849 0.799370302 0.39968515
[3,] 0.491624704 0.983249408 0.50837530
[4,] 0.447069600 0.894139200 0.55293040
[5,] 0.455862196 0.911724391 0.54413780
[6,] 0.696401282 0.607197436 0.30359872
[7,] 0.628429536 0.743140928 0.37157046
[8,] 0.574747540 0.850504920 0.42525246
[9,] 0.508732217 0.982535566 0.49126778
[10,] 0.639354782 0.721290437 0.36064522
[11,] 0.563862912 0.872274175 0.43613709
[12,] 0.568678757 0.862642485 0.43132124
[13,] 0.520361442 0.959277117 0.47963856
[14,] 0.450948793 0.901897585 0.54905121
[15,] 0.392229987 0.784459973 0.60777001
[16,] 0.393622460 0.787244920 0.60637754
[17,] 0.537474106 0.925051787 0.46252589
[18,] 0.474209114 0.948418227 0.52579089
[19,] 0.410331482 0.820662964 0.58966852
[20,] 0.403799437 0.807598875 0.59620056
[21,] 0.342670496 0.685340992 0.65732950
[22,] 0.285740166 0.571480333 0.71425983
[23,] 0.309685245 0.619370489 0.69031476
[24,] 0.261859715 0.523719429 0.73814029
[25,] 0.490321083 0.980642165 0.50967892
[26,] 0.444322128 0.888644256 0.55567787
[27,] 0.410375044 0.820750089 0.58962496
[28,] 0.354230370 0.708460741 0.64576963
[29,] 0.330785150 0.661570300 0.66921485
[30,] 0.281496923 0.562993846 0.71850308
[31,] 0.236067622 0.472135244 0.76393238
[32,] 0.213040260 0.426080520 0.78695974
[33,] 0.368017642 0.736035284 0.63198236
[34,] 0.317396015 0.634792029 0.68260399
[35,] 0.285392597 0.570785195 0.71460740
[36,] 0.243886149 0.487772297 0.75611385
[37,] 0.210944653 0.421889306 0.78905535
[38,] 0.189144163 0.378288326 0.81085584
[39,] 0.177421420 0.354842840 0.82257858
[40,] 0.163813153 0.327626306 0.83618685
[41,] 0.133870781 0.267741562 0.86612922
[42,] 0.125004559 0.250009118 0.87499544
[43,] 0.103103985 0.206207971 0.89689601
[44,] 0.087213622 0.174427244 0.91278638
[45,] 0.145211351 0.290422702 0.85478865
[46,] 0.180797101 0.361594202 0.81920290
[47,] 0.174192599 0.348385199 0.82580740
[48,] 0.233420934 0.466841869 0.76657907
[49,] 0.223355804 0.446711608 0.77664420
[50,] 0.198710170 0.397420340 0.80128983
[51,] 0.207011236 0.414022473 0.79298876
[52,] 0.235171141 0.470342282 0.76482886
[53,] 0.207231844 0.414463688 0.79276816
[54,] 0.174604664 0.349209328 0.82539534
[55,] 0.235897909 0.471795817 0.76410209
[56,] 0.202177034 0.404354069 0.79782297
[57,] 0.169874776 0.339749553 0.83012522
[58,] 0.164088158 0.328176316 0.83591184
[59,] 0.151735368 0.303470736 0.84826463
[60,] 0.153635379 0.307270757 0.84636462
[61,] 0.131502380 0.263004760 0.86849762
[62,] 0.109079798 0.218159595 0.89092020
[63,] 0.090534043 0.181068087 0.90946596
[64,] 0.072985898 0.145971797 0.92701410
[65,] 0.069346442 0.138692884 0.93065356
[66,] 0.057254336 0.114508672 0.94274566
[67,] 0.047972334 0.095944668 0.95202767
[68,] 0.037717242 0.075434483 0.96228276
[69,] 0.029924139 0.059848279 0.97007586
[70,] 0.024314957 0.048629914 0.97568504
[71,] 0.034948996 0.069897991 0.96505100
[72,] 0.028435046 0.056870092 0.97156495
[73,] 0.028081840 0.056163679 0.97191816
[74,] 0.047819958 0.095639916 0.95218004
[75,] 0.037666069 0.075332138 0.96233393
[76,] 0.031616567 0.063233133 0.96838343
[77,] 0.034517043 0.069034087 0.96548296
[78,] 0.030526033 0.061052066 0.96947397
[79,] 0.023292710 0.046585420 0.97670729
[80,] 0.029073448 0.058146897 0.97092655
[81,] 0.023447014 0.046894027 0.97655299
[82,] 0.017893773 0.035787545 0.98210623
[83,] 0.018554562 0.037109125 0.98144544
[84,] 0.015766760 0.031533520 0.98423324
[85,] 0.012142232 0.024284463 0.98785777
[86,] 0.010340666 0.020681333 0.98965933
[87,] 0.018615345 0.037230689 0.98138466
[88,] 0.017222305 0.034444611 0.98277769
[89,] 0.017325238 0.034650476 0.98267476
[90,] 0.014017848 0.028035695 0.98598215
[91,] 0.010577743 0.021155485 0.98942226
[92,] 0.008290708 0.016581415 0.99170929
[93,] 0.006287672 0.012575344 0.99371233
[94,] 0.004563472 0.009126945 0.99543653
[95,] 0.003495947 0.006991894 0.99650405
[96,] 0.002784379 0.005568759 0.99721562
[97,] 0.012647988 0.025295976 0.98735201
[98,] 0.027143586 0.054287171 0.97285641
[99,] 0.027299567 0.054599133 0.97270043
[100,] 0.033156943 0.066313885 0.96684306
[101,] 0.026350223 0.052700447 0.97364978
[102,] 0.019630409 0.039260818 0.98036959
[103,] 0.014531430 0.029062861 0.98546857
[104,] 0.044792180 0.089584360 0.95520782
[105,] 0.041362497 0.082724994 0.95863750
[106,] 0.116028967 0.232057935 0.88397103
[107,] 0.099833039 0.199666077 0.90016696
[108,] 0.080765518 0.161531036 0.91923448
[109,] 0.254933951 0.509867902 0.74506605
[110,] 0.240747019 0.481494039 0.75925298
[111,] 0.230854502 0.461709004 0.76914550
[112,] 0.333801785 0.667603569 0.66619822
[113,] 0.334179259 0.668358517 0.66582074
[114,] 0.394841585 0.789683171 0.60515841
[115,] 0.386454945 0.772909891 0.61354505
[116,] 0.370584780 0.741169560 0.62941522
[117,] 0.368956562 0.737913125 0.63104344
[118,] 0.319062145 0.638124289 0.68093786
[119,] 0.279281723 0.558563445 0.72071828
[120,] 0.272127996 0.544255991 0.72787200
[121,] 0.348887071 0.697774141 0.65111293
[122,] 0.337620563 0.675241127 0.66237944
[123,] 0.309570176 0.619140352 0.69042982
[124,] 0.287270403 0.574540805 0.71272960
[125,] 0.243765295 0.487530590 0.75623471
[126,] 0.198214565 0.396429130 0.80178543
[127,] 0.311270449 0.622540898 0.68872955
[128,] 0.255746628 0.511493256 0.74425337
[129,] 0.207496144 0.414992289 0.79250386
[130,] 0.475364930 0.950729859 0.52463507
[131,] 0.519889007 0.960221986 0.48011099
[132,] 0.480982661 0.961965321 0.51901734
[133,] 0.656927213 0.686145574 0.34307279
[134,] 0.614349810 0.771300380 0.38565019
[135,] 0.822604607 0.354790785 0.17739539
[136,] 0.809678719 0.380642563 0.19032128
[137,] 0.728752134 0.542495731 0.27124787
[138,] 0.663373955 0.673252089 0.33662604
[139,] 0.706153051 0.587693899 0.29384695
[140,] 0.629031969 0.741936061 0.37096803
[141,] 0.814551782 0.370896437 0.18544822
[142,] 0.908543770 0.182912459 0.09145623
> postscript(file="/var/www/html/rcomp/tmp/1vvwo1292767023.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/2vvwo1292767023.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/3n4vr1292767023.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/4n4vr1292767023.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/5n4vr1292767023.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
3.233513036 -1.180634531 0.358831952 0.995562166 -2.903241867 5.923361744
7 8 9 10 11 12
-0.020083818 -1.705094847 0.009100535 2.372905546 3.930790747 -1.537306331
13 14 15 16 17 18
3.725387854 -5.704971901 -1.657769867 3.206731608 -2.256475902 -7.130219625
19 20 21 22 23 24
2.384193007 -1.175409412 -2.139189912 -0.324160658 1.879240703 2.168018802
25 26 27 28 29 30
5.998230308 1.896252936 0.313217616 3.590879679 0.925153919 0.071338044
31 32 33 34 35 36
4.638199907 2.147096508 -7.180967144 -1.186554360 -1.816696782 -0.639657739
37 38 39 40 41 42
-3.068781463 -1.012261574 -0.407797879 -2.725958350 7.195982793 0.218053785
43 44 45 46 47 48
-1.734364258 -1.105057807 -1.438822928 2.431978585 3.311133589 -3.430555150
49 50 51 52 53 54
0.070479251 -2.906177130 -1.699111189 2.032348810 6.434053761 -5.336724888
55 56 57 58 59 60
0.332838876 5.607081437 3.013389016 -1.657769867 3.647576426 -4.413430729
61 62 63 64 65 66
1.931596470 0.351844183 5.923361744 -0.366029541 -0.024640404 2.987371209
67 68 69 70 71 72
2.830674855 -3.340477084 1.407948334 0.921587313 1.278710054 0.422717982
73 74 75 76 77 78
3.201784059 1.573578398 1.848018979 -0.298545557 1.099371709 1.799233715
79 80 81 82 83 84
5.352074482 -1.667093685 3.409474682 6.257150085 0.673880083 1.811296121
85 86 87 88 89 90
3.884308724 2.573512335 -0.020083818 4.439132867 -0.029427328 0.356538981
91 92 93 94 95 96
3.703395957 1.900876918 0.892809277 -2.418766811 5.560204265 2.600799513
97 98 99 100 101 102
3.284854707 1.147171135 0.133101151 -1.384396084 -0.611399949 -0.525000594
103 104 105 106 107 108
-1.537306331 1.228677833 7.301306414 -6.660196298 -3.752859071 -4.853872487
109 110 111 112 113 114
-0.551000287 -0.082134595 -0.459361488 6.132146089 -2.337374736 -8.303079729
115 116 117 118 119 120
-2.290291468 1.337230122 -8.297124372 0.995562166 1.873305407 -7.442854802
121 122 123 124 125 126
-3.408644213 -5.298846303 -4.254839314 2.010292144 0.845163902 1.476043028
127 128 129 130 131 132
0.116176862 2.354742624 4.384423306 1.018015846 -4.329503972 1.019858244
133 134 135 136 137 138
2.076390756 0.800959255 3.255808566 -0.587755584 -2.515904798 -9.171984068
139 140 141 142 143 144
2.440779884 -6.443906417 -8.936016573 -2.005831853 -7.383602452 -0.506958912
145 146 147 148 149 150
0.142972464 -1.766802975 -2.568826935 -2.214203634 -4.093362737 -0.118605026
151 152 153 154 155 156
-1.384850921 0.704085763 5.875247123 -9.046555809 -0.973269904 -2.256475902
157 158 159
0.438658666 0.103469359 -1.537306331
> postscript(file="/var/www/html/rcomp/tmp/6n4vr1292767023.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 3.233513036 NA
1 -1.180634531 3.233513036
2 0.358831952 -1.180634531
3 0.995562166 0.358831952
4 -2.903241867 0.995562166
5 5.923361744 -2.903241867
6 -0.020083818 5.923361744
7 -1.705094847 -0.020083818
8 0.009100535 -1.705094847
9 2.372905546 0.009100535
10 3.930790747 2.372905546
11 -1.537306331 3.930790747
12 3.725387854 -1.537306331
13 -5.704971901 3.725387854
14 -1.657769867 -5.704971901
15 3.206731608 -1.657769867
16 -2.256475902 3.206731608
17 -7.130219625 -2.256475902
18 2.384193007 -7.130219625
19 -1.175409412 2.384193007
20 -2.139189912 -1.175409412
21 -0.324160658 -2.139189912
22 1.879240703 -0.324160658
23 2.168018802 1.879240703
24 5.998230308 2.168018802
25 1.896252936 5.998230308
26 0.313217616 1.896252936
27 3.590879679 0.313217616
28 0.925153919 3.590879679
29 0.071338044 0.925153919
30 4.638199907 0.071338044
31 2.147096508 4.638199907
32 -7.180967144 2.147096508
33 -1.186554360 -7.180967144
34 -1.816696782 -1.186554360
35 -0.639657739 -1.816696782
36 -3.068781463 -0.639657739
37 -1.012261574 -3.068781463
38 -0.407797879 -1.012261574
39 -2.725958350 -0.407797879
40 7.195982793 -2.725958350
41 0.218053785 7.195982793
42 -1.734364258 0.218053785
43 -1.105057807 -1.734364258
44 -1.438822928 -1.105057807
45 2.431978585 -1.438822928
46 3.311133589 2.431978585
47 -3.430555150 3.311133589
48 0.070479251 -3.430555150
49 -2.906177130 0.070479251
50 -1.699111189 -2.906177130
51 2.032348810 -1.699111189
52 6.434053761 2.032348810
53 -5.336724888 6.434053761
54 0.332838876 -5.336724888
55 5.607081437 0.332838876
56 3.013389016 5.607081437
57 -1.657769867 3.013389016
58 3.647576426 -1.657769867
59 -4.413430729 3.647576426
60 1.931596470 -4.413430729
61 0.351844183 1.931596470
62 5.923361744 0.351844183
63 -0.366029541 5.923361744
64 -0.024640404 -0.366029541
65 2.987371209 -0.024640404
66 2.830674855 2.987371209
67 -3.340477084 2.830674855
68 1.407948334 -3.340477084
69 0.921587313 1.407948334
70 1.278710054 0.921587313
71 0.422717982 1.278710054
72 3.201784059 0.422717982
73 1.573578398 3.201784059
74 1.848018979 1.573578398
75 -0.298545557 1.848018979
76 1.099371709 -0.298545557
77 1.799233715 1.099371709
78 5.352074482 1.799233715
79 -1.667093685 5.352074482
80 3.409474682 -1.667093685
81 6.257150085 3.409474682
82 0.673880083 6.257150085
83 1.811296121 0.673880083
84 3.884308724 1.811296121
85 2.573512335 3.884308724
86 -0.020083818 2.573512335
87 4.439132867 -0.020083818
88 -0.029427328 4.439132867
89 0.356538981 -0.029427328
90 3.703395957 0.356538981
91 1.900876918 3.703395957
92 0.892809277 1.900876918
93 -2.418766811 0.892809277
94 5.560204265 -2.418766811
95 2.600799513 5.560204265
96 3.284854707 2.600799513
97 1.147171135 3.284854707
98 0.133101151 1.147171135
99 -1.384396084 0.133101151
100 -0.611399949 -1.384396084
101 -0.525000594 -0.611399949
102 -1.537306331 -0.525000594
103 1.228677833 -1.537306331
104 7.301306414 1.228677833
105 -6.660196298 7.301306414
106 -3.752859071 -6.660196298
107 -4.853872487 -3.752859071
108 -0.551000287 -4.853872487
109 -0.082134595 -0.551000287
110 -0.459361488 -0.082134595
111 6.132146089 -0.459361488
112 -2.337374736 6.132146089
113 -8.303079729 -2.337374736
114 -2.290291468 -8.303079729
115 1.337230122 -2.290291468
116 -8.297124372 1.337230122
117 0.995562166 -8.297124372
118 1.873305407 0.995562166
119 -7.442854802 1.873305407
120 -3.408644213 -7.442854802
121 -5.298846303 -3.408644213
122 -4.254839314 -5.298846303
123 2.010292144 -4.254839314
124 0.845163902 2.010292144
125 1.476043028 0.845163902
126 0.116176862 1.476043028
127 2.354742624 0.116176862
128 4.384423306 2.354742624
129 1.018015846 4.384423306
130 -4.329503972 1.018015846
131 1.019858244 -4.329503972
132 2.076390756 1.019858244
133 0.800959255 2.076390756
134 3.255808566 0.800959255
135 -0.587755584 3.255808566
136 -2.515904798 -0.587755584
137 -9.171984068 -2.515904798
138 2.440779884 -9.171984068
139 -6.443906417 2.440779884
140 -8.936016573 -6.443906417
141 -2.005831853 -8.936016573
142 -7.383602452 -2.005831853
143 -0.506958912 -7.383602452
144 0.142972464 -0.506958912
145 -1.766802975 0.142972464
146 -2.568826935 -1.766802975
147 -2.214203634 -2.568826935
148 -4.093362737 -2.214203634
149 -0.118605026 -4.093362737
150 -1.384850921 -0.118605026
151 0.704085763 -1.384850921
152 5.875247123 0.704085763
153 -9.046555809 5.875247123
154 -0.973269904 -9.046555809
155 -2.256475902 -0.973269904
156 0.438658666 -2.256475902
157 0.103469359 0.438658666
158 -1.537306331 0.103469359
159 NA -1.537306331
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.180634531 3.233513036
[2,] 0.358831952 -1.180634531
[3,] 0.995562166 0.358831952
[4,] -2.903241867 0.995562166
[5,] 5.923361744 -2.903241867
[6,] -0.020083818 5.923361744
[7,] -1.705094847 -0.020083818
[8,] 0.009100535 -1.705094847
[9,] 2.372905546 0.009100535
[10,] 3.930790747 2.372905546
[11,] -1.537306331 3.930790747
[12,] 3.725387854 -1.537306331
[13,] -5.704971901 3.725387854
[14,] -1.657769867 -5.704971901
[15,] 3.206731608 -1.657769867
[16,] -2.256475902 3.206731608
[17,] -7.130219625 -2.256475902
[18,] 2.384193007 -7.130219625
[19,] -1.175409412 2.384193007
[20,] -2.139189912 -1.175409412
[21,] -0.324160658 -2.139189912
[22,] 1.879240703 -0.324160658
[23,] 2.168018802 1.879240703
[24,] 5.998230308 2.168018802
[25,] 1.896252936 5.998230308
[26,] 0.313217616 1.896252936
[27,] 3.590879679 0.313217616
[28,] 0.925153919 3.590879679
[29,] 0.071338044 0.925153919
[30,] 4.638199907 0.071338044
[31,] 2.147096508 4.638199907
[32,] -7.180967144 2.147096508
[33,] -1.186554360 -7.180967144
[34,] -1.816696782 -1.186554360
[35,] -0.639657739 -1.816696782
[36,] -3.068781463 -0.639657739
[37,] -1.012261574 -3.068781463
[38,] -0.407797879 -1.012261574
[39,] -2.725958350 -0.407797879
[40,] 7.195982793 -2.725958350
[41,] 0.218053785 7.195982793
[42,] -1.734364258 0.218053785
[43,] -1.105057807 -1.734364258
[44,] -1.438822928 -1.105057807
[45,] 2.431978585 -1.438822928
[46,] 3.311133589 2.431978585
[47,] -3.430555150 3.311133589
[48,] 0.070479251 -3.430555150
[49,] -2.906177130 0.070479251
[50,] -1.699111189 -2.906177130
[51,] 2.032348810 -1.699111189
[52,] 6.434053761 2.032348810
[53,] -5.336724888 6.434053761
[54,] 0.332838876 -5.336724888
[55,] 5.607081437 0.332838876
[56,] 3.013389016 5.607081437
[57,] -1.657769867 3.013389016
[58,] 3.647576426 -1.657769867
[59,] -4.413430729 3.647576426
[60,] 1.931596470 -4.413430729
[61,] 0.351844183 1.931596470
[62,] 5.923361744 0.351844183
[63,] -0.366029541 5.923361744
[64,] -0.024640404 -0.366029541
[65,] 2.987371209 -0.024640404
[66,] 2.830674855 2.987371209
[67,] -3.340477084 2.830674855
[68,] 1.407948334 -3.340477084
[69,] 0.921587313 1.407948334
[70,] 1.278710054 0.921587313
[71,] 0.422717982 1.278710054
[72,] 3.201784059 0.422717982
[73,] 1.573578398 3.201784059
[74,] 1.848018979 1.573578398
[75,] -0.298545557 1.848018979
[76,] 1.099371709 -0.298545557
[77,] 1.799233715 1.099371709
[78,] 5.352074482 1.799233715
[79,] -1.667093685 5.352074482
[80,] 3.409474682 -1.667093685
[81,] 6.257150085 3.409474682
[82,] 0.673880083 6.257150085
[83,] 1.811296121 0.673880083
[84,] 3.884308724 1.811296121
[85,] 2.573512335 3.884308724
[86,] -0.020083818 2.573512335
[87,] 4.439132867 -0.020083818
[88,] -0.029427328 4.439132867
[89,] 0.356538981 -0.029427328
[90,] 3.703395957 0.356538981
[91,] 1.900876918 3.703395957
[92,] 0.892809277 1.900876918
[93,] -2.418766811 0.892809277
[94,] 5.560204265 -2.418766811
[95,] 2.600799513 5.560204265
[96,] 3.284854707 2.600799513
[97,] 1.147171135 3.284854707
[98,] 0.133101151 1.147171135
[99,] -1.384396084 0.133101151
[100,] -0.611399949 -1.384396084
[101,] -0.525000594 -0.611399949
[102,] -1.537306331 -0.525000594
[103,] 1.228677833 -1.537306331
[104,] 7.301306414 1.228677833
[105,] -6.660196298 7.301306414
[106,] -3.752859071 -6.660196298
[107,] -4.853872487 -3.752859071
[108,] -0.551000287 -4.853872487
[109,] -0.082134595 -0.551000287
[110,] -0.459361488 -0.082134595
[111,] 6.132146089 -0.459361488
[112,] -2.337374736 6.132146089
[113,] -8.303079729 -2.337374736
[114,] -2.290291468 -8.303079729
[115,] 1.337230122 -2.290291468
[116,] -8.297124372 1.337230122
[117,] 0.995562166 -8.297124372
[118,] 1.873305407 0.995562166
[119,] -7.442854802 1.873305407
[120,] -3.408644213 -7.442854802
[121,] -5.298846303 -3.408644213
[122,] -4.254839314 -5.298846303
[123,] 2.010292144 -4.254839314
[124,] 0.845163902 2.010292144
[125,] 1.476043028 0.845163902
[126,] 0.116176862 1.476043028
[127,] 2.354742624 0.116176862
[128,] 4.384423306 2.354742624
[129,] 1.018015846 4.384423306
[130,] -4.329503972 1.018015846
[131,] 1.019858244 -4.329503972
[132,] 2.076390756 1.019858244
[133,] 0.800959255 2.076390756
[134,] 3.255808566 0.800959255
[135,] -0.587755584 3.255808566
[136,] -2.515904798 -0.587755584
[137,] -9.171984068 -2.515904798
[138,] 2.440779884 -9.171984068
[139,] -6.443906417 2.440779884
[140,] -8.936016573 -6.443906417
[141,] -2.005831853 -8.936016573
[142,] -7.383602452 -2.005831853
[143,] -0.506958912 -7.383602452
[144,] 0.142972464 -0.506958912
[145,] -1.766802975 0.142972464
[146,] -2.568826935 -1.766802975
[147,] -2.214203634 -2.568826935
[148,] -4.093362737 -2.214203634
[149,] -0.118605026 -4.093362737
[150,] -1.384850921 -0.118605026
[151,] 0.704085763 -1.384850921
[152,] 5.875247123 0.704085763
[153,] -9.046555809 5.875247123
[154,] -0.973269904 -9.046555809
[155,] -2.256475902 -0.973269904
[156,] 0.438658666 -2.256475902
[157,] 0.103469359 0.438658666
[158,] -1.537306331 0.103469359
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.180634531 3.233513036
2 0.358831952 -1.180634531
3 0.995562166 0.358831952
4 -2.903241867 0.995562166
5 5.923361744 -2.903241867
6 -0.020083818 5.923361744
7 -1.705094847 -0.020083818
8 0.009100535 -1.705094847
9 2.372905546 0.009100535
10 3.930790747 2.372905546
11 -1.537306331 3.930790747
12 3.725387854 -1.537306331
13 -5.704971901 3.725387854
14 -1.657769867 -5.704971901
15 3.206731608 -1.657769867
16 -2.256475902 3.206731608
17 -7.130219625 -2.256475902
18 2.384193007 -7.130219625
19 -1.175409412 2.384193007
20 -2.139189912 -1.175409412
21 -0.324160658 -2.139189912
22 1.879240703 -0.324160658
23 2.168018802 1.879240703
24 5.998230308 2.168018802
25 1.896252936 5.998230308
26 0.313217616 1.896252936
27 3.590879679 0.313217616
28 0.925153919 3.590879679
29 0.071338044 0.925153919
30 4.638199907 0.071338044
31 2.147096508 4.638199907
32 -7.180967144 2.147096508
33 -1.186554360 -7.180967144
34 -1.816696782 -1.186554360
35 -0.639657739 -1.816696782
36 -3.068781463 -0.639657739
37 -1.012261574 -3.068781463
38 -0.407797879 -1.012261574
39 -2.725958350 -0.407797879
40 7.195982793 -2.725958350
41 0.218053785 7.195982793
42 -1.734364258 0.218053785
43 -1.105057807 -1.734364258
44 -1.438822928 -1.105057807
45 2.431978585 -1.438822928
46 3.311133589 2.431978585
47 -3.430555150 3.311133589
48 0.070479251 -3.430555150
49 -2.906177130 0.070479251
50 -1.699111189 -2.906177130
51 2.032348810 -1.699111189
52 6.434053761 2.032348810
53 -5.336724888 6.434053761
54 0.332838876 -5.336724888
55 5.607081437 0.332838876
56 3.013389016 5.607081437
57 -1.657769867 3.013389016
58 3.647576426 -1.657769867
59 -4.413430729 3.647576426
60 1.931596470 -4.413430729
61 0.351844183 1.931596470
62 5.923361744 0.351844183
63 -0.366029541 5.923361744
64 -0.024640404 -0.366029541
65 2.987371209 -0.024640404
66 2.830674855 2.987371209
67 -3.340477084 2.830674855
68 1.407948334 -3.340477084
69 0.921587313 1.407948334
70 1.278710054 0.921587313
71 0.422717982 1.278710054
72 3.201784059 0.422717982
73 1.573578398 3.201784059
74 1.848018979 1.573578398
75 -0.298545557 1.848018979
76 1.099371709 -0.298545557
77 1.799233715 1.099371709
78 5.352074482 1.799233715
79 -1.667093685 5.352074482
80 3.409474682 -1.667093685
81 6.257150085 3.409474682
82 0.673880083 6.257150085
83 1.811296121 0.673880083
84 3.884308724 1.811296121
85 2.573512335 3.884308724
86 -0.020083818 2.573512335
87 4.439132867 -0.020083818
88 -0.029427328 4.439132867
89 0.356538981 -0.029427328
90 3.703395957 0.356538981
91 1.900876918 3.703395957
92 0.892809277 1.900876918
93 -2.418766811 0.892809277
94 5.560204265 -2.418766811
95 2.600799513 5.560204265
96 3.284854707 2.600799513
97 1.147171135 3.284854707
98 0.133101151 1.147171135
99 -1.384396084 0.133101151
100 -0.611399949 -1.384396084
101 -0.525000594 -0.611399949
102 -1.537306331 -0.525000594
103 1.228677833 -1.537306331
104 7.301306414 1.228677833
105 -6.660196298 7.301306414
106 -3.752859071 -6.660196298
107 -4.853872487 -3.752859071
108 -0.551000287 -4.853872487
109 -0.082134595 -0.551000287
110 -0.459361488 -0.082134595
111 6.132146089 -0.459361488
112 -2.337374736 6.132146089
113 -8.303079729 -2.337374736
114 -2.290291468 -8.303079729
115 1.337230122 -2.290291468
116 -8.297124372 1.337230122
117 0.995562166 -8.297124372
118 1.873305407 0.995562166
119 -7.442854802 1.873305407
120 -3.408644213 -7.442854802
121 -5.298846303 -3.408644213
122 -4.254839314 -5.298846303
123 2.010292144 -4.254839314
124 0.845163902 2.010292144
125 1.476043028 0.845163902
126 0.116176862 1.476043028
127 2.354742624 0.116176862
128 4.384423306 2.354742624
129 1.018015846 4.384423306
130 -4.329503972 1.018015846
131 1.019858244 -4.329503972
132 2.076390756 1.019858244
133 0.800959255 2.076390756
134 3.255808566 0.800959255
135 -0.587755584 3.255808566
136 -2.515904798 -0.587755584
137 -9.171984068 -2.515904798
138 2.440779884 -9.171984068
139 -6.443906417 2.440779884
140 -8.936016573 -6.443906417
141 -2.005831853 -8.936016573
142 -7.383602452 -2.005831853
143 -0.506958912 -7.383602452
144 0.142972464 -0.506958912
145 -1.766802975 0.142972464
146 -2.568826935 -1.766802975
147 -2.214203634 -2.568826935
148 -4.093362737 -2.214203634
149 -0.118605026 -4.093362737
150 -1.384850921 -0.118605026
151 0.704085763 -1.384850921
152 5.875247123 0.704085763
153 -9.046555809 5.875247123
154 -0.973269904 -9.046555809
155 -2.256475902 -0.973269904
156 0.438658666 -2.256475902
157 0.103469359 0.438658666
158 -1.537306331 0.103469359
> 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/7yecc1292767023.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/89nbx1292767023.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/99nbx1292767023.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/109nbx1292767023.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/11uosl1292767023.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/12yo891292767023.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/1357n21292767023.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/14884q1292767023.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/15jhlb1292767023.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/16xr121292767023.tab")
+ }
>
> try(system("convert tmp/1vvwo1292767023.ps tmp/1vvwo1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/2vvwo1292767023.ps tmp/2vvwo1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/3n4vr1292767023.ps tmp/3n4vr1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/4n4vr1292767023.ps tmp/4n4vr1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/5n4vr1292767023.ps tmp/5n4vr1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/6n4vr1292767023.ps tmp/6n4vr1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/7yecc1292767023.ps tmp/7yecc1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/89nbx1292767023.ps tmp/89nbx1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/99nbx1292767023.ps tmp/99nbx1292767023.png",intern=TRUE))
character(0)
> try(system("convert tmp/109nbx1292767023.ps tmp/109nbx1292767023.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.042 1.737 9.694