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(1
+ ,41
+ ,25
+ ,15
+ ,9
+ ,3
+ ,1
+ ,38
+ ,25
+ ,15
+ ,9
+ ,4
+ ,1
+ ,37
+ ,19
+ ,14
+ ,9
+ ,4
+ ,1
+ ,42
+ ,18
+ ,10
+ ,8
+ ,4
+ ,1
+ ,40
+ ,23
+ ,18
+ ,15
+ ,3
+ ,1
+ ,43
+ ,25
+ ,14
+ ,9
+ ,4
+ ,1
+ ,40
+ ,23
+ ,11
+ ,11
+ ,4
+ ,1
+ ,45
+ ,30
+ ,17
+ ,6
+ ,5
+ ,1
+ ,45
+ ,32
+ ,21
+ ,10
+ ,4
+ ,1
+ ,44
+ ,25
+ ,7
+ ,11
+ ,4
+ ,1
+ ,42
+ ,26
+ ,18
+ ,16
+ ,4
+ ,1
+ ,32
+ ,25
+ ,13
+ ,11
+ ,5
+ ,1
+ ,32
+ ,25
+ ,13
+ ,11
+ ,5
+ ,1
+ ,41
+ ,35
+ ,18
+ ,7
+ ,4
+ ,1
+ ,38
+ ,20
+ ,12
+ ,10
+ ,4
+ ,1
+ ,38
+ ,21
+ ,9
+ ,9
+ ,4
+ ,1
+ ,24
+ ,23
+ ,11
+ ,15
+ ,3
+ ,1
+ ,46
+ ,17
+ ,11
+ ,6
+ ,5
+ ,1
+ ,42
+ ,27
+ ,16
+ ,12
+ ,4
+ ,1
+ ,46
+ ,25
+ ,12
+ ,10
+ ,4
+ ,1
+ ,43
+ ,18
+ ,14
+ ,14
+ ,5
+ ,1
+ ,38
+ ,22
+ ,13
+ ,9
+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+ ,14
+ ,3
+ ,0
+ ,42
+ ,17
+ ,12
+ ,10
+ ,3
+ ,0
+ ,41
+ ,19
+ ,13
+ ,12
+ ,4
+ ,0
+ ,47
+ ,21
+ ,17
+ ,11
+ ,3
+ ,0
+ ,35
+ ,20
+ ,16
+ ,11
+ ,3
+ ,0
+ ,43
+ ,20
+ ,11
+ ,14
+ ,3
+ ,0
+ ,40
+ ,29
+ ,9
+ ,16
+ ,4
+ ,0
+ ,46
+ ,23
+ ,11
+ ,9
+ ,4
+ ,0
+ ,44
+ ,23
+ ,11
+ ,11
+ ,5
+ ,0
+ ,35
+ ,19
+ ,13
+ ,9
+ ,3
+ ,0
+ ,29
+ ,22
+ ,15
+ ,14
+ ,4)
+ ,dim=c(6
+ ,146)
+ ,dimnames=list(c('Gender'
+ ,'StudyForCareer'
+ ,'PersonalStandards'
+ ,'ParentalExpectation'
+ ,'Doubts'
+ ,'LeaderPreference')
+ ,1:146))
> y <- array(NA,dim=c(6,146),dimnames=list(c('Gender','StudyForCareer','PersonalStandards','ParentalExpectation','Doubts','LeaderPreference'),1:146))
> 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 = '2'
> #'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
StudyForCareer Gender PersonalStandards ParentalExpectation Doubts
1 41 1 25 15 9
2 38 1 25 15 9
3 37 1 19 14 9
4 42 1 18 10 8
5 40 1 23 18 15
6 43 1 25 14 9
7 40 1 23 11 11
8 45 1 30 17 6
9 45 1 32 21 10
10 44 1 25 7 11
11 42 1 26 18 16
12 32 1 25 13 11
13 32 1 25 13 11
14 41 1 35 18 7
15 38 1 20 12 10
16 38 1 21 9 9
17 24 1 23 11 15
18 46 1 17 11 6
19 42 1 27 16 12
20 46 1 25 12 10
21 43 1 18 14 14
22 38 1 22 13 9
23 39 1 23 17 14
24 40 1 25 13 14
25 37 1 19 13 9
26 41 1 20 12 8
27 46 1 26 12 10
28 26 1 16 12 9
29 37 1 22 9 9
30 39 1 25 17 9
31 44 1 29 18 11
32 38 1 22 12 10
33 38 1 32 12 8
34 38 1 23 9 14
35 33 1 18 13 10
36 43 1 26 11 14
37 41 1 14 13 15
38 49 1 20 6 8
39 45 1 25 11 10
40 31 1 21 18 13
41 30 1 21 18 13
42 38 1 23 15 10
43 39 1 24 11 11
44 40 1 21 14 10
45 36 1 17 12 16
46 49 1 29 8 6
47 41 1 25 11 11
48 18 1 16 10 12
49 42 1 25 17 14
50 41 1 25 16 9
51 43 1 21 13 11
52 46 1 23 15 8
53 41 1 25 16 8
54 39 1 25 7 11
55 42 1 24 16 16
56 35 1 21 13 12
57 36 1 22 15 14
58 48 1 14 12 8
59 41 1 20 12 10
60 47 1 21 24 14
61 41 1 22 15 10
62 31 1 19 8 5
63 36 1 28 18 12
64 46 1 25 17 9
65 44 1 21 15 8
66 43 1 27 11 16
67 40 1 19 12 13
68 40 1 20 14 8
69 46 1 17 11 14
70 39 1 22 10 8
71 44 1 26 11 7
72 38 1 17 12 11
73 39 1 15 6 6
74 41 1 27 15 9
75 39 1 25 14 14
76 40 1 19 16 12
77 44 1 18 16 8
78 42 1 15 11 8
79 46 1 29 15 12
80 44 1 24 12 13
81 37 1 24 13 11
82 39 1 22 14 12
83 40 1 22 12 13
84 42 1 25 17 14
85 37 1 21 11 9
86 33 1 21 13 8
87 35 1 18 9 8
88 42 1 10 12 9
89 36 0 18 10 14
90 44 0 23 9 14
91 45 0 24 11 14
92 47 0 32 9 14
93 40 0 24 16 9
94 49 0 17 14 14
95 48 0 30 24 8
96 29 0 25 9 10
97 45 0 23 11 11
98 29 0 19 14 13
99 41 0 21 12 9
100 34 0 24 8 13
101 38 0 23 5 16
102 37 0 19 10 12
103 48 0 27 15 4
104 39 0 26 10 10
105 34 0 26 18 14
106 35 0 16 12 10
107 41 0 27 13 9
108 43 0 14 11 8
109 41 0 18 12 9
110 39 0 21 7 15
111 36 0 22 17 8
112 32 0 31 9 11
113 46 0 23 10 12
114 42 0 24 12 9
115 42 0 19 10 13
116 45 0 22 7 7
117 39 0 24 13 10
118 45 0 28 9 11
119 48 0 24 9 8
120 28 0 15 12 14
121 35 0 21 11 9
122 38 0 21 14 16
123 42 0 13 8 11
124 36 0 20 11 12
125 37 0 22 11 8
126 38 0 19 12 7
127 43 0 26 20 13
128 35 0 19 8 20
129 36 0 20 11 11
130 33 0 14 15 10
131 39 0 17 12 16
132 32 0 29 12 12
133 45 0 21 12 8
134 35 0 19 11 10
135 38 0 17 9 11
136 36 0 19 8 14
137 42 0 17 12 10
138 41 0 19 13 12
139 47 0 21 17 11
140 35 0 20 16 11
141 43 0 20 11 14
142 40 0 29 9 16
143 46 0 23 11 9
144 44 0 23 11 11
145 35 0 19 13 9
146 29 0 22 15 14
LeaderPreference
1 3
2 4
3 4
4 4
5 3
6 4
7 4
8 5
9 4
10 4
11 4
12 5
13 5
14 4
15 4
16 4
17 3
18 5
19 4
20 4
21 5
22 4
23 4
24 3
25 2
26 4
27 4
28 3
29 3
30 4
31 5
32 2
33 0
34 4
35 3
36 4
37 2
38 4
39 5
40 3
41 3
42 4
43 4
44 4
45 2
46 5
47 4
48 2
49 3
50 5
51 4
52 3
53 5
54 4
55 4
56 5
57 3
58 4
59 4
60 3
61 3
62 5
63 4
64 4
65 4
66 2
67 5
68 3
69 3
70 4
71 4
72 2
73 4
74 5
75 3
76 4
77 4
78 4
79 5
80 4
81 4
82 2
83 3
84 3
85 3
86 2
87 4
88 2
89 2
90 4
91 4
92 4
93 4
94 4
95 5
96 4
97 5
98 2
99 4
100 2
101 2
102 3
103 5
104 4
105 4
106 2
107 3
108 4
109 3
110 2
111 4
112 4
113 4
114 4
115 2
116 3
117 4
118 4
119 5
120 4
121 2
122 4
123 4
124 3
125 4
126 3
127 4
128 2
129 4
130 2
131 4
132 4
133 3
134 4
135 3
136 3
137 3
138 4
139 3
140 3
141 3
142 4
143 4
144 5
145 3
146 4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Gender PersonalStandards
32.59748 -0.21341 0.17470
ParentalExpectation Doubts LeaderPreference
0.05336 -0.22227 1.40057
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-17.8468 -2.1934 0.7019 3.2514 10.1951
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 32.59748 3.27663 9.948 < 2e-16 ***
Gender -0.21341 0.87561 -0.244 0.80780
PersonalStandards 0.17470 0.10420 1.677 0.09586 .
ParentalExpectation 0.05336 0.13127 0.407 0.68498
Doubts -0.22227 0.15678 -1.418 0.15850
LeaderPreference 1.40057 0.48395 2.894 0.00441 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.999 on 140 degrees of freedom
Multiple R-squared: 0.1357, Adjusted R-squared: 0.1049
F-statistic: 4.397 on 5 and 140 DF, p-value: 0.0009485
> 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.22826364 0.45652729 0.77173636
[2,] 0.11158578 0.22317156 0.88841422
[3,] 0.05038172 0.10076344 0.94961828
[4,] 0.28443867 0.56887735 0.71556133
[5,] 0.32047943 0.64095885 0.67952057
[6,] 0.33973976 0.67947953 0.66026024
[7,] 0.24844782 0.49689563 0.75155218
[8,] 0.18097659 0.36195318 0.81902341
[9,] 0.74139219 0.51721563 0.25860781
[10,] 0.72309112 0.55381777 0.27690888
[11,] 0.67887153 0.64225694 0.32112847
[12,] 0.72491115 0.55017770 0.27508885
[13,] 0.72179849 0.55640303 0.27820151
[14,] 0.67312462 0.65375076 0.32687538
[15,] 0.60382223 0.79235553 0.39617777
[16,] 0.56423650 0.87152701 0.43576350
[17,] 0.50518556 0.98962888 0.49481444
[18,] 0.43520535 0.87041071 0.56479465
[19,] 0.47080637 0.94161274 0.52919363
[20,] 0.73277402 0.53445195 0.26722598
[21,] 0.67898725 0.64202551 0.32101275
[22,] 0.63083265 0.73833471 0.36916735
[23,] 0.57071202 0.85857596 0.42928798
[24,] 0.51825010 0.96349980 0.48174990
[25,] 0.45928453 0.91856905 0.54071547
[26,] 0.40188460 0.80376921 0.59811540
[27,] 0.38102346 0.76204692 0.61897654
[28,] 0.35520455 0.71040910 0.64479545
[29,] 0.42808625 0.85617249 0.57191375
[30,] 0.56538353 0.86923294 0.43461647
[31,] 0.52518071 0.94963858 0.47481929
[32,] 0.55162547 0.89674906 0.44837453
[33,] 0.59667553 0.80664893 0.40332447
[34,] 0.55152698 0.89694604 0.44847302
[35,] 0.50181957 0.99636086 0.49818043
[36,] 0.44948248 0.89896497 0.55051752
[37,] 0.40732068 0.81464137 0.59267932
[38,] 0.38913187 0.77826373 0.61086813
[39,] 0.33860052 0.67720104 0.66139948
[40,] 0.83039771 0.33920458 0.16960229
[41,] 0.82134471 0.35731058 0.17865529
[42,] 0.78926655 0.42146689 0.21073345
[43,] 0.77085517 0.45828966 0.22914483
[44,] 0.80463712 0.39072575 0.19536288
[45,] 0.77298754 0.45402492 0.22701246
[46,] 0.74029930 0.51940139 0.25970070
[47,] 0.71352656 0.57294689 0.28647344
[48,] 0.73391524 0.53216953 0.26608476
[49,] 0.70293037 0.59413925 0.29706963
[50,] 0.79980540 0.40038921 0.20019460
[51,] 0.76526747 0.46946505 0.23473253
[52,] 0.83740521 0.32518959 0.16259479
[53,] 0.80983667 0.38032666 0.19016333
[54,] 0.91323431 0.17353137 0.08676569
[55,] 0.91852173 0.16295653 0.08147827
[56,] 0.91264944 0.17470112 0.08735056
[57,] 0.89889762 0.20220476 0.10110238
[58,] 0.90712462 0.18575075 0.09287538
[59,] 0.88851390 0.22297220 0.11148610
[60,] 0.86439358 0.27121284 0.13560642
[61,] 0.91033344 0.17933312 0.08966656
[62,] 0.89250904 0.21498192 0.10749096
[63,] 0.87268297 0.25463405 0.12731703
[64,] 0.84825682 0.30348636 0.15174318
[65,] 0.82219087 0.35561826 0.17780913
[66,] 0.79659056 0.40681889 0.20340944
[67,] 0.76006614 0.47986773 0.23993386
[68,] 0.72151821 0.55696357 0.27848179
[69,] 0.69753430 0.60493141 0.30246570
[70,] 0.66132311 0.67735379 0.33867689
[71,] 0.63282572 0.73434857 0.36717428
[72,] 0.61464409 0.77071182 0.38535591
[73,] 0.58916218 0.82167563 0.41083782
[74,] 0.54925779 0.90148442 0.45074221
[75,] 0.50762343 0.98475314 0.49237657
[76,] 0.49956078 0.99912157 0.50043922
[77,] 0.45256984 0.90513969 0.54743016
[78,] 0.43236202 0.86472404 0.56763798
[79,] 0.47867149 0.95734298 0.52132851
[80,] 0.46554141 0.93108282 0.53445859
[81,] 0.41618834 0.83237669 0.58381166
[82,] 0.39381024 0.78762048 0.60618976
[83,] 0.38309100 0.76618199 0.61690900
[84,] 0.40125251 0.80250502 0.59874749
[85,] 0.36746745 0.73493490 0.63253255
[86,] 0.49903137 0.99806274 0.50096863
[87,] 0.51746792 0.96506416 0.48253208
[88,] 0.79466746 0.41066509 0.20533254
[89,] 0.76838042 0.46323916 0.23161958
[90,] 0.81018332 0.37963336 0.18981668
[91,] 0.77148324 0.45703353 0.22851676
[92,] 0.75334497 0.49331006 0.24665503
[93,] 0.71039229 0.57921541 0.28960771
[94,] 0.66598039 0.66803921 0.33401961
[95,] 0.64982506 0.70034989 0.35017494
[96,] 0.60748067 0.78503867 0.39251933
[97,] 0.59823719 0.80352563 0.40176281
[98,] 0.55732914 0.88534171 0.44267086
[99,] 0.50290811 0.99418379 0.49709189
[100,] 0.46285485 0.92570969 0.53714515
[101,] 0.41365188 0.82730376 0.58634812
[102,] 0.36474389 0.72948778 0.63525611
[103,] 0.34829475 0.69658950 0.65170525
[104,] 0.53167579 0.93664841 0.46832421
[105,] 0.54684143 0.90631714 0.45315857
[106,] 0.48580629 0.97161258 0.51419371
[107,] 0.48782676 0.97565351 0.51217324
[108,] 0.45903147 0.91806295 0.54096853
[109,] 0.40383583 0.80767165 0.59616417
[110,] 0.36670676 0.73341352 0.63329324
[111,] 0.37752236 0.75504471 0.62247764
[112,] 0.57270979 0.85458043 0.42729021
[113,] 0.51670297 0.96659406 0.48329703
[114,] 0.44598887 0.89197774 0.55401113
[115,] 0.40358381 0.80716763 0.59641619
[116,] 0.34373158 0.68746316 0.65626842
[117,] 0.30318967 0.60637934 0.69681033
[118,] 0.24687816 0.49375633 0.75312184
[119,] 0.23017202 0.46034405 0.76982798
[120,] 0.17320610 0.34641220 0.82679390
[121,] 0.14727333 0.29454667 0.85272667
[122,] 0.14064619 0.28129238 0.85935381
[123,] 0.10622731 0.21245462 0.89377269
[124,] 0.22509498 0.45018997 0.77490502
[125,] 0.16065782 0.32131564 0.83934218
[126,] 0.15102999 0.30205998 0.84897001
[127,] 0.09726325 0.19452649 0.90273675
[128,] 0.06335974 0.12671947 0.93664026
[129,] 0.03079943 0.06159887 0.96920057
> postscript(file="/var/www/html/rcomp/tmp/1n37p1292012634.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/2n37p1292012634.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/3n37p1292012634.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/4xvps1292012634.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/5xvps1292012634.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 = 146
Frequency = 1
1 2 3 4 5 6
1.24676347 -3.15380859 -3.05226239 2.11362159 1.76969112 1.89955599
7 8 9 10 11 12
-0.14641392 0.79859177 2.52539666 3.71765050 2.06729950 -10.00310900
13 14 15 16 17 18
-10.00310900 -2.50541419 -1.89795893 -2.13483340 -13.85675686 4.38983940
19 20 21 22 23 24
1.11024671 5.22855638 2.83321874 -2.52298863 -0.79978761 1.46484887
25 26 27 28 29 30
-0.19775370 0.65749857 5.05385944 -12.02087037 -1.90895828 -2.26053773
31 32 33 34 35 36
1.03128038 0.55379131 1.16342355 -1.37287102 -5.20135757 2.99630902
37 38 39 40 41 42
6.00935849 8.97768601 2.88134890 -7.32545750 -8.32545750 -2.58214346
43 44 45 46 47 48
-1.32111086 -0.17938501 0.76090350 5.45356987 0.50419221 -17.84675542
49 50 51 52 53 54
3.25139057 -1.60774522 3.09625081 6.37388609 -1.83001647 -1.28234950
55 56 57 58 59 60
2.52342253 -6.08205000 -2.11778947 8.70568020 1.10204107 8.57662631
61 62 63 64 65 66
1.99312553 -11.02173200 -5.17117937 4.73946227 3.32270791 6.06729869
67 68 69 70 71 72
-0.45702030 0.95134148 8.96915351 -1.58516616 2.44041027 1.64954725
73 74 75 76 77 78
-0.59337180 -1.90377452 0.41148429 0.50782221 3.79343415 2.58434783
79 80 81 82 83 84
3.41364535 4.07006707 -3.42784000 1.89160466 1.82003300 3.25139057
85 86 87 88 89 90
-1.84099049 -4.76941883 -4.83301383 6.42788331 0.03498629 4.41372206
91 92 93 94 95 96
5.13229598 5.84144962 -1.24588314 10.19508082 3.65617534 -11.82475681
97 98 99 100 101 102
3.23960711 -7.57544019 0.49166597 -3.12873744 1.87286697 -0.98482520
103 104 105 106 107 108
3.77146232 -2.05281832 -6.59064991 -1.61143398 0.79069183 3.54563786
109 110 111 112 113 114
2.41632884 2.89326045 -5.17212509 -9.65066719 5.91581499 0.96757516
115 116 117 118 119 120
5.63801810 5.53982146 -1.86351817 3.87342363 5.50482557 -10.34879616
121 122 123 124 125 126
-2.65382534 -1.05916443 3.54724226 -2.21288671 -3.85193765 -1.20291060
127 128 129 130 131 132
2.08034969 0.30064600 -3.83573002 -3.42213382 0.74635247 -9.23909578
133 134 135 136 137 138
5.66996678 -4.88330433 0.19566200 -1.43355356 3.81329703 1.45450902
139 140 141 142 143 144
8.06995766 -3.70198083 5.23165579 -0.18991706 5.19563667 2.23960711
145 146
-3.81173267 -10.73176844
> postscript(file="/var/www/html/rcomp/tmp/684od1292012634.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 = 146
Frequency = 1
lag(myerror, k = 1) myerror
0 1.24676347 NA
1 -3.15380859 1.24676347
2 -3.05226239 -3.15380859
3 2.11362159 -3.05226239
4 1.76969112 2.11362159
5 1.89955599 1.76969112
6 -0.14641392 1.89955599
7 0.79859177 -0.14641392
8 2.52539666 0.79859177
9 3.71765050 2.52539666
10 2.06729950 3.71765050
11 -10.00310900 2.06729950
12 -10.00310900 -10.00310900
13 -2.50541419 -10.00310900
14 -1.89795893 -2.50541419
15 -2.13483340 -1.89795893
16 -13.85675686 -2.13483340
17 4.38983940 -13.85675686
18 1.11024671 4.38983940
19 5.22855638 1.11024671
20 2.83321874 5.22855638
21 -2.52298863 2.83321874
22 -0.79978761 -2.52298863
23 1.46484887 -0.79978761
24 -0.19775370 1.46484887
25 0.65749857 -0.19775370
26 5.05385944 0.65749857
27 -12.02087037 5.05385944
28 -1.90895828 -12.02087037
29 -2.26053773 -1.90895828
30 1.03128038 -2.26053773
31 0.55379131 1.03128038
32 1.16342355 0.55379131
33 -1.37287102 1.16342355
34 -5.20135757 -1.37287102
35 2.99630902 -5.20135757
36 6.00935849 2.99630902
37 8.97768601 6.00935849
38 2.88134890 8.97768601
39 -7.32545750 2.88134890
40 -8.32545750 -7.32545750
41 -2.58214346 -8.32545750
42 -1.32111086 -2.58214346
43 -0.17938501 -1.32111086
44 0.76090350 -0.17938501
45 5.45356987 0.76090350
46 0.50419221 5.45356987
47 -17.84675542 0.50419221
48 3.25139057 -17.84675542
49 -1.60774522 3.25139057
50 3.09625081 -1.60774522
51 6.37388609 3.09625081
52 -1.83001647 6.37388609
53 -1.28234950 -1.83001647
54 2.52342253 -1.28234950
55 -6.08205000 2.52342253
56 -2.11778947 -6.08205000
57 8.70568020 -2.11778947
58 1.10204107 8.70568020
59 8.57662631 1.10204107
60 1.99312553 8.57662631
61 -11.02173200 1.99312553
62 -5.17117937 -11.02173200
63 4.73946227 -5.17117937
64 3.32270791 4.73946227
65 6.06729869 3.32270791
66 -0.45702030 6.06729869
67 0.95134148 -0.45702030
68 8.96915351 0.95134148
69 -1.58516616 8.96915351
70 2.44041027 -1.58516616
71 1.64954725 2.44041027
72 -0.59337180 1.64954725
73 -1.90377452 -0.59337180
74 0.41148429 -1.90377452
75 0.50782221 0.41148429
76 3.79343415 0.50782221
77 2.58434783 3.79343415
78 3.41364535 2.58434783
79 4.07006707 3.41364535
80 -3.42784000 4.07006707
81 1.89160466 -3.42784000
82 1.82003300 1.89160466
83 3.25139057 1.82003300
84 -1.84099049 3.25139057
85 -4.76941883 -1.84099049
86 -4.83301383 -4.76941883
87 6.42788331 -4.83301383
88 0.03498629 6.42788331
89 4.41372206 0.03498629
90 5.13229598 4.41372206
91 5.84144962 5.13229598
92 -1.24588314 5.84144962
93 10.19508082 -1.24588314
94 3.65617534 10.19508082
95 -11.82475681 3.65617534
96 3.23960711 -11.82475681
97 -7.57544019 3.23960711
98 0.49166597 -7.57544019
99 -3.12873744 0.49166597
100 1.87286697 -3.12873744
101 -0.98482520 1.87286697
102 3.77146232 -0.98482520
103 -2.05281832 3.77146232
104 -6.59064991 -2.05281832
105 -1.61143398 -6.59064991
106 0.79069183 -1.61143398
107 3.54563786 0.79069183
108 2.41632884 3.54563786
109 2.89326045 2.41632884
110 -5.17212509 2.89326045
111 -9.65066719 -5.17212509
112 5.91581499 -9.65066719
113 0.96757516 5.91581499
114 5.63801810 0.96757516
115 5.53982146 5.63801810
116 -1.86351817 5.53982146
117 3.87342363 -1.86351817
118 5.50482557 3.87342363
119 -10.34879616 5.50482557
120 -2.65382534 -10.34879616
121 -1.05916443 -2.65382534
122 3.54724226 -1.05916443
123 -2.21288671 3.54724226
124 -3.85193765 -2.21288671
125 -1.20291060 -3.85193765
126 2.08034969 -1.20291060
127 0.30064600 2.08034969
128 -3.83573002 0.30064600
129 -3.42213382 -3.83573002
130 0.74635247 -3.42213382
131 -9.23909578 0.74635247
132 5.66996678 -9.23909578
133 -4.88330433 5.66996678
134 0.19566200 -4.88330433
135 -1.43355356 0.19566200
136 3.81329703 -1.43355356
137 1.45450902 3.81329703
138 8.06995766 1.45450902
139 -3.70198083 8.06995766
140 5.23165579 -3.70198083
141 -0.18991706 5.23165579
142 5.19563667 -0.18991706
143 2.23960711 5.19563667
144 -3.81173267 2.23960711
145 -10.73176844 -3.81173267
146 NA -10.73176844
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -3.15380859 1.24676347
[2,] -3.05226239 -3.15380859
[3,] 2.11362159 -3.05226239
[4,] 1.76969112 2.11362159
[5,] 1.89955599 1.76969112
[6,] -0.14641392 1.89955599
[7,] 0.79859177 -0.14641392
[8,] 2.52539666 0.79859177
[9,] 3.71765050 2.52539666
[10,] 2.06729950 3.71765050
[11,] -10.00310900 2.06729950
[12,] -10.00310900 -10.00310900
[13,] -2.50541419 -10.00310900
[14,] -1.89795893 -2.50541419
[15,] -2.13483340 -1.89795893
[16,] -13.85675686 -2.13483340
[17,] 4.38983940 -13.85675686
[18,] 1.11024671 4.38983940
[19,] 5.22855638 1.11024671
[20,] 2.83321874 5.22855638
[21,] -2.52298863 2.83321874
[22,] -0.79978761 -2.52298863
[23,] 1.46484887 -0.79978761
[24,] -0.19775370 1.46484887
[25,] 0.65749857 -0.19775370
[26,] 5.05385944 0.65749857
[27,] -12.02087037 5.05385944
[28,] -1.90895828 -12.02087037
[29,] -2.26053773 -1.90895828
[30,] 1.03128038 -2.26053773
[31,] 0.55379131 1.03128038
[32,] 1.16342355 0.55379131
[33,] -1.37287102 1.16342355
[34,] -5.20135757 -1.37287102
[35,] 2.99630902 -5.20135757
[36,] 6.00935849 2.99630902
[37,] 8.97768601 6.00935849
[38,] 2.88134890 8.97768601
[39,] -7.32545750 2.88134890
[40,] -8.32545750 -7.32545750
[41,] -2.58214346 -8.32545750
[42,] -1.32111086 -2.58214346
[43,] -0.17938501 -1.32111086
[44,] 0.76090350 -0.17938501
[45,] 5.45356987 0.76090350
[46,] 0.50419221 5.45356987
[47,] -17.84675542 0.50419221
[48,] 3.25139057 -17.84675542
[49,] -1.60774522 3.25139057
[50,] 3.09625081 -1.60774522
[51,] 6.37388609 3.09625081
[52,] -1.83001647 6.37388609
[53,] -1.28234950 -1.83001647
[54,] 2.52342253 -1.28234950
[55,] -6.08205000 2.52342253
[56,] -2.11778947 -6.08205000
[57,] 8.70568020 -2.11778947
[58,] 1.10204107 8.70568020
[59,] 8.57662631 1.10204107
[60,] 1.99312553 8.57662631
[61,] -11.02173200 1.99312553
[62,] -5.17117937 -11.02173200
[63,] 4.73946227 -5.17117937
[64,] 3.32270791 4.73946227
[65,] 6.06729869 3.32270791
[66,] -0.45702030 6.06729869
[67,] 0.95134148 -0.45702030
[68,] 8.96915351 0.95134148
[69,] -1.58516616 8.96915351
[70,] 2.44041027 -1.58516616
[71,] 1.64954725 2.44041027
[72,] -0.59337180 1.64954725
[73,] -1.90377452 -0.59337180
[74,] 0.41148429 -1.90377452
[75,] 0.50782221 0.41148429
[76,] 3.79343415 0.50782221
[77,] 2.58434783 3.79343415
[78,] 3.41364535 2.58434783
[79,] 4.07006707 3.41364535
[80,] -3.42784000 4.07006707
[81,] 1.89160466 -3.42784000
[82,] 1.82003300 1.89160466
[83,] 3.25139057 1.82003300
[84,] -1.84099049 3.25139057
[85,] -4.76941883 -1.84099049
[86,] -4.83301383 -4.76941883
[87,] 6.42788331 -4.83301383
[88,] 0.03498629 6.42788331
[89,] 4.41372206 0.03498629
[90,] 5.13229598 4.41372206
[91,] 5.84144962 5.13229598
[92,] -1.24588314 5.84144962
[93,] 10.19508082 -1.24588314
[94,] 3.65617534 10.19508082
[95,] -11.82475681 3.65617534
[96,] 3.23960711 -11.82475681
[97,] -7.57544019 3.23960711
[98,] 0.49166597 -7.57544019
[99,] -3.12873744 0.49166597
[100,] 1.87286697 -3.12873744
[101,] -0.98482520 1.87286697
[102,] 3.77146232 -0.98482520
[103,] -2.05281832 3.77146232
[104,] -6.59064991 -2.05281832
[105,] -1.61143398 -6.59064991
[106,] 0.79069183 -1.61143398
[107,] 3.54563786 0.79069183
[108,] 2.41632884 3.54563786
[109,] 2.89326045 2.41632884
[110,] -5.17212509 2.89326045
[111,] -9.65066719 -5.17212509
[112,] 5.91581499 -9.65066719
[113,] 0.96757516 5.91581499
[114,] 5.63801810 0.96757516
[115,] 5.53982146 5.63801810
[116,] -1.86351817 5.53982146
[117,] 3.87342363 -1.86351817
[118,] 5.50482557 3.87342363
[119,] -10.34879616 5.50482557
[120,] -2.65382534 -10.34879616
[121,] -1.05916443 -2.65382534
[122,] 3.54724226 -1.05916443
[123,] -2.21288671 3.54724226
[124,] -3.85193765 -2.21288671
[125,] -1.20291060 -3.85193765
[126,] 2.08034969 -1.20291060
[127,] 0.30064600 2.08034969
[128,] -3.83573002 0.30064600
[129,] -3.42213382 -3.83573002
[130,] 0.74635247 -3.42213382
[131,] -9.23909578 0.74635247
[132,] 5.66996678 -9.23909578
[133,] -4.88330433 5.66996678
[134,] 0.19566200 -4.88330433
[135,] -1.43355356 0.19566200
[136,] 3.81329703 -1.43355356
[137,] 1.45450902 3.81329703
[138,] 8.06995766 1.45450902
[139,] -3.70198083 8.06995766
[140,] 5.23165579 -3.70198083
[141,] -0.18991706 5.23165579
[142,] 5.19563667 -0.18991706
[143,] 2.23960711 5.19563667
[144,] -3.81173267 2.23960711
[145,] -10.73176844 -3.81173267
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -3.15380859 1.24676347
2 -3.05226239 -3.15380859
3 2.11362159 -3.05226239
4 1.76969112 2.11362159
5 1.89955599 1.76969112
6 -0.14641392 1.89955599
7 0.79859177 -0.14641392
8 2.52539666 0.79859177
9 3.71765050 2.52539666
10 2.06729950 3.71765050
11 -10.00310900 2.06729950
12 -10.00310900 -10.00310900
13 -2.50541419 -10.00310900
14 -1.89795893 -2.50541419
15 -2.13483340 -1.89795893
16 -13.85675686 -2.13483340
17 4.38983940 -13.85675686
18 1.11024671 4.38983940
19 5.22855638 1.11024671
20 2.83321874 5.22855638
21 -2.52298863 2.83321874
22 -0.79978761 -2.52298863
23 1.46484887 -0.79978761
24 -0.19775370 1.46484887
25 0.65749857 -0.19775370
26 5.05385944 0.65749857
27 -12.02087037 5.05385944
28 -1.90895828 -12.02087037
29 -2.26053773 -1.90895828
30 1.03128038 -2.26053773
31 0.55379131 1.03128038
32 1.16342355 0.55379131
33 -1.37287102 1.16342355
34 -5.20135757 -1.37287102
35 2.99630902 -5.20135757
36 6.00935849 2.99630902
37 8.97768601 6.00935849
38 2.88134890 8.97768601
39 -7.32545750 2.88134890
40 -8.32545750 -7.32545750
41 -2.58214346 -8.32545750
42 -1.32111086 -2.58214346
43 -0.17938501 -1.32111086
44 0.76090350 -0.17938501
45 5.45356987 0.76090350
46 0.50419221 5.45356987
47 -17.84675542 0.50419221
48 3.25139057 -17.84675542
49 -1.60774522 3.25139057
50 3.09625081 -1.60774522
51 6.37388609 3.09625081
52 -1.83001647 6.37388609
53 -1.28234950 -1.83001647
54 2.52342253 -1.28234950
55 -6.08205000 2.52342253
56 -2.11778947 -6.08205000
57 8.70568020 -2.11778947
58 1.10204107 8.70568020
59 8.57662631 1.10204107
60 1.99312553 8.57662631
61 -11.02173200 1.99312553
62 -5.17117937 -11.02173200
63 4.73946227 -5.17117937
64 3.32270791 4.73946227
65 6.06729869 3.32270791
66 -0.45702030 6.06729869
67 0.95134148 -0.45702030
68 8.96915351 0.95134148
69 -1.58516616 8.96915351
70 2.44041027 -1.58516616
71 1.64954725 2.44041027
72 -0.59337180 1.64954725
73 -1.90377452 -0.59337180
74 0.41148429 -1.90377452
75 0.50782221 0.41148429
76 3.79343415 0.50782221
77 2.58434783 3.79343415
78 3.41364535 2.58434783
79 4.07006707 3.41364535
80 -3.42784000 4.07006707
81 1.89160466 -3.42784000
82 1.82003300 1.89160466
83 3.25139057 1.82003300
84 -1.84099049 3.25139057
85 -4.76941883 -1.84099049
86 -4.83301383 -4.76941883
87 6.42788331 -4.83301383
88 0.03498629 6.42788331
89 4.41372206 0.03498629
90 5.13229598 4.41372206
91 5.84144962 5.13229598
92 -1.24588314 5.84144962
93 10.19508082 -1.24588314
94 3.65617534 10.19508082
95 -11.82475681 3.65617534
96 3.23960711 -11.82475681
97 -7.57544019 3.23960711
98 0.49166597 -7.57544019
99 -3.12873744 0.49166597
100 1.87286697 -3.12873744
101 -0.98482520 1.87286697
102 3.77146232 -0.98482520
103 -2.05281832 3.77146232
104 -6.59064991 -2.05281832
105 -1.61143398 -6.59064991
106 0.79069183 -1.61143398
107 3.54563786 0.79069183
108 2.41632884 3.54563786
109 2.89326045 2.41632884
110 -5.17212509 2.89326045
111 -9.65066719 -5.17212509
112 5.91581499 -9.65066719
113 0.96757516 5.91581499
114 5.63801810 0.96757516
115 5.53982146 5.63801810
116 -1.86351817 5.53982146
117 3.87342363 -1.86351817
118 5.50482557 3.87342363
119 -10.34879616 5.50482557
120 -2.65382534 -10.34879616
121 -1.05916443 -2.65382534
122 3.54724226 -1.05916443
123 -2.21288671 3.54724226
124 -3.85193765 -2.21288671
125 -1.20291060 -3.85193765
126 2.08034969 -1.20291060
127 0.30064600 2.08034969
128 -3.83573002 0.30064600
129 -3.42213382 -3.83573002
130 0.74635247 -3.42213382
131 -9.23909578 0.74635247
132 5.66996678 -9.23909578
133 -4.88330433 5.66996678
134 0.19566200 -4.88330433
135 -1.43355356 0.19566200
136 3.81329703 -1.43355356
137 1.45450902 3.81329703
138 8.06995766 1.45450902
139 -3.70198083 8.06995766
140 5.23165579 -3.70198083
141 -0.18991706 5.23165579
142 5.19563667 -0.18991706
143 2.23960711 5.19563667
144 -3.81173267 2.23960711
145 -10.73176844 -3.81173267
> 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/784od1292012634.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/81dng1292012634.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/91dng1292012634.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/10t44j1292012634.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/11f5l71292012634.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/120n1u1292012634.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/13exz31292012634.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/14iyg91292012634.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/15lgex1292012634.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/16ohdl1292012634.tab")
+ }
>
> try(system("convert tmp/1n37p1292012634.ps tmp/1n37p1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/2n37p1292012634.ps tmp/2n37p1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/3n37p1292012634.ps tmp/3n37p1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/4xvps1292012634.ps tmp/4xvps1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/5xvps1292012634.ps tmp/5xvps1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/684od1292012634.ps tmp/684od1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/784od1292012634.ps tmp/784od1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/81dng1292012634.ps tmp/81dng1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/91dng1292012634.ps tmp/91dng1292012634.png",intern=TRUE))
character(0)
> try(system("convert tmp/10t44j1292012634.ps tmp/10t44j1292012634.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.862 1.825 8.718