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(24
+ ,14
+ ,11
+ ,24
+ ,25
+ ,11
+ ,7
+ ,25
+ ,17
+ ,6
+ ,17
+ ,30
+ ,18
+ ,12
+ ,10
+ ,19
+ ,18
+ ,8
+ ,12
+ ,22
+ ,16
+ ,10
+ ,12
+ ,22
+ ,20
+ ,10
+ ,11
+ ,25
+ ,16
+ ,11
+ ,11
+ ,23
+ ,18
+ ,16
+ ,12
+ ,17
+ ,17
+ ,11
+ ,13
+ ,21
+ ,23
+ ,13
+ ,14
+ ,19
+ ,30
+ ,12
+ ,16
+ ,19
+ ,23
+ ,8
+ ,11
+ ,15
+ ,18
+ ,12
+ ,10
+ ,16
+ ,15
+ ,11
+ ,11
+ ,23
+ ,12
+ ,4
+ ,15
+ ,27
+ ,21
+ ,9
+ ,9
+ ,22
+ ,15
+ ,8
+ ,11
+ ,14
+ ,20
+ ,8
+ ,17
+ ,22
+ ,31
+ ,14
+ ,17
+ ,23
+ ,27
+ ,15
+ ,11
+ ,23
+ ,34
+ ,16
+ ,18
+ ,21
+ ,21
+ ,9
+ ,14
+ ,19
+ ,31
+ ,14
+ ,10
+ ,18
+ ,19
+ ,11
+ ,11
+ ,20
+ ,16
+ ,8
+ ,15
+ ,23
+ ,20
+ ,9
+ ,15
+ ,25
+ ,21
+ ,9
+ ,13
+ ,19
+ ,22
+ ,9
+ ,16
+ ,24
+ ,17
+ ,9
+ ,13
+ ,22
+ ,24
+ ,10
+ ,9
+ ,25
+ ,25
+ ,16
+ ,18
+ ,26
+ ,26
+ ,11
+ ,18
+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,'Doubts'
+ ,'ParentalExpectations'
+ ,'PersonalStandards')
+ ,1:159))
> y <- array(NA,dim=c(4,159),dimnames=list(c('ConcernMistakes','Doubts','ParentalExpectations','PersonalStandards'),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 = '3'
> #'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
ParentalExpectations ConcernMistakes Doubts PersonalStandards
1 11 24 14 24
2 7 25 11 25
3 17 17 6 30
4 10 18 12 19
5 12 18 8 22
6 12 16 10 22
7 11 20 10 25
8 11 16 11 23
9 12 18 16 17
10 13 17 11 21
11 14 23 13 19
12 16 30 12 19
13 11 23 8 15
14 10 18 12 16
15 11 15 11 23
16 15 12 4 27
17 9 21 9 22
18 11 15 8 14
19 17 20 8 22
20 17 31 14 23
21 11 27 15 23
22 18 34 16 21
23 14 21 9 19
24 10 31 14 18
25 11 19 11 20
26 15 16 8 23
27 15 20 9 25
28 13 21 9 19
29 16 22 9 24
30 13 17 9 22
31 9 24 10 25
32 18 25 16 26
33 18 26 11 29
34 12 25 8 32
35 17 17 9 25
36 9 32 16 29
37 9 33 11 28
38 12 13 16 17
39 18 32 12 28
40 12 25 12 29
41 18 29 14 26
42 14 22 9 25
43 15 18 10 14
44 16 17 9 25
45 10 20 10 26
46 11 15 12 20
47 14 20 14 18
48 9 33 14 32
49 12 29 10 25
50 17 23 14 25
51 5 26 16 23
52 12 18 9 21
53 12 20 10 20
54 6 11 6 15
55 24 28 8 30
56 12 26 13 24
57 12 22 10 26
58 14 17 8 24
59 7 12 7 22
60 13 14 15 14
61 12 17 9 24
62 13 21 10 24
63 14 19 12 24
64 8 18 13 24
65 11 10 10 19
66 9 29 11 31
67 11 31 8 22
68 13 19 9 27
69 10 9 13 19
70 11 20 11 25
71 12 28 8 20
72 9 19 9 21
73 15 30 9 27
74 18 29 15 23
75 15 26 9 25
76 12 23 10 20
77 13 13 14 21
78 14 21 12 22
79 10 19 12 23
80 13 28 11 25
81 13 23 14 25
82 11 18 6 17
83 13 21 12 19
84 16 20 8 25
85 8 23 14 19
86 16 21 11 20
87 11 21 10 26
88 9 15 14 23
89 16 28 12 27
90 12 19 10 17
91 14 26 14 17
92 8 10 5 19
93 9 16 11 17
94 15 22 10 22
95 11 19 9 21
96 21 31 10 32
97 14 31 16 21
98 18 29 13 21
99 12 19 9 18
100 13 22 10 18
101 15 23 10 23
102 12 15 7 19
103 19 20 9 20
104 15 18 8 21
105 11 23 14 20
106 11 25 14 17
107 10 21 8 18
108 13 24 9 19
109 15 25 14 22
110 12 17 14 15
111 12 13 8 14
112 16 28 8 18
113 9 21 8 24
114 18 25 7 35
115 8 9 6 29
116 13 16 8 21
117 17 19 6 25
118 9 17 11 20
119 15 25 14 22
120 8 20 11 13
121 7 29 11 26
122 12 14 11 17
123 14 22 14 25
124 6 15 8 20
125 8 19 20 19
126 17 20 11 21
127 10 15 8 22
128 11 20 11 24
129 14 18 10 21
130 11 33 14 26
131 13 22 11 24
132 12 16 9 16
133 11 17 9 23
134 9 16 8 18
135 12 21 10 16
136 20 26 13 26
137 12 18 13 19
138 13 18 12 21
139 12 17 8 21
140 12 22 13 22
141 9 30 14 23
142 15 30 12 29
143 24 24 14 21
144 7 21 15 21
145 17 21 13 23
146 11 29 16 27
147 17 31 9 25
148 11 20 9 21
149 12 16 9 10
150 14 22 8 20
151 11 20 7 26
152 16 28 16 24
153 21 38 11 29
154 14 22 9 19
155 20 20 11 24
156 13 17 9 19
157 11 28 14 24
158 15 22 13 22
159 19 31 16 17
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) ConcernMistakes Doubts PersonalStandards
8.09148 0.19478 -0.11970 0.08415
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.17600 -2.14137 0.01841 1.90017 11.14246
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.09148 1.73460 4.665 6.63e-06 ***
ConcernMistakes 0.19478 0.05590 3.484 0.000642 ***
Doubts -0.11970 0.10346 -1.157 0.249101
PersonalStandards 0.08415 0.06973 1.207 0.229322
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.247 on 155 degrees of freedom
Multiple R-squared: 0.1288, Adjusted R-squared: 0.112
F-statistic: 7.64 on 3 and 155 DF, p-value: 8.511e-05
> 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.13886537 0.27773075 0.8611346
[2,] 0.13496736 0.26993473 0.8650326
[3,] 0.12422352 0.24844704 0.8757765
[4,] 0.07265146 0.14530291 0.9273485
[5,] 0.25761604 0.51523209 0.7423840
[6,] 0.35743987 0.71487973 0.6425601
[7,] 0.34524218 0.69048436 0.6547578
[8,] 0.27362232 0.54724464 0.7263777
[9,] 0.20084002 0.40168005 0.7991600
[10,] 0.15592605 0.31185211 0.8440739
[11,] 0.17794053 0.35588107 0.8220595
[12,] 0.12815226 0.25630453 0.8718477
[13,] 0.18311939 0.36623878 0.8168806
[14,] 0.22349956 0.44699912 0.7765004
[15,] 0.18339571 0.36679142 0.8166043
[16,] 0.22461580 0.44923159 0.7753842
[17,] 0.17971835 0.35943671 0.8202816
[18,] 0.19989178 0.39978357 0.8001082
[19,] 0.15711268 0.31422536 0.8428873
[20,] 0.14428709 0.28857419 0.8557129
[21,] 0.11733468 0.23466937 0.8826653
[22,] 0.08741544 0.17483088 0.9125846
[23,] 0.07533062 0.15066123 0.9246694
[24,] 0.05520123 0.11040247 0.9447988
[25,] 0.09553041 0.19106083 0.9044696
[26,] 0.14297480 0.28594960 0.8570252
[27,] 0.13646599 0.27293198 0.8635340
[28,] 0.15627246 0.31254493 0.8437275
[29,] 0.18105919 0.36211837 0.8189408
[30,] 0.27915703 0.55831405 0.7208430
[31,] 0.38162215 0.76324431 0.6183778
[32,] 0.33405913 0.66811825 0.6659409
[33,] 0.35878542 0.71757085 0.6412146
[34,] 0.32444742 0.64889483 0.6755526
[35,] 0.36293966 0.72587933 0.6370603
[36,] 0.31480127 0.62960255 0.6851987
[37,] 0.31408306 0.62816612 0.6859169
[38,] 0.30941395 0.61882790 0.6905860
[39,] 0.31190726 0.62381452 0.6880927
[40,] 0.27219206 0.54438412 0.7278079
[41,] 0.24477772 0.48955545 0.7552223
[42,] 0.33637189 0.67274378 0.6636281
[43,] 0.31016477 0.62032953 0.6898352
[44,] 0.33690220 0.67380441 0.6630978
[45,] 0.58377414 0.83245172 0.4162259
[46,] 0.53790956 0.92418087 0.4620904
[47,] 0.49088254 0.98176508 0.5091175
[48,] 0.59101576 0.81796848 0.4089842
[49,] 0.85392992 0.29214015 0.1460701
[50,] 0.83083214 0.33833573 0.1691679
[51,] 0.80513494 0.38973012 0.1948651
[52,] 0.77707576 0.44584849 0.2229242
[53,] 0.81658451 0.36683099 0.1834155
[54,] 0.80670019 0.38659961 0.1932998
[55,] 0.77369499 0.45261003 0.2263050
[56,] 0.73649425 0.52701151 0.2635058
[57,] 0.70574758 0.58850483 0.2942524
[58,] 0.72876187 0.54247626 0.2712381
[59,] 0.69067335 0.61865329 0.3093266
[60,] 0.77740459 0.44519083 0.2225954
[61,] 0.79195051 0.41609898 0.2080495
[62,] 0.75693308 0.48613384 0.2430669
[63,] 0.72299001 0.55401999 0.2770100
[64,] 0.69471027 0.61057947 0.3052897
[65,] 0.67477430 0.65045140 0.3252257
[66,] 0.68029724 0.63940553 0.3197028
[67,] 0.64438725 0.71122551 0.3556128
[68,] 0.67703369 0.64593263 0.3229663
[69,] 0.63930494 0.72139012 0.3606951
[70,] 0.60060590 0.79878821 0.3993941
[71,] 0.58458922 0.83082156 0.4154108
[72,] 0.54837351 0.90325297 0.4516265
[73,] 0.52390329 0.95219342 0.4760967
[74,] 0.49115325 0.98230649 0.5088468
[75,] 0.44535959 0.89071919 0.5546404
[76,] 0.40801660 0.81603319 0.5919834
[77,] 0.36601834 0.73203668 0.6339817
[78,] 0.35530516 0.71061032 0.6446948
[79,] 0.39392444 0.78784887 0.6060756
[80,] 0.40089715 0.80179430 0.5991029
[81,] 0.37741325 0.75482650 0.6225868
[82,] 0.35262778 0.70525556 0.6473722
[83,] 0.32165447 0.64330893 0.6783455
[84,] 0.28112470 0.56224939 0.7188753
[85,] 0.24855106 0.49710212 0.7514489
[86,] 0.24220489 0.48440978 0.7577951
[87,] 0.22259480 0.44518961 0.7774052
[88,] 0.20037006 0.40074011 0.7996299
[89,] 0.17558921 0.35117842 0.8244108
[90,] 0.22069668 0.44139336 0.7793033
[91,] 0.18967100 0.37934199 0.8103290
[92,] 0.20167529 0.40335058 0.7983247
[93,] 0.17029765 0.34059530 0.8297023
[94,] 0.14231829 0.28463658 0.8576817
[95,] 0.12264291 0.24528581 0.8773571
[96,] 0.10014965 0.20029931 0.8998503
[97,] 0.16748637 0.33497275 0.8325136
[98,] 0.15662870 0.31325740 0.8433713
[99,] 0.13592091 0.27184182 0.8640791
[100,] 0.11960359 0.23920718 0.8803964
[101,] 0.11298539 0.22597079 0.8870146
[102,] 0.09207804 0.18415608 0.9079220
[103,] 0.07788281 0.15576562 0.9221172
[104,] 0.06279440 0.12558880 0.9372056
[105,] 0.05079455 0.10158910 0.9492055
[106,] 0.04140408 0.08280816 0.9585959
[107,] 0.04861193 0.09722387 0.9513881
[108,] 0.04540099 0.09080198 0.9545990
[109,] 0.04311189 0.08622378 0.9568881
[110,] 0.03349409 0.06698817 0.9665059
[111,] 0.03710973 0.07421945 0.9628903
[112,] 0.03317203 0.06634407 0.9668280
[113,] 0.02638841 0.05277683 0.9736116
[114,] 0.03133855 0.06267710 0.9686614
[115,] 0.10063387 0.20126774 0.8993661
[116,] 0.08110208 0.16220416 0.9188979
[117,] 0.06489358 0.12978716 0.9351064
[118,] 0.10078174 0.20156348 0.8992183
[119,] 0.10110887 0.20221774 0.8988911
[120,] 0.11471024 0.22942049 0.8852898
[121,] 0.09523050 0.19046100 0.9047695
[122,] 0.07920892 0.15841785 0.9207911
[123,] 0.06339364 0.12678729 0.9366064
[124,] 0.08944328 0.17888656 0.9105567
[125,] 0.06794668 0.13589335 0.9320533
[126,] 0.05021842 0.10043684 0.9497816
[127,] 0.03767755 0.07535510 0.9623225
[128,] 0.03474947 0.06949894 0.9652505
[129,] 0.02604752 0.05209504 0.9739525
[130,] 0.04464712 0.08929424 0.9553529
[131,] 0.03133418 0.06266837 0.9686658
[132,] 0.02147766 0.04295532 0.9785223
[133,] 0.01425045 0.02850089 0.9857496
[134,] 0.00967131 0.01934262 0.9903287
[135,] 0.02883932 0.05767864 0.9711607
[136,] 0.01917428 0.03834857 0.9808257
[137,] 0.22900687 0.45801373 0.7709931
[138,] 0.37426283 0.74852566 0.6257372
[139,] 0.39695971 0.79391943 0.6030403
[140,] 0.50848060 0.98303881 0.4915194
[141,] 0.40897408 0.81794817 0.5910259
[142,] 0.36286399 0.72572798 0.6371360
[143,] 0.26539929 0.53079857 0.7346007
[144,] 0.17717305 0.35434610 0.8228269
[145,] 0.16893576 0.33787152 0.8310642
[146,] 0.09304846 0.18609691 0.9069515
> postscript(file="/var/www/rcomp/tmp/1q8hi1290277062.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/2ihgl1290277062.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/3ihgl1290277062.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/4ihgl1290277062.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/54ji11290277063.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 = 159
Frequency = 1
1 2 3 4 5
-2.1099934901 -6.7480078499 3.7909719331 -1.7599722073 -0.4912072492
6 7 8 9 10
0.1377371666 -1.8938210518 -0.8267178646 0.8871120965 1.1468071106
11 12 13 14 15
1.3858409946 1.9027097807 -1.8760345874 -1.5075199930 -0.6319413636
16 17 18 19 20
2.7779152387 -3.9558410453 -0.2336718413 4.1192397488 2.6107217410
21 22 23 24 25
-2.4904765481 3.4340851281 1.2966111690 -3.9685245684 -1.1585951533
26 27 28 29 30
2.8141950147 1.9864832413 0.2966111690 2.6810809775 0.8232649587
31 32 33 34 35
-4.6729270558 4.7663199465 3.7206126967 -2.6961501373 4.5708127443
36 37 38 39 40
-5.8495677748 -6.5586720722 1.8609946015 2.7558001357 -1.9649150954
41 42 43 44 45
3.7478225287 0.5969302394 3.4213900695 3.5708127443 -2.9779717899
46 47 48 49 50
-0.2597934424 2.1740169426 -6.5361879040 -2.6468095607 4.0006322728
51 52 53 54 55
-8.1760043402 -0.2873608042 -0.4730673612 -4.7781079892 8.8878218359
56 57 58 59 60
-1.6192421990 -1.3675247919 1.5352677756 -4.4422439501 2.7989746079
61 62 63 64 65
-0.3450365175 -0.0044468146 1.6244976011 -4.0610301910 0.5588483869
66 67 68 69 70
-6.0320182825 -4.0233017622 0.0129582661 0.1127120086 -1.7741253449
71 72 73 74 75
-2.2706707830 -3.4821373052 -0.1295832449 4.1199704499 0.8178242354
76 77 78 79 80
-1.0573968642 2.2850002352 1.4032460754 -2.2913516608 -1.3323373529
81 82 83 84 85
0.0006322728 -1.3098449724 0.6556982897 2.8667875345 -4.4944632985
86 87 88 89 90
3.4518518447 -2.1727482909 -2.2728542430 1.6190568778 -0.0258386459
91 92 93 94 95
1.0895086747 -3.0396301476 -2.3218134360 1.9690781606 -1.4821373052
96 97 98 99 100
5.3745822705 0.0184146311 4.0488805124 -0.2296850909 0.3056811130
101 102 103 104 105
1.6901509215 0.2258787612 6.4072369319 2.5929434889 -1.5786140366
106 107 108 109 110
-1.7157148243 -2.7389337998 -0.2877183340 1.8635314851 1.0107986599
111 112 113 114 115
1.1558811607 1.8976306932 -4.2438382284 2.9317019415 -3.5666653208
116 117 118 119 120
0.9824964909 3.8221726217 -2.7690421513 1.8635314851 -3.7643164875
121 122 123 124 125
-7.6112645920 1.0677395660 1.1954087738 -5.7385762700 -2.9971830532
126 127 128 129 130
4.5624776076 -1.9068777462 -1.6899746068 1.8323349027 -4.0312834753
131 132 133 134 135
-0.0795276088 0.5229458884 -1.2608857794 -2.7650512948 -0.3312409098
136 137 138 139 140
6.2124563248 0.3597234996 1.0717263165 -0.2122800101 -0.6718347187
141 142 143 144 145
-5.1945017580 0.0612023996 11.1424587243 -5.1535160659 4.4387910441
146 147 148 149 150
-3.0969367956 1.8439417304 -1.6769138062 1.0278503170 0.8979882230
151 152 153 154 155
-2.3370589105 2.3502919197 4.3832946847 1.1018346680 7.3100253932
156 157 158 159
1.0757171730 -2.8890994941 2.3281652813 5.3550175835
> postscript(file="/var/www/rcomp/tmp/64ji11290277063.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.1099934901 NA
1 -6.7480078499 -2.1099934901
2 3.7909719331 -6.7480078499
3 -1.7599722073 3.7909719331
4 -0.4912072492 -1.7599722073
5 0.1377371666 -0.4912072492
6 -1.8938210518 0.1377371666
7 -0.8267178646 -1.8938210518
8 0.8871120965 -0.8267178646
9 1.1468071106 0.8871120965
10 1.3858409946 1.1468071106
11 1.9027097807 1.3858409946
12 -1.8760345874 1.9027097807
13 -1.5075199930 -1.8760345874
14 -0.6319413636 -1.5075199930
15 2.7779152387 -0.6319413636
16 -3.9558410453 2.7779152387
17 -0.2336718413 -3.9558410453
18 4.1192397488 -0.2336718413
19 2.6107217410 4.1192397488
20 -2.4904765481 2.6107217410
21 3.4340851281 -2.4904765481
22 1.2966111690 3.4340851281
23 -3.9685245684 1.2966111690
24 -1.1585951533 -3.9685245684
25 2.8141950147 -1.1585951533
26 1.9864832413 2.8141950147
27 0.2966111690 1.9864832413
28 2.6810809775 0.2966111690
29 0.8232649587 2.6810809775
30 -4.6729270558 0.8232649587
31 4.7663199465 -4.6729270558
32 3.7206126967 4.7663199465
33 -2.6961501373 3.7206126967
34 4.5708127443 -2.6961501373
35 -5.8495677748 4.5708127443
36 -6.5586720722 -5.8495677748
37 1.8609946015 -6.5586720722
38 2.7558001357 1.8609946015
39 -1.9649150954 2.7558001357
40 3.7478225287 -1.9649150954
41 0.5969302394 3.7478225287
42 3.4213900695 0.5969302394
43 3.5708127443 3.4213900695
44 -2.9779717899 3.5708127443
45 -0.2597934424 -2.9779717899
46 2.1740169426 -0.2597934424
47 -6.5361879040 2.1740169426
48 -2.6468095607 -6.5361879040
49 4.0006322728 -2.6468095607
50 -8.1760043402 4.0006322728
51 -0.2873608042 -8.1760043402
52 -0.4730673612 -0.2873608042
53 -4.7781079892 -0.4730673612
54 8.8878218359 -4.7781079892
55 -1.6192421990 8.8878218359
56 -1.3675247919 -1.6192421990
57 1.5352677756 -1.3675247919
58 -4.4422439501 1.5352677756
59 2.7989746079 -4.4422439501
60 -0.3450365175 2.7989746079
61 -0.0044468146 -0.3450365175
62 1.6244976011 -0.0044468146
63 -4.0610301910 1.6244976011
64 0.5588483869 -4.0610301910
65 -6.0320182825 0.5588483869
66 -4.0233017622 -6.0320182825
67 0.0129582661 -4.0233017622
68 0.1127120086 0.0129582661
69 -1.7741253449 0.1127120086
70 -2.2706707830 -1.7741253449
71 -3.4821373052 -2.2706707830
72 -0.1295832449 -3.4821373052
73 4.1199704499 -0.1295832449
74 0.8178242354 4.1199704499
75 -1.0573968642 0.8178242354
76 2.2850002352 -1.0573968642
77 1.4032460754 2.2850002352
78 -2.2913516608 1.4032460754
79 -1.3323373529 -2.2913516608
80 0.0006322728 -1.3323373529
81 -1.3098449724 0.0006322728
82 0.6556982897 -1.3098449724
83 2.8667875345 0.6556982897
84 -4.4944632985 2.8667875345
85 3.4518518447 -4.4944632985
86 -2.1727482909 3.4518518447
87 -2.2728542430 -2.1727482909
88 1.6190568778 -2.2728542430
89 -0.0258386459 1.6190568778
90 1.0895086747 -0.0258386459
91 -3.0396301476 1.0895086747
92 -2.3218134360 -3.0396301476
93 1.9690781606 -2.3218134360
94 -1.4821373052 1.9690781606
95 5.3745822705 -1.4821373052
96 0.0184146311 5.3745822705
97 4.0488805124 0.0184146311
98 -0.2296850909 4.0488805124
99 0.3056811130 -0.2296850909
100 1.6901509215 0.3056811130
101 0.2258787612 1.6901509215
102 6.4072369319 0.2258787612
103 2.5929434889 6.4072369319
104 -1.5786140366 2.5929434889
105 -1.7157148243 -1.5786140366
106 -2.7389337998 -1.7157148243
107 -0.2877183340 -2.7389337998
108 1.8635314851 -0.2877183340
109 1.0107986599 1.8635314851
110 1.1558811607 1.0107986599
111 1.8976306932 1.1558811607
112 -4.2438382284 1.8976306932
113 2.9317019415 -4.2438382284
114 -3.5666653208 2.9317019415
115 0.9824964909 -3.5666653208
116 3.8221726217 0.9824964909
117 -2.7690421513 3.8221726217
118 1.8635314851 -2.7690421513
119 -3.7643164875 1.8635314851
120 -7.6112645920 -3.7643164875
121 1.0677395660 -7.6112645920
122 1.1954087738 1.0677395660
123 -5.7385762700 1.1954087738
124 -2.9971830532 -5.7385762700
125 4.5624776076 -2.9971830532
126 -1.9068777462 4.5624776076
127 -1.6899746068 -1.9068777462
128 1.8323349027 -1.6899746068
129 -4.0312834753 1.8323349027
130 -0.0795276088 -4.0312834753
131 0.5229458884 -0.0795276088
132 -1.2608857794 0.5229458884
133 -2.7650512948 -1.2608857794
134 -0.3312409098 -2.7650512948
135 6.2124563248 -0.3312409098
136 0.3597234996 6.2124563248
137 1.0717263165 0.3597234996
138 -0.2122800101 1.0717263165
139 -0.6718347187 -0.2122800101
140 -5.1945017580 -0.6718347187
141 0.0612023996 -5.1945017580
142 11.1424587243 0.0612023996
143 -5.1535160659 11.1424587243
144 4.4387910441 -5.1535160659
145 -3.0969367956 4.4387910441
146 1.8439417304 -3.0969367956
147 -1.6769138062 1.8439417304
148 1.0278503170 -1.6769138062
149 0.8979882230 1.0278503170
150 -2.3370589105 0.8979882230
151 2.3502919197 -2.3370589105
152 4.3832946847 2.3502919197
153 1.1018346680 4.3832946847
154 7.3100253932 1.1018346680
155 1.0757171730 7.3100253932
156 -2.8890994941 1.0757171730
157 2.3281652813 -2.8890994941
158 5.3550175835 2.3281652813
159 NA 5.3550175835
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -6.7480078499 -2.1099934901
[2,] 3.7909719331 -6.7480078499
[3,] -1.7599722073 3.7909719331
[4,] -0.4912072492 -1.7599722073
[5,] 0.1377371666 -0.4912072492
[6,] -1.8938210518 0.1377371666
[7,] -0.8267178646 -1.8938210518
[8,] 0.8871120965 -0.8267178646
[9,] 1.1468071106 0.8871120965
[10,] 1.3858409946 1.1468071106
[11,] 1.9027097807 1.3858409946
[12,] -1.8760345874 1.9027097807
[13,] -1.5075199930 -1.8760345874
[14,] -0.6319413636 -1.5075199930
[15,] 2.7779152387 -0.6319413636
[16,] -3.9558410453 2.7779152387
[17,] -0.2336718413 -3.9558410453
[18,] 4.1192397488 -0.2336718413
[19,] 2.6107217410 4.1192397488
[20,] -2.4904765481 2.6107217410
[21,] 3.4340851281 -2.4904765481
[22,] 1.2966111690 3.4340851281
[23,] -3.9685245684 1.2966111690
[24,] -1.1585951533 -3.9685245684
[25,] 2.8141950147 -1.1585951533
[26,] 1.9864832413 2.8141950147
[27,] 0.2966111690 1.9864832413
[28,] 2.6810809775 0.2966111690
[29,] 0.8232649587 2.6810809775
[30,] -4.6729270558 0.8232649587
[31,] 4.7663199465 -4.6729270558
[32,] 3.7206126967 4.7663199465
[33,] -2.6961501373 3.7206126967
[34,] 4.5708127443 -2.6961501373
[35,] -5.8495677748 4.5708127443
[36,] -6.5586720722 -5.8495677748
[37,] 1.8609946015 -6.5586720722
[38,] 2.7558001357 1.8609946015
[39,] -1.9649150954 2.7558001357
[40,] 3.7478225287 -1.9649150954
[41,] 0.5969302394 3.7478225287
[42,] 3.4213900695 0.5969302394
[43,] 3.5708127443 3.4213900695
[44,] -2.9779717899 3.5708127443
[45,] -0.2597934424 -2.9779717899
[46,] 2.1740169426 -0.2597934424
[47,] -6.5361879040 2.1740169426
[48,] -2.6468095607 -6.5361879040
[49,] 4.0006322728 -2.6468095607
[50,] -8.1760043402 4.0006322728
[51,] -0.2873608042 -8.1760043402
[52,] -0.4730673612 -0.2873608042
[53,] -4.7781079892 -0.4730673612
[54,] 8.8878218359 -4.7781079892
[55,] -1.6192421990 8.8878218359
[56,] -1.3675247919 -1.6192421990
[57,] 1.5352677756 -1.3675247919
[58,] -4.4422439501 1.5352677756
[59,] 2.7989746079 -4.4422439501
[60,] -0.3450365175 2.7989746079
[61,] -0.0044468146 -0.3450365175
[62,] 1.6244976011 -0.0044468146
[63,] -4.0610301910 1.6244976011
[64,] 0.5588483869 -4.0610301910
[65,] -6.0320182825 0.5588483869
[66,] -4.0233017622 -6.0320182825
[67,] 0.0129582661 -4.0233017622
[68,] 0.1127120086 0.0129582661
[69,] -1.7741253449 0.1127120086
[70,] -2.2706707830 -1.7741253449
[71,] -3.4821373052 -2.2706707830
[72,] -0.1295832449 -3.4821373052
[73,] 4.1199704499 -0.1295832449
[74,] 0.8178242354 4.1199704499
[75,] -1.0573968642 0.8178242354
[76,] 2.2850002352 -1.0573968642
[77,] 1.4032460754 2.2850002352
[78,] -2.2913516608 1.4032460754
[79,] -1.3323373529 -2.2913516608
[80,] 0.0006322728 -1.3323373529
[81,] -1.3098449724 0.0006322728
[82,] 0.6556982897 -1.3098449724
[83,] 2.8667875345 0.6556982897
[84,] -4.4944632985 2.8667875345
[85,] 3.4518518447 -4.4944632985
[86,] -2.1727482909 3.4518518447
[87,] -2.2728542430 -2.1727482909
[88,] 1.6190568778 -2.2728542430
[89,] -0.0258386459 1.6190568778
[90,] 1.0895086747 -0.0258386459
[91,] -3.0396301476 1.0895086747
[92,] -2.3218134360 -3.0396301476
[93,] 1.9690781606 -2.3218134360
[94,] -1.4821373052 1.9690781606
[95,] 5.3745822705 -1.4821373052
[96,] 0.0184146311 5.3745822705
[97,] 4.0488805124 0.0184146311
[98,] -0.2296850909 4.0488805124
[99,] 0.3056811130 -0.2296850909
[100,] 1.6901509215 0.3056811130
[101,] 0.2258787612 1.6901509215
[102,] 6.4072369319 0.2258787612
[103,] 2.5929434889 6.4072369319
[104,] -1.5786140366 2.5929434889
[105,] -1.7157148243 -1.5786140366
[106,] -2.7389337998 -1.7157148243
[107,] -0.2877183340 -2.7389337998
[108,] 1.8635314851 -0.2877183340
[109,] 1.0107986599 1.8635314851
[110,] 1.1558811607 1.0107986599
[111,] 1.8976306932 1.1558811607
[112,] -4.2438382284 1.8976306932
[113,] 2.9317019415 -4.2438382284
[114,] -3.5666653208 2.9317019415
[115,] 0.9824964909 -3.5666653208
[116,] 3.8221726217 0.9824964909
[117,] -2.7690421513 3.8221726217
[118,] 1.8635314851 -2.7690421513
[119,] -3.7643164875 1.8635314851
[120,] -7.6112645920 -3.7643164875
[121,] 1.0677395660 -7.6112645920
[122,] 1.1954087738 1.0677395660
[123,] -5.7385762700 1.1954087738
[124,] -2.9971830532 -5.7385762700
[125,] 4.5624776076 -2.9971830532
[126,] -1.9068777462 4.5624776076
[127,] -1.6899746068 -1.9068777462
[128,] 1.8323349027 -1.6899746068
[129,] -4.0312834753 1.8323349027
[130,] -0.0795276088 -4.0312834753
[131,] 0.5229458884 -0.0795276088
[132,] -1.2608857794 0.5229458884
[133,] -2.7650512948 -1.2608857794
[134,] -0.3312409098 -2.7650512948
[135,] 6.2124563248 -0.3312409098
[136,] 0.3597234996 6.2124563248
[137,] 1.0717263165 0.3597234996
[138,] -0.2122800101 1.0717263165
[139,] -0.6718347187 -0.2122800101
[140,] -5.1945017580 -0.6718347187
[141,] 0.0612023996 -5.1945017580
[142,] 11.1424587243 0.0612023996
[143,] -5.1535160659 11.1424587243
[144,] 4.4387910441 -5.1535160659
[145,] -3.0969367956 4.4387910441
[146,] 1.8439417304 -3.0969367956
[147,] -1.6769138062 1.8439417304
[148,] 1.0278503170 -1.6769138062
[149,] 0.8979882230 1.0278503170
[150,] -2.3370589105 0.8979882230
[151,] 2.3502919197 -2.3370589105
[152,] 4.3832946847 2.3502919197
[153,] 1.1018346680 4.3832946847
[154,] 7.3100253932 1.1018346680
[155,] 1.0757171730 7.3100253932
[156,] -2.8890994941 1.0757171730
[157,] 2.3281652813 -2.8890994941
[158,] 5.3550175835 2.3281652813
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -6.7480078499 -2.1099934901
2 3.7909719331 -6.7480078499
3 -1.7599722073 3.7909719331
4 -0.4912072492 -1.7599722073
5 0.1377371666 -0.4912072492
6 -1.8938210518 0.1377371666
7 -0.8267178646 -1.8938210518
8 0.8871120965 -0.8267178646
9 1.1468071106 0.8871120965
10 1.3858409946 1.1468071106
11 1.9027097807 1.3858409946
12 -1.8760345874 1.9027097807
13 -1.5075199930 -1.8760345874
14 -0.6319413636 -1.5075199930
15 2.7779152387 -0.6319413636
16 -3.9558410453 2.7779152387
17 -0.2336718413 -3.9558410453
18 4.1192397488 -0.2336718413
19 2.6107217410 4.1192397488
20 -2.4904765481 2.6107217410
21 3.4340851281 -2.4904765481
22 1.2966111690 3.4340851281
23 -3.9685245684 1.2966111690
24 -1.1585951533 -3.9685245684
25 2.8141950147 -1.1585951533
26 1.9864832413 2.8141950147
27 0.2966111690 1.9864832413
28 2.6810809775 0.2966111690
29 0.8232649587 2.6810809775
30 -4.6729270558 0.8232649587
31 4.7663199465 -4.6729270558
32 3.7206126967 4.7663199465
33 -2.6961501373 3.7206126967
34 4.5708127443 -2.6961501373
35 -5.8495677748 4.5708127443
36 -6.5586720722 -5.8495677748
37 1.8609946015 -6.5586720722
38 2.7558001357 1.8609946015
39 -1.9649150954 2.7558001357
40 3.7478225287 -1.9649150954
41 0.5969302394 3.7478225287
42 3.4213900695 0.5969302394
43 3.5708127443 3.4213900695
44 -2.9779717899 3.5708127443
45 -0.2597934424 -2.9779717899
46 2.1740169426 -0.2597934424
47 -6.5361879040 2.1740169426
48 -2.6468095607 -6.5361879040
49 4.0006322728 -2.6468095607
50 -8.1760043402 4.0006322728
51 -0.2873608042 -8.1760043402
52 -0.4730673612 -0.2873608042
53 -4.7781079892 -0.4730673612
54 8.8878218359 -4.7781079892
55 -1.6192421990 8.8878218359
56 -1.3675247919 -1.6192421990
57 1.5352677756 -1.3675247919
58 -4.4422439501 1.5352677756
59 2.7989746079 -4.4422439501
60 -0.3450365175 2.7989746079
61 -0.0044468146 -0.3450365175
62 1.6244976011 -0.0044468146
63 -4.0610301910 1.6244976011
64 0.5588483869 -4.0610301910
65 -6.0320182825 0.5588483869
66 -4.0233017622 -6.0320182825
67 0.0129582661 -4.0233017622
68 0.1127120086 0.0129582661
69 -1.7741253449 0.1127120086
70 -2.2706707830 -1.7741253449
71 -3.4821373052 -2.2706707830
72 -0.1295832449 -3.4821373052
73 4.1199704499 -0.1295832449
74 0.8178242354 4.1199704499
75 -1.0573968642 0.8178242354
76 2.2850002352 -1.0573968642
77 1.4032460754 2.2850002352
78 -2.2913516608 1.4032460754
79 -1.3323373529 -2.2913516608
80 0.0006322728 -1.3323373529
81 -1.3098449724 0.0006322728
82 0.6556982897 -1.3098449724
83 2.8667875345 0.6556982897
84 -4.4944632985 2.8667875345
85 3.4518518447 -4.4944632985
86 -2.1727482909 3.4518518447
87 -2.2728542430 -2.1727482909
88 1.6190568778 -2.2728542430
89 -0.0258386459 1.6190568778
90 1.0895086747 -0.0258386459
91 -3.0396301476 1.0895086747
92 -2.3218134360 -3.0396301476
93 1.9690781606 -2.3218134360
94 -1.4821373052 1.9690781606
95 5.3745822705 -1.4821373052
96 0.0184146311 5.3745822705
97 4.0488805124 0.0184146311
98 -0.2296850909 4.0488805124
99 0.3056811130 -0.2296850909
100 1.6901509215 0.3056811130
101 0.2258787612 1.6901509215
102 6.4072369319 0.2258787612
103 2.5929434889 6.4072369319
104 -1.5786140366 2.5929434889
105 -1.7157148243 -1.5786140366
106 -2.7389337998 -1.7157148243
107 -0.2877183340 -2.7389337998
108 1.8635314851 -0.2877183340
109 1.0107986599 1.8635314851
110 1.1558811607 1.0107986599
111 1.8976306932 1.1558811607
112 -4.2438382284 1.8976306932
113 2.9317019415 -4.2438382284
114 -3.5666653208 2.9317019415
115 0.9824964909 -3.5666653208
116 3.8221726217 0.9824964909
117 -2.7690421513 3.8221726217
118 1.8635314851 -2.7690421513
119 -3.7643164875 1.8635314851
120 -7.6112645920 -3.7643164875
121 1.0677395660 -7.6112645920
122 1.1954087738 1.0677395660
123 -5.7385762700 1.1954087738
124 -2.9971830532 -5.7385762700
125 4.5624776076 -2.9971830532
126 -1.9068777462 4.5624776076
127 -1.6899746068 -1.9068777462
128 1.8323349027 -1.6899746068
129 -4.0312834753 1.8323349027
130 -0.0795276088 -4.0312834753
131 0.5229458884 -0.0795276088
132 -1.2608857794 0.5229458884
133 -2.7650512948 -1.2608857794
134 -0.3312409098 -2.7650512948
135 6.2124563248 -0.3312409098
136 0.3597234996 6.2124563248
137 1.0717263165 0.3597234996
138 -0.2122800101 1.0717263165
139 -0.6718347187 -0.2122800101
140 -5.1945017580 -0.6718347187
141 0.0612023996 -5.1945017580
142 11.1424587243 0.0612023996
143 -5.1535160659 11.1424587243
144 4.4387910441 -5.1535160659
145 -3.0969367956 4.4387910441
146 1.8439417304 -3.0969367956
147 -1.6769138062 1.8439417304
148 1.0278503170 -1.6769138062
149 0.8979882230 1.0278503170
150 -2.3370589105 0.8979882230
151 2.3502919197 -2.3370589105
152 4.3832946847 2.3502919197
153 1.1018346680 4.3832946847
154 7.3100253932 1.1018346680
155 1.0757171730 7.3100253932
156 -2.8890994941 1.0757171730
157 2.3281652813 -2.8890994941
158 5.3550175835 2.3281652813
> 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/7ea041290277063.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/871zp1290277063.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/971zp1290277063.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/1071zp1290277063.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/113tfg1290277063.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/12obvl1290277063.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/13kltc1290277063.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/14o4r01290277063.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/15rm8o1290277063.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/16cn6u1290277063.tab")
+ }
>
> try(system("convert tmp/1q8hi1290277062.ps tmp/1q8hi1290277062.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ihgl1290277062.ps tmp/2ihgl1290277062.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ihgl1290277062.ps tmp/3ihgl1290277062.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ihgl1290277062.ps tmp/4ihgl1290277062.png",intern=TRUE))
character(0)
> try(system("convert tmp/54ji11290277063.ps tmp/54ji11290277063.png",intern=TRUE))
character(0)
> try(system("convert tmp/64ji11290277063.ps tmp/64ji11290277063.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ea041290277063.ps tmp/7ea041290277063.png",intern=TRUE))
character(0)
> try(system("convert tmp/871zp1290277063.ps tmp/871zp1290277063.png",intern=TRUE))
character(0)
> try(system("convert tmp/971zp1290277063.ps tmp/971zp1290277063.png",intern=TRUE))
character(0)
> try(system("convert tmp/1071zp1290277063.ps tmp/1071zp1290277063.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.260 1.190 6.414