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(66
+ ,73
+ ,68
+ ,5
+ ,2
+ ,54
+ ,58
+ ,54
+ ,12
+ ,1
+ ,82
+ ,68
+ ,41
+ ,11
+ ,1
+ ,61
+ ,62
+ ,49
+ ,6
+ ,1
+ ,65
+ ,65
+ ,49
+ ,12
+ ,1
+ ,77
+ ,81
+ ,72
+ ,11
+ ,1
+ ,66
+ ,73
+ ,78
+ ,12
+ ,1
+ ,66
+ ,64
+ ,58
+ ,7
+ ,2
+ ,66
+ ,68
+ ,58
+ ,8
+ ,1
+ ,48
+ ,51
+ ,23
+ ,13
+ ,1
+ ,57
+ ,68
+ ,39
+ ,12
+ ,1
+ ,80
+ ,61
+ ,63
+ ,13
+ ,1
+ ,60
+ ,69
+ ,46
+ ,12
+ ,1
+ ,70
+ ,73
+ ,58
+ ,12
+ ,1
+ ,85
+ ,61
+ ,39
+ ,11
+ ,2
+ ,59
+ ,62
+ ,44
+ ,12
+ ,2
+ ,72
+ ,63
+ ,49
+ ,12
+ ,1
+ ,70
+ ,69
+ ,57
+ ,12
+ ,1
+ ,74
+ ,47
+ ,76
+ ,11
+ ,2
+ ,70
+ ,66
+ ,63
+ ,13
+ ,2
+ ,51
+ ,58
+ ,18
+ ,9
+ ,1
+ ,70
+ ,63
+ ,40
+ ,11
+ ,2
+ ,71
+ ,69
+ ,59
+ ,11
+ ,1
+ ,72
+ ,59
+ ,62
+ ,11
+ ,2
+ ,50
+ ,59
+ ,70
+ ,9
+ ,1
+ ,69
+ ,63
+ ,65
+ ,11
+ ,2
+ ,73
+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,9
+ ,1
+ ,83
+ ,75
+ ,63
+ ,11
+ ,2
+ ,74
+ ,55
+ ,48
+ ,12
+ ,1
+ ,72
+ ,49
+ ,53
+ ,12
+ ,1
+ ,66
+ ,54
+ ,39
+ ,13
+ ,2
+ ,61
+ ,66
+ ,51
+ ,6
+ ,1
+ ,86
+ ,73
+ ,60
+ ,11
+ ,1
+ ,81
+ ,63
+ ,70
+ ,10
+ ,2
+ ,79
+ ,61
+ ,40
+ ,12
+ ,2
+ ,73
+ ,74
+ ,61
+ ,11
+ ,1
+ ,59
+ ,81
+ ,35
+ ,12
+ ,2
+ ,64
+ ,62
+ ,39
+ ,12
+ ,1
+ ,75
+ ,64
+ ,31
+ ,7
+ ,1
+ ,68
+ ,62
+ ,36
+ ,12
+ ,1
+ ,84
+ ,85
+ ,51
+ ,12
+ ,1
+ ,68
+ ,74
+ ,55
+ ,9
+ ,1
+ ,68
+ ,51
+ ,67
+ ,12
+ ,1
+ ,69
+ ,66
+ ,40
+ ,12
+ ,1)
+ ,dim=c(5
+ ,146)
+ ,dimnames=list(c('Groepsgevoel'
+ ,'Non-verbale_communicatie'
+ ,'Uitingsangst'
+ ,'Vrienden_Vinden'
+ ,'Geslacht')
+ ,1:146))
> y <- array(NA,dim=c(5,146),dimnames=list(c('Groepsgevoel','Non-verbale_communicatie','Uitingsangst','Vrienden_Vinden','Geslacht'),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 = '4'
> #'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
Vrienden_Vinden Groepsgevoel Non-verbale_communicatie Uitingsangst Geslacht
1 5 66 73 68 2
2 12 54 58 54 1
3 11 82 68 41 1
4 6 61 62 49 1
5 12 65 65 49 1
6 11 77 81 72 1
7 12 66 73 78 1
8 7 66 64 58 2
9 8 66 68 58 1
10 13 48 51 23 1
11 12 57 68 39 1
12 13 80 61 63 1
13 12 60 69 46 1
14 12 70 73 58 1
15 11 85 61 39 2
16 12 59 62 44 2
17 12 72 63 49 1
18 12 70 69 57 1
19 11 74 47 76 2
20 13 70 66 63 2
21 9 51 58 18 1
22 11 70 63 40 2
23 11 71 69 59 1
24 11 72 59 62 2
25 9 50 59 70 1
26 11 69 63 65 2
27 12 73 65 56 2
28 12 66 65 45 1
29 10 73 71 57 2
30 12 58 60 50 1
31 12 78 81 40 2
32 12 83 67 58 1
33 9 76 66 49 2
34 9 77 62 49 1
35 12 79 63 27 1
36 14 71 73 51 2
37 12 79 55 75 2
38 11 60 59 65 1
39 9 73 64 47 1
40 11 70 63 49 2
41 7 42 64 65 1
42 15 74 73 61 1
43 11 68 54 46 1
44 12 83 76 69 1
45 12 62 74 55 2
46 9 79 63 78 2
47 12 61 73 58 2
48 11 86 67 34 2
49 11 64 68 67 2
50 8 75 66 45 1
51 7 59 62 68 2
52 12 82 71 49 2
53 8 61 63 19 1
54 10 69 75 72 1
55 12 60 77 59 1
56 15 59 62 46 2
57 12 81 74 56 1
58 12 65 67 45 2
59 12 60 56 53 2
60 12 60 60 67 2
61 8 45 58 73 2
62 10 75 65 46 1
63 14 84 49 70 2
64 10 77 61 38 1
65 12 64 66 54 2
66 14 54 64 46 2
67 6 72 65 46 2
68 11 56 46 45 1
69 10 67 65 47 2
70 14 81 81 25 2
71 12 73 72 63 1
72 13 67 65 46 2
73 11 72 74 69 2
74 11 69 59 43 1
75 12 71 69 49 1
76 13 77 58 39 2
77 12 63 71 65 1
78 8 49 79 54 2
79 12 74 68 50 2
80 11 76 66 42 1
81 10 65 62 45 2
82 12 65 69 50 1
83 11 69 63 55 2
84 12 71 62 38 1
85 12 68 61 40 1
86 10 49 65 51 2
87 12 86 64 49 1
88 12 63 56 39 2
89 11 77 56 57 2
90 10 52 48 30 1
91 12 73 74 51 1
92 11 63 69 48 1
93 12 54 62 56 1
94 12 56 73 66 1
95 10 54 64 72 1
96 11 61 57 28 1
97 10 70 57 52 1
98 11 68 60 53 2
99 11 63 61 70 2
100 12 76 72 63 1
101 11 69 57 46 1
102 11 71 51 45 1
103 7 39 63 68 1
104 12 54 54 54 1
105 8 64 72 60 1
106 10 70 62 50 1
107 12 76 68 66 1
108 11 71 62 56 1
109 13 73 63 54 2
110 9 81 77 72 1
111 11 50 57 34 1
112 13 42 57 39 1
113 8 66 61 66 1
114 12 77 65 27 1
115 11 62 63 63 1
116 11 66 66 65 2
117 12 69 68 63 1
118 13 72 72 49 1
119 11 67 68 42 1
120 10 59 59 51 1
121 10 66 56 50 1
122 10 68 62 64 1
123 12 72 72 68 2
124 12 73 68 66 2
125 13 69 67 59 1
126 11 57 54 32 1
127 11 55 69 62 2
128 12 72 61 52 1
129 9 68 55 34 1
130 11 83 75 63 2
131 12 74 55 48 1
132 12 72 49 53 1
133 13 66 54 39 2
134 6 61 66 51 1
135 11 86 73 60 1
136 10 81 63 70 2
137 12 79 61 40 2
138 11 73 74 61 1
139 12 59 81 35 2
140 12 64 62 39 1
141 7 75 64 31 1
142 12 68 62 36 1
143 12 84 85 51 1
144 9 68 74 55 1
145 12 68 51 67 1
146 12 69 66 40 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Groepsgevoel
9.0257316 0.0372126
`Non-verbale_communicatie` Uitingsangst
-0.0001426 -0.0171637
Geslacht
0.2606798
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.8256 -0.7071 0.2856 1.0763 4.0557
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.0257316 1.5342901 5.883 2.80e-08 ***
Groepsgevoel 0.0372126 0.0156201 2.382 0.0185 *
`Non-verbale_communicatie` -0.0001426 0.0208004 -0.007 0.9945
Uitingsangst -0.0171637 0.0118382 -1.450 0.1493
Geslacht 0.2606798 0.3050938 0.854 0.3943
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.768 on 141 degrees of freedom
Multiple R-squared: 0.05795, Adjusted R-squared: 0.03123
F-statistic: 2.168 on 4 and 141 DF, p-value: 0.0756
> 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.95460328 0.0907934362 0.0453967181
[2,] 0.95690439 0.0861912159 0.0430956080
[3,] 0.98831925 0.0233615015 0.0116807507
[4,] 0.97878637 0.0424272517 0.0212136259
[5,] 0.97885678 0.0422864380 0.0211432190
[6,] 0.97032929 0.0593414108 0.0296707054
[7,] 0.95817305 0.0836538919 0.0418269459
[8,] 0.96761287 0.0647742672 0.0323871336
[9,] 0.98900409 0.0219918147 0.0109959074
[10,] 0.98216898 0.0356620375 0.0178310188
[11,] 0.97445439 0.0510912262 0.0255456131
[12,] 0.96584338 0.0683132381 0.0341566191
[13,] 0.98802088 0.0239582462 0.0119791231
[14,] 0.98960047 0.0207990515 0.0103995257
[15,] 0.98541038 0.0291792320 0.0145896160
[16,] 0.97791731 0.0441653714 0.0220826857
[17,] 0.96854238 0.0629152334 0.0314576167
[18,] 0.96118201 0.0776359719 0.0388179860
[19,] 0.94992473 0.1001505454 0.0500752727
[20,] 0.94292109 0.1141578244 0.0570789122
[21,] 0.92684520 0.1463096001 0.0731548001
[22,] 0.90658396 0.1868320853 0.0934160426
[23,] 0.88958674 0.2208265117 0.1104132559
[24,] 0.87824581 0.2435083827 0.1217541913
[25,] 0.84677491 0.3064501838 0.1532250919
[26,] 0.85718263 0.2856347415 0.1428173707
[27,] 0.89378383 0.2124323391 0.1062161695
[28,] 0.86533682 0.2693263593 0.1346631797
[29,] 0.92076496 0.1584700874 0.0792350437
[30,] 0.90586934 0.1882613185 0.0941306593
[31,] 0.88200967 0.2359806574 0.1179903287
[32,] 0.89675840 0.2064832054 0.1032416027
[33,] 0.87086886 0.2582622755 0.1291311377
[34,] 0.89516573 0.2096685303 0.1048342651
[35,] 0.95759250 0.0848149900 0.0424074950
[36,] 0.94443201 0.1111359784 0.0555679892
[37,] 0.93018416 0.1396316743 0.0698158372
[38,] 0.92453606 0.1509278850 0.0754639425
[39,] 0.92788027 0.1442394507 0.0721197254
[40,] 0.92137775 0.1572445004 0.0786222502
[41,] 0.90874474 0.1825105276 0.0912552638
[42,] 0.88797508 0.2240498477 0.1120249238
[43,] 0.93594173 0.1281165441 0.0640582720
[44,] 0.96678861 0.0664227833 0.0332113917
[45,] 0.95694963 0.0861007496 0.0430503748
[46,] 0.97506210 0.0498758060 0.0249379030
[47,] 0.96836102 0.0632779683 0.0316389841
[48,] 0.96527817 0.0694436508 0.0347218254
[49,] 0.99111179 0.0177764255 0.0088882128
[50,] 0.98814121 0.0237175900 0.0118587950
[51,] 0.98490976 0.0301804855 0.0150902428
[52,] 0.98232799 0.0353440237 0.0176720119
[53,] 0.98007727 0.0398454655 0.0199227328
[54,] 0.98135474 0.0372905109 0.0186452555
[55,] 0.97822734 0.0435453141 0.0217726570
[56,] 0.98378898 0.0324220425 0.0162110212
[57,] 0.98209862 0.0358027544 0.0179013772
[58,] 0.97808408 0.0438318388 0.0219159194
[59,] 0.98907779 0.0218444191 0.0109222096
[60,] 0.99959759 0.0008048291 0.0004024146
[61,] 0.99939366 0.0012126834 0.0006063417
[62,] 0.99928434 0.0014313261 0.0007156630
[63,] 0.99929615 0.0014077081 0.0007038541
[64,] 0.99910012 0.0017997633 0.0008998816
[65,] 0.99907813 0.0018437427 0.0009218714
[66,] 0.99861094 0.0027781208 0.0013890604
[67,] 0.99794197 0.0041160643 0.0020580322
[68,] 0.99730445 0.0053911020 0.0026955510
[69,] 0.99670764 0.0065847250 0.0032923625
[70,] 0.99646670 0.0070666014 0.0035333007
[71,] 0.99768073 0.0046385319 0.0023192659
[72,] 0.99669381 0.0066123812 0.0033061906
[73,] 0.99528891 0.0094221811 0.0047110906
[74,] 0.99466695 0.0106661022 0.0053330511
[75,] 0.99356013 0.0128797320 0.0064398660
[76,] 0.99106602 0.0178679667 0.0089339834
[77,] 0.98826402 0.0234719629 0.0117359815
[78,] 0.98512369 0.0297526150 0.0148763075
[79,] 0.98132783 0.0373443391 0.0186721696
[80,] 0.97560267 0.0487946682 0.0243973341
[81,] 0.96832987 0.0633402546 0.0316701273
[82,] 0.95972878 0.0805424374 0.0402712187
[83,] 0.95079203 0.0984159467 0.0492079733
[84,] 0.94198526 0.1160294891 0.0580147446
[85,] 0.92579373 0.1484125488 0.0742062744
[86,] 0.92396944 0.1520611221 0.0760305610
[87,] 0.92976751 0.1404649863 0.0702324931
[88,] 0.91082187 0.1783562600 0.0891781300
[89,] 0.88782761 0.2243447879 0.1121723940
[90,] 0.86940507 0.2611898555 0.1305949277
[91,] 0.84408405 0.3118318994 0.1559159497
[92,] 0.81081016 0.3783796764 0.1891898382
[93,] 0.79665380 0.4066924077 0.2033462039
[94,] 0.75625205 0.4874958916 0.2437479458
[95,] 0.71305631 0.5738873876 0.2869436938
[96,] 0.77173888 0.4565222487 0.2282611244
[97,] 0.75543229 0.4891354166 0.2445677083
[98,] 0.80161419 0.3967716103 0.1983858051
[99,] 0.77240428 0.4551914489 0.2275957245
[100,] 0.75380013 0.4923997452 0.2461998726
[101,] 0.70700838 0.5859832493 0.2929916246
[102,] 0.68765666 0.6246866853 0.3123433427
[103,] 0.68187437 0.6362512629 0.3181256315
[104,] 0.62820241 0.7435951703 0.3717975852
[105,] 0.69099903 0.6180019498 0.3090009749
[106,] 0.75677387 0.4864522623 0.2432261311
[107,] 0.71818053 0.5636389357 0.2818194678
[108,] 0.66460818 0.6707836388 0.3353918194
[109,] 0.60939921 0.7812015898 0.3906007949
[110,] 0.57502783 0.8499443315 0.4249721657
[111,] 0.61274278 0.7745144341 0.3872572170
[112,] 0.55199273 0.8960145403 0.4480072702
[113,] 0.49100933 0.9820186567 0.5089906717
[114,] 0.43780047 0.8756009306 0.5621995347
[115,] 0.38509204 0.7701840726 0.6149079637
[116,] 0.32464716 0.6492943107 0.6753528446
[117,] 0.26663618 0.5332723700 0.7333638150
[118,] 0.30360412 0.6072082434 0.6963958783
[119,] 0.24287042 0.4857408469 0.7571295766
[120,] 0.18715195 0.3743038918 0.8128480541
[121,] 0.15854514 0.3170902766 0.8414548617
[122,] 0.16314659 0.3262931801 0.8368534099
[123,] 0.11884710 0.2376941919 0.8811529040
[124,] 0.08806430 0.1761286078 0.9119356961
[125,] 0.06600334 0.1320066894 0.9339966553
[126,] 0.05269911 0.1053982237 0.9473008881
[127,] 0.31601991 0.6320398236 0.6839800882
[128,] 0.23130440 0.4626087956 0.7686956022
[129,] 0.21691762 0.4338352492 0.7830823754
[130,] 0.13404416 0.2680883103 0.8659558448
[131,] 0.07198771 0.1439754266 0.9280122867
> postscript(file="/var/www/html/rcomp/tmp/1vena1291029762.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/html/rcomp/tmp/26nmc1291029762.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/html/rcomp/tmp/36nmc1291029762.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/html/rcomp/tmp/46nmc1291029762.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/html/rcomp/tmp/5hx4x1291029762.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 = 146
Frequency = 1
1 2 3 4 5 6
-5.825583063 1.639217487 -0.624437806 -4.706519013 1.145058285 0.095553525
7 8 9 10 11 12
1.606733893 -3.998503192 -2.737253199 2.329419942 1.271549482 1.826591282
13 14 15 16 17 18
1.280200284 1.114609202 -1.032080653 1.021407793 0.884285060 1.096875280
19 20 21 22 23 24
0.010319627 1.938750139 -1.867038550 -0.456443000 0.093990125 -0.153836614
25 26 27 28 29 30
-0.937170138 0.009862508 0.706823804 1.039190829 -1.275157172 1.421997367
31 32 33 34 35 36
0.248422212 0.629990239 -2.524817429 -2.301920435 0.246195170 2.696570808
37 38 39 40 41 42
0.808233377 0.604885390 -2.187112411 -0.301969549 -2.724575254 4.017249997
43 44 45 46 47 48
-0.019638696 0.820074085 1.100281526 -2.139135063 1.188842714 -1.154256518
49 50 51 52 53 54
0.230965642 -3.295579919 -3.566663005 0.252619794 -3.221287965 -0.607601072
55 56 57 58 59 60
1.504469012 4.055735226 0.671085842 0.816008733 1.137813347 1.378675587
61 62 63 64 65 66
-1.960438382 -1.278558754 2.535496541 -1.490863871 1.007552221 3.242083273
67 68 69 70 71 72
-5.427600775 0.408608243 -1.224374114 1.879328694 1.088647468 1.758462169
73 74 75 76 77 78
-0.031552328 -0.107629679 0.922352957 1.265192404 1.494958239 -2.432405779
79 80 81 82 83 84
0.567056568 -0.384283659 -1.184704024 1.162792207 -0.161774660 0.732554214
85 86 87 88 89 90
0.878376862 -0.485892647 0.363451368 0.785883546 -0.426145796 -0.699712050
91 92 93 94 95 96
0.882967969 0.202889951 1.674115126 1.772895180 -0.050980303 -0.067669822
97 98 99 100 101 102
-0.990653919 -0.159317159 0.318671522 0.977009701 -0.056423631 -0.148867833
103 104 105 106 107 108
-2.561588889 1.638647282 -2.627930383 -1.024268596 1.027930646 0.041501115
109 110 111 112 113 114
1.672211268 -2.053867036 0.444650956 2.828170251 -2.600941324 0.320905450
115 116 117 118 119 120
0.496702984 0.121927928 1.236927618 1.885568022 -0.049085256 -0.598194056
121 122 123 124 125 126
-0.876273549 -0.709551384 0.950998853 0.878888625 2.168130200 0.149407747
127 128 129 130 131 132
0.480202909 0.935491108 -2.225460746 -0.543730555 0.791555756 0.950944210
133 134 135 136 137 138
1.673960677 -4.671621375 -0.446464786 -1.350869975 0.208358597 0.054605137
139 140 141 142 143 144
0.869642816 1.010206052 -4.536157057 0.809864547 0.475197556 -1.862314219
145 146
1.340371702 0.841877030
> postscript(file="/var/www/html/rcomp/tmp/6hx4x1291029762.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 = 146
Frequency = 1
lag(myerror, k = 1) myerror
0 -5.825583063 NA
1 1.639217487 -5.825583063
2 -0.624437806 1.639217487
3 -4.706519013 -0.624437806
4 1.145058285 -4.706519013
5 0.095553525 1.145058285
6 1.606733893 0.095553525
7 -3.998503192 1.606733893
8 -2.737253199 -3.998503192
9 2.329419942 -2.737253199
10 1.271549482 2.329419942
11 1.826591282 1.271549482
12 1.280200284 1.826591282
13 1.114609202 1.280200284
14 -1.032080653 1.114609202
15 1.021407793 -1.032080653
16 0.884285060 1.021407793
17 1.096875280 0.884285060
18 0.010319627 1.096875280
19 1.938750139 0.010319627
20 -1.867038550 1.938750139
21 -0.456443000 -1.867038550
22 0.093990125 -0.456443000
23 -0.153836614 0.093990125
24 -0.937170138 -0.153836614
25 0.009862508 -0.937170138
26 0.706823804 0.009862508
27 1.039190829 0.706823804
28 -1.275157172 1.039190829
29 1.421997367 -1.275157172
30 0.248422212 1.421997367
31 0.629990239 0.248422212
32 -2.524817429 0.629990239
33 -2.301920435 -2.524817429
34 0.246195170 -2.301920435
35 2.696570808 0.246195170
36 0.808233377 2.696570808
37 0.604885390 0.808233377
38 -2.187112411 0.604885390
39 -0.301969549 -2.187112411
40 -2.724575254 -0.301969549
41 4.017249997 -2.724575254
42 -0.019638696 4.017249997
43 0.820074085 -0.019638696
44 1.100281526 0.820074085
45 -2.139135063 1.100281526
46 1.188842714 -2.139135063
47 -1.154256518 1.188842714
48 0.230965642 -1.154256518
49 -3.295579919 0.230965642
50 -3.566663005 -3.295579919
51 0.252619794 -3.566663005
52 -3.221287965 0.252619794
53 -0.607601072 -3.221287965
54 1.504469012 -0.607601072
55 4.055735226 1.504469012
56 0.671085842 4.055735226
57 0.816008733 0.671085842
58 1.137813347 0.816008733
59 1.378675587 1.137813347
60 -1.960438382 1.378675587
61 -1.278558754 -1.960438382
62 2.535496541 -1.278558754
63 -1.490863871 2.535496541
64 1.007552221 -1.490863871
65 3.242083273 1.007552221
66 -5.427600775 3.242083273
67 0.408608243 -5.427600775
68 -1.224374114 0.408608243
69 1.879328694 -1.224374114
70 1.088647468 1.879328694
71 1.758462169 1.088647468
72 -0.031552328 1.758462169
73 -0.107629679 -0.031552328
74 0.922352957 -0.107629679
75 1.265192404 0.922352957
76 1.494958239 1.265192404
77 -2.432405779 1.494958239
78 0.567056568 -2.432405779
79 -0.384283659 0.567056568
80 -1.184704024 -0.384283659
81 1.162792207 -1.184704024
82 -0.161774660 1.162792207
83 0.732554214 -0.161774660
84 0.878376862 0.732554214
85 -0.485892647 0.878376862
86 0.363451368 -0.485892647
87 0.785883546 0.363451368
88 -0.426145796 0.785883546
89 -0.699712050 -0.426145796
90 0.882967969 -0.699712050
91 0.202889951 0.882967969
92 1.674115126 0.202889951
93 1.772895180 1.674115126
94 -0.050980303 1.772895180
95 -0.067669822 -0.050980303
96 -0.990653919 -0.067669822
97 -0.159317159 -0.990653919
98 0.318671522 -0.159317159
99 0.977009701 0.318671522
100 -0.056423631 0.977009701
101 -0.148867833 -0.056423631
102 -2.561588889 -0.148867833
103 1.638647282 -2.561588889
104 -2.627930383 1.638647282
105 -1.024268596 -2.627930383
106 1.027930646 -1.024268596
107 0.041501115 1.027930646
108 1.672211268 0.041501115
109 -2.053867036 1.672211268
110 0.444650956 -2.053867036
111 2.828170251 0.444650956
112 -2.600941324 2.828170251
113 0.320905450 -2.600941324
114 0.496702984 0.320905450
115 0.121927928 0.496702984
116 1.236927618 0.121927928
117 1.885568022 1.236927618
118 -0.049085256 1.885568022
119 -0.598194056 -0.049085256
120 -0.876273549 -0.598194056
121 -0.709551384 -0.876273549
122 0.950998853 -0.709551384
123 0.878888625 0.950998853
124 2.168130200 0.878888625
125 0.149407747 2.168130200
126 0.480202909 0.149407747
127 0.935491108 0.480202909
128 -2.225460746 0.935491108
129 -0.543730555 -2.225460746
130 0.791555756 -0.543730555
131 0.950944210 0.791555756
132 1.673960677 0.950944210
133 -4.671621375 1.673960677
134 -0.446464786 -4.671621375
135 -1.350869975 -0.446464786
136 0.208358597 -1.350869975
137 0.054605137 0.208358597
138 0.869642816 0.054605137
139 1.010206052 0.869642816
140 -4.536157057 1.010206052
141 0.809864547 -4.536157057
142 0.475197556 0.809864547
143 -1.862314219 0.475197556
144 1.340371702 -1.862314219
145 0.841877030 1.340371702
146 NA 0.841877030
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.639217487 -5.825583063
[2,] -0.624437806 1.639217487
[3,] -4.706519013 -0.624437806
[4,] 1.145058285 -4.706519013
[5,] 0.095553525 1.145058285
[6,] 1.606733893 0.095553525
[7,] -3.998503192 1.606733893
[8,] -2.737253199 -3.998503192
[9,] 2.329419942 -2.737253199
[10,] 1.271549482 2.329419942
[11,] 1.826591282 1.271549482
[12,] 1.280200284 1.826591282
[13,] 1.114609202 1.280200284
[14,] -1.032080653 1.114609202
[15,] 1.021407793 -1.032080653
[16,] 0.884285060 1.021407793
[17,] 1.096875280 0.884285060
[18,] 0.010319627 1.096875280
[19,] 1.938750139 0.010319627
[20,] -1.867038550 1.938750139
[21,] -0.456443000 -1.867038550
[22,] 0.093990125 -0.456443000
[23,] -0.153836614 0.093990125
[24,] -0.937170138 -0.153836614
[25,] 0.009862508 -0.937170138
[26,] 0.706823804 0.009862508
[27,] 1.039190829 0.706823804
[28,] -1.275157172 1.039190829
[29,] 1.421997367 -1.275157172
[30,] 0.248422212 1.421997367
[31,] 0.629990239 0.248422212
[32,] -2.524817429 0.629990239
[33,] -2.301920435 -2.524817429
[34,] 0.246195170 -2.301920435
[35,] 2.696570808 0.246195170
[36,] 0.808233377 2.696570808
[37,] 0.604885390 0.808233377
[38,] -2.187112411 0.604885390
[39,] -0.301969549 -2.187112411
[40,] -2.724575254 -0.301969549
[41,] 4.017249997 -2.724575254
[42,] -0.019638696 4.017249997
[43,] 0.820074085 -0.019638696
[44,] 1.100281526 0.820074085
[45,] -2.139135063 1.100281526
[46,] 1.188842714 -2.139135063
[47,] -1.154256518 1.188842714
[48,] 0.230965642 -1.154256518
[49,] -3.295579919 0.230965642
[50,] -3.566663005 -3.295579919
[51,] 0.252619794 -3.566663005
[52,] -3.221287965 0.252619794
[53,] -0.607601072 -3.221287965
[54,] 1.504469012 -0.607601072
[55,] 4.055735226 1.504469012
[56,] 0.671085842 4.055735226
[57,] 0.816008733 0.671085842
[58,] 1.137813347 0.816008733
[59,] 1.378675587 1.137813347
[60,] -1.960438382 1.378675587
[61,] -1.278558754 -1.960438382
[62,] 2.535496541 -1.278558754
[63,] -1.490863871 2.535496541
[64,] 1.007552221 -1.490863871
[65,] 3.242083273 1.007552221
[66,] -5.427600775 3.242083273
[67,] 0.408608243 -5.427600775
[68,] -1.224374114 0.408608243
[69,] 1.879328694 -1.224374114
[70,] 1.088647468 1.879328694
[71,] 1.758462169 1.088647468
[72,] -0.031552328 1.758462169
[73,] -0.107629679 -0.031552328
[74,] 0.922352957 -0.107629679
[75,] 1.265192404 0.922352957
[76,] 1.494958239 1.265192404
[77,] -2.432405779 1.494958239
[78,] 0.567056568 -2.432405779
[79,] -0.384283659 0.567056568
[80,] -1.184704024 -0.384283659
[81,] 1.162792207 -1.184704024
[82,] -0.161774660 1.162792207
[83,] 0.732554214 -0.161774660
[84,] 0.878376862 0.732554214
[85,] -0.485892647 0.878376862
[86,] 0.363451368 -0.485892647
[87,] 0.785883546 0.363451368
[88,] -0.426145796 0.785883546
[89,] -0.699712050 -0.426145796
[90,] 0.882967969 -0.699712050
[91,] 0.202889951 0.882967969
[92,] 1.674115126 0.202889951
[93,] 1.772895180 1.674115126
[94,] -0.050980303 1.772895180
[95,] -0.067669822 -0.050980303
[96,] -0.990653919 -0.067669822
[97,] -0.159317159 -0.990653919
[98,] 0.318671522 -0.159317159
[99,] 0.977009701 0.318671522
[100,] -0.056423631 0.977009701
[101,] -0.148867833 -0.056423631
[102,] -2.561588889 -0.148867833
[103,] 1.638647282 -2.561588889
[104,] -2.627930383 1.638647282
[105,] -1.024268596 -2.627930383
[106,] 1.027930646 -1.024268596
[107,] 0.041501115 1.027930646
[108,] 1.672211268 0.041501115
[109,] -2.053867036 1.672211268
[110,] 0.444650956 -2.053867036
[111,] 2.828170251 0.444650956
[112,] -2.600941324 2.828170251
[113,] 0.320905450 -2.600941324
[114,] 0.496702984 0.320905450
[115,] 0.121927928 0.496702984
[116,] 1.236927618 0.121927928
[117,] 1.885568022 1.236927618
[118,] -0.049085256 1.885568022
[119,] -0.598194056 -0.049085256
[120,] -0.876273549 -0.598194056
[121,] -0.709551384 -0.876273549
[122,] 0.950998853 -0.709551384
[123,] 0.878888625 0.950998853
[124,] 2.168130200 0.878888625
[125,] 0.149407747 2.168130200
[126,] 0.480202909 0.149407747
[127,] 0.935491108 0.480202909
[128,] -2.225460746 0.935491108
[129,] -0.543730555 -2.225460746
[130,] 0.791555756 -0.543730555
[131,] 0.950944210 0.791555756
[132,] 1.673960677 0.950944210
[133,] -4.671621375 1.673960677
[134,] -0.446464786 -4.671621375
[135,] -1.350869975 -0.446464786
[136,] 0.208358597 -1.350869975
[137,] 0.054605137 0.208358597
[138,] 0.869642816 0.054605137
[139,] 1.010206052 0.869642816
[140,] -4.536157057 1.010206052
[141,] 0.809864547 -4.536157057
[142,] 0.475197556 0.809864547
[143,] -1.862314219 0.475197556
[144,] 1.340371702 -1.862314219
[145,] 0.841877030 1.340371702
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.639217487 -5.825583063
2 -0.624437806 1.639217487
3 -4.706519013 -0.624437806
4 1.145058285 -4.706519013
5 0.095553525 1.145058285
6 1.606733893 0.095553525
7 -3.998503192 1.606733893
8 -2.737253199 -3.998503192
9 2.329419942 -2.737253199
10 1.271549482 2.329419942
11 1.826591282 1.271549482
12 1.280200284 1.826591282
13 1.114609202 1.280200284
14 -1.032080653 1.114609202
15 1.021407793 -1.032080653
16 0.884285060 1.021407793
17 1.096875280 0.884285060
18 0.010319627 1.096875280
19 1.938750139 0.010319627
20 -1.867038550 1.938750139
21 -0.456443000 -1.867038550
22 0.093990125 -0.456443000
23 -0.153836614 0.093990125
24 -0.937170138 -0.153836614
25 0.009862508 -0.937170138
26 0.706823804 0.009862508
27 1.039190829 0.706823804
28 -1.275157172 1.039190829
29 1.421997367 -1.275157172
30 0.248422212 1.421997367
31 0.629990239 0.248422212
32 -2.524817429 0.629990239
33 -2.301920435 -2.524817429
34 0.246195170 -2.301920435
35 2.696570808 0.246195170
36 0.808233377 2.696570808
37 0.604885390 0.808233377
38 -2.187112411 0.604885390
39 -0.301969549 -2.187112411
40 -2.724575254 -0.301969549
41 4.017249997 -2.724575254
42 -0.019638696 4.017249997
43 0.820074085 -0.019638696
44 1.100281526 0.820074085
45 -2.139135063 1.100281526
46 1.188842714 -2.139135063
47 -1.154256518 1.188842714
48 0.230965642 -1.154256518
49 -3.295579919 0.230965642
50 -3.566663005 -3.295579919
51 0.252619794 -3.566663005
52 -3.221287965 0.252619794
53 -0.607601072 -3.221287965
54 1.504469012 -0.607601072
55 4.055735226 1.504469012
56 0.671085842 4.055735226
57 0.816008733 0.671085842
58 1.137813347 0.816008733
59 1.378675587 1.137813347
60 -1.960438382 1.378675587
61 -1.278558754 -1.960438382
62 2.535496541 -1.278558754
63 -1.490863871 2.535496541
64 1.007552221 -1.490863871
65 3.242083273 1.007552221
66 -5.427600775 3.242083273
67 0.408608243 -5.427600775
68 -1.224374114 0.408608243
69 1.879328694 -1.224374114
70 1.088647468 1.879328694
71 1.758462169 1.088647468
72 -0.031552328 1.758462169
73 -0.107629679 -0.031552328
74 0.922352957 -0.107629679
75 1.265192404 0.922352957
76 1.494958239 1.265192404
77 -2.432405779 1.494958239
78 0.567056568 -2.432405779
79 -0.384283659 0.567056568
80 -1.184704024 -0.384283659
81 1.162792207 -1.184704024
82 -0.161774660 1.162792207
83 0.732554214 -0.161774660
84 0.878376862 0.732554214
85 -0.485892647 0.878376862
86 0.363451368 -0.485892647
87 0.785883546 0.363451368
88 -0.426145796 0.785883546
89 -0.699712050 -0.426145796
90 0.882967969 -0.699712050
91 0.202889951 0.882967969
92 1.674115126 0.202889951
93 1.772895180 1.674115126
94 -0.050980303 1.772895180
95 -0.067669822 -0.050980303
96 -0.990653919 -0.067669822
97 -0.159317159 -0.990653919
98 0.318671522 -0.159317159
99 0.977009701 0.318671522
100 -0.056423631 0.977009701
101 -0.148867833 -0.056423631
102 -2.561588889 -0.148867833
103 1.638647282 -2.561588889
104 -2.627930383 1.638647282
105 -1.024268596 -2.627930383
106 1.027930646 -1.024268596
107 0.041501115 1.027930646
108 1.672211268 0.041501115
109 -2.053867036 1.672211268
110 0.444650956 -2.053867036
111 2.828170251 0.444650956
112 -2.600941324 2.828170251
113 0.320905450 -2.600941324
114 0.496702984 0.320905450
115 0.121927928 0.496702984
116 1.236927618 0.121927928
117 1.885568022 1.236927618
118 -0.049085256 1.885568022
119 -0.598194056 -0.049085256
120 -0.876273549 -0.598194056
121 -0.709551384 -0.876273549
122 0.950998853 -0.709551384
123 0.878888625 0.950998853
124 2.168130200 0.878888625
125 0.149407747 2.168130200
126 0.480202909 0.149407747
127 0.935491108 0.480202909
128 -2.225460746 0.935491108
129 -0.543730555 -2.225460746
130 0.791555756 -0.543730555
131 0.950944210 0.791555756
132 1.673960677 0.950944210
133 -4.671621375 1.673960677
134 -0.446464786 -4.671621375
135 -1.350869975 -0.446464786
136 0.208358597 -1.350869975
137 0.054605137 0.208358597
138 0.869642816 0.054605137
139 1.010206052 0.869642816
140 -4.536157057 1.010206052
141 0.809864547 -4.536157057
142 0.475197556 0.809864547
143 -1.862314219 0.475197556
144 1.340371702 -1.862314219
145 0.841877030 1.340371702
> 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/796301291029762.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/html/rcomp/tmp/896301291029762.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/html/rcomp/tmp/92fk31291029762.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/html/rcomp/tmp/102fk31291029762.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/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/115gir1291029762.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/129gzf1291029762.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/13xher1291029762.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/14q9dc1291029762.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/15b9uz1291029762.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/1681rq1291029762.tab")
+ }
>
> try(system("convert tmp/1vena1291029762.ps tmp/1vena1291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/26nmc1291029762.ps tmp/26nmc1291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/36nmc1291029762.ps tmp/36nmc1291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/46nmc1291029762.ps tmp/46nmc1291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/5hx4x1291029762.ps tmp/5hx4x1291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/6hx4x1291029762.ps tmp/6hx4x1291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/796301291029762.ps tmp/796301291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/896301291029762.ps tmp/896301291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/92fk31291029762.ps tmp/92fk31291029762.png",intern=TRUE))
character(0)
> try(system("convert tmp/102fk31291029762.ps tmp/102fk31291029762.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.774 1.780 9.698