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(13
+ ,15
+ ,2
+ ,9
+ ,42
+ ,12
+ ,12
+ ,18
+ ,1
+ ,9
+ ,51
+ ,15
+ ,15
+ ,11
+ ,1
+ ,9
+ ,42
+ ,14
+ ,12
+ ,16
+ ,1
+ ,8
+ ,46
+ ,10
+ ,10
+ ,12
+ ,2
+ ,14
+ ,41
+ ,10
+ ,12
+ ,17
+ ,2
+ ,14
+ ,49
+ ,9
+ ,15
+ ,15
+ ,1
+ ,15
+ ,47
+ ,18
+ ,9
+ ,19
+ ,1
+ ,11
+ ,33
+ ,11
+ ,11
+ ,18
+ ,1
+ ,8
+ ,47
+ ,12
+ ,11
+ ,10
+ ,2
+ ,14
+ ,42
+ ,11
+ ,11
+ ,14
+ ,1
+ ,9
+ ,32
+ ,15
+ ,15
+ ,18
+ ,1
+ ,6
+ ,53
+ ,17
+ ,7
+ ,18
+ ,2
+ ,14
+ ,41
+ ,14
+ ,11
+ ,14
+ ,2
+ ,8
+ ,41
+ ,24
+ ,11
+ ,14
+ ,1
+ ,11
+ ,33
+ ,7
+ ,10
+ ,12
+ ,1
+ ,16
+ ,37
+ ,18
+ ,14
+ ,16
+ ,2
+ ,11
+ ,43
+ ,11
+ ,6
+ ,13
+ ,2
+ ,13
+ ,33
+ ,14
+ ,11
+ ,16
+ ,1
+ ,7
+ ,49
+ ,18
+ ,15
+ ,14
+ ,2
+ ,9
+ ,42
+ ,12
+ ,11
+ ,9
+ ,1
+ ,15
+ ,43
+ ,11
+ ,12
+ ,9
+ ,2
+ ,16
+ ,37
+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+ ,43
+ ,11
+ ,16
+ ,12
+ ,1
+ ,12
+ ,44
+ ,14
+ ,13
+ ,11
+ ,1
+ ,10
+ ,42
+ ,13
+ ,16
+ ,13
+ ,1
+ ,13
+ ,51
+ ,12
+ ,9
+ ,15
+ ,1
+ ,9
+ ,54
+ ,11
+ ,14
+ ,13
+ ,2
+ ,14
+ ,41
+ ,15
+ ,14
+ ,16
+ ,2
+ ,14
+ ,51
+ ,11
+ ,12
+ ,13
+ ,1
+ ,8
+ ,51
+ ,13)
+ ,dim=c(6
+ ,143)
+ ,dimnames=list(c('popularity'
+ ,'hapiness'
+ ,'gender'
+ ,'doubsaboutactions'
+ ,'belonging'
+ ,'parentalexpectations')
+ ,1:143))
> y <- array(NA,dim=c(6,143),dimnames=list(c('popularity','hapiness','gender','doubsaboutactions','belonging','parentalexpectations'),1:143))
> 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 = '5'
> #'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
belonging popularity hapiness gender doubsaboutactions parentalexpectations
1 42 13 15 2 9 12
2 51 12 18 1 9 15
3 42 15 11 1 9 14
4 46 12 16 1 8 10
5 41 10 12 2 14 10
6 49 12 17 2 14 9
7 47 15 15 1 15 18
8 33 9 19 1 11 11
9 47 11 18 1 8 12
10 42 11 10 2 14 11
11 32 11 14 1 9 15
12 53 15 18 1 6 17
13 41 7 18 2 14 14
14 41 11 14 2 8 24
15 33 11 14 1 11 7
16 37 10 12 1 16 18
17 43 14 16 2 11 11
18 33 6 13 2 13 14
19 49 11 16 1 7 18
20 42 15 14 2 9 12
21 43 11 9 1 15 11
22 37 12 9 2 16 5
23 43 14 17 1 10 12
24 42 15 13 2 14 11
25 43 9 15 2 12 10
26 46 13 17 1 6 11
27 33 13 16 2 4 15
28 42 16 12 1 12 16
29 40 13 11 1 14 14
30 44 12 16 2 13 8
31 42 14 17 1 9 13
32 52 11 17 2 14 18
33 44 9 16 1 14 17
34 45 16 13 2 10 10
35 46 12 12 1 14 13
36 36 10 12 2 8 11
37 45 13 16 1 8 12
38 49 16 14 1 10 12
39 43 14 12 2 9 12
40 43 15 12 1 9 9
41 37 5 14 1 11 18
42 32 8 8 2 15 7
43 45 11 15 1 9 14
44 45 16 14 2 9 16
45 45 17 11 1 10 12
46 45 9 13 2 8 17
47 31 9 14 1 8 12
48 33 13 15 1 14 9
49 44 10 16 1 10 12
50 49 6 10 2 11 9
51 44 12 11 2 9 13
52 41 8 12 2 12 10
53 44 14 14 2 13 10
54 38 12 15 1 14 11
55 33 11 16 1 15 13
56 47 16 9 1 11 13
57 37 8 11 2 9 13
58 48 15 15 1 8 6
59 40 7 15 2 7 7
60 50 16 13 2 10 13
61 54 14 17 1 10 21
62 43 16 17 1 10 11
63 54 9 15 1 9 9
64 44 14 13 1 13 18
65 47 11 15 2 11 9
66 33 13 13 2 8 9
67 45 15 15 1 10 15
68 33 5 10 2 14 9
69 44 15 15 1 11 11
70 47 13 14 1 10 14
71 45 11 15 2 16 14
72 43 11 16 2 11 8
73 43 12 7 1 16 12
74 33 12 13 1 6 8
75 46 12 15 1 11 11
76 47 14 13 1 14 17
77 47 6 16 1 9 16
78 0 7 16 2 9 11
79 43 14 12 1 11 13
80 46 13 15 2 12 11
81 36 12 14 2 20 8
82 42 9 11 2 11 11
83 44 12 14 1 12 13
84 47 16 15 1 9 13
85 41 10 9 2 10 15
86 47 14 15 1 14 15
87 46 10 17 1 8 12
88 47 16 16 1 10 12
89 46 15 14 1 8 15
90 46 12 15 2 7 12
91 36 10 16 1 11 21
92 30 8 10 1 14 24
93 48 8 17 2 8 11
94 45 11 15 2 14 12
95 49 13 15 1 10 15
96 55 16 13 1 9 17
97 11 14 14 2 16 12
98 52 11 16 1 8 16
99 33 4 11 2 12 13
100 47 14 18 1 8 15
101 33 9 14 1 16 11
102 44 14 14 1 13 15
103 42 8 14 1 13 12
104 55 8 14 1 8 14
105 42 11 15 1 9 12
106 46 12 14 1 11 20
107 46 14 15 1 9 17
108 47 15 15 2 8 12
109 33 16 12 1 14 11
110 53 16 19 1 7 11
111 42 14 13 2 11 9
112 44 12 15 1 11 12
113 55 14 17 2 10 11
114 40 8 9 2 14 8
115 46 16 15 2 10 12
116 53 12 16 1 9 15
117 44 12 17 1 8 10
118 35 11 11 1 14 14
119 40 4 15 1 12 16
120 44 16 11 1 12 18
121 46 15 15 1 6 6
122 45 10 17 1 16 16
123 53 13 14 1 8 11
124 45 15 12 2 13 20
125 48 12 14 1 12 10
126 46 14 15 2 11 16
127 55 7 16 1 12 15
128 47 19 16 1 9 14
129 43 12 14 1 11 7
130 38 12 11 2 16 9
131 40 8 14 2 10 12
132 47 12 13 1 13 12
133 47 10 13 1 11 13
134 42 8 14 2 11 17
135 53 10 16 2 9 11
136 43 14 16 2 11 11
137 44 16 12 1 12 14
138 42 13 11 1 10 13
139 51 16 13 1 13 12
140 54 9 15 1 9 11
141 41 14 13 2 14 15
142 51 14 16 2 14 11
143 51 12 13 1 8 13
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) popularity hapiness
33.7628 0.5763 0.4781
gender doubsaboutactions parentalexpectations
-1.4337 -0.4131 0.1803
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-40.8443 -1.7693 0.5944 3.2473 13.2403
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 33.7628 6.5885 5.125 9.94e-07 ***
popularity 0.5763 0.1958 2.944 0.00381 **
hapiness 0.4781 0.2617 1.827 0.06990 .
gender -1.4337 1.2342 -1.162 0.24743
doubsaboutactions -0.4131 0.2238 -1.846 0.06712 .
parentalexpectations 0.1803 0.1725 1.045 0.29774
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.807 on 137 degrees of freedom
Multiple R-squared: 0.1742, Adjusted R-squared: 0.1441
F-statistic: 5.782 on 5 and 137 DF, p-value: 7.098e-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,] 6.254796e-01 0.7490408023 0.374520401
[2,] 4.897886e-01 0.9795772692 0.510211365
[3,] 4.743387e-01 0.9486773210 0.525661339
[4,] 3.692425e-01 0.7384850951 0.630757452
[5,] 2.813910e-01 0.5627820915 0.718608954
[6,] 1.920753e-01 0.3841505592 0.807924720
[7,] 1.716614e-01 0.3433228542 0.828338573
[8,] 1.258440e-01 0.2516880449 0.874155978
[9,] 1.447216e-01 0.2894432999 0.855278350
[10,] 9.830617e-02 0.1966123452 0.901693827
[11,] 1.143386e-01 0.2286772513 0.885661374
[12,] 1.003553e-01 0.2007106901 0.899644655
[13,] 1.174731e-01 0.2349462737 0.882526863
[14,] 8.147744e-02 0.1629548853 0.918522557
[15,] 6.260623e-02 0.1252124650 0.937393767
[16,] 4.612216e-02 0.0922443152 0.953877842
[17,] 3.644229e-02 0.0728845878 0.963557706
[18,] 2.427334e-02 0.0485466706 0.975726665
[19,] 6.003285e-02 0.1200656950 0.939967152
[20,] 4.655300e-02 0.0931060068 0.953446997
[21,] 3.226443e-02 0.0645288580 0.967735571
[22,] 2.188540e-02 0.0437708018 0.978114599
[23,] 1.718535e-02 0.0343706934 0.982814653
[24,] 1.925896e-02 0.0385179224 0.980741039
[25,] 1.283395e-02 0.0256679076 0.987166046
[26,] 8.484614e-03 0.0169692276 0.991515386
[27,] 7.305373e-03 0.0146107467 0.992694627
[28,] 4.911772e-03 0.0098235448 0.995088228
[29,] 3.252791e-03 0.0065055823 0.996747209
[30,] 2.362955e-03 0.0047259102 0.997637045
[31,] 1.524242e-03 0.0030484846 0.998475758
[32,] 9.462643e-04 0.0018925286 0.999053736
[33,] 5.956514e-04 0.0011913028 0.999404349
[34,] 3.478625e-04 0.0006957251 0.999652137
[35,] 2.435854e-04 0.0004871708 0.999756415
[36,] 1.398954e-04 0.0002797907 0.999860105
[37,] 7.862074e-05 0.0001572415 0.999921379
[38,] 9.936246e-05 0.0001987249 0.999900638
[39,] 1.770555e-04 0.0003541110 0.999822944
[40,] 5.667047e-04 0.0011334094 0.999433295
[41,] 3.971703e-04 0.0007943405 0.999602830
[42,] 4.424440e-03 0.0088488791 0.995575560
[43,] 3.213092e-03 0.0064261842 0.996786908
[44,] 2.302525e-03 0.0046050510 0.997697475
[45,] 1.522039e-03 0.0030440777 0.998477961
[46,] 1.203959e-03 0.0024079183 0.998796041
[47,] 2.043569e-03 0.0040871373 0.997956431
[48,] 1.638601e-03 0.0032772015 0.998361399
[49,] 1.108064e-03 0.0022161277 0.998891936
[50,] 9.177397e-04 0.0018354793 0.999082260
[51,] 5.992813e-04 0.0011985627 0.999400719
[52,] 4.976247e-04 0.0009952494 0.999502375
[53,] 5.333293e-04 0.0010666585 0.999466671
[54,] 4.005590e-04 0.0008011179 0.999599441
[55,] 1.883419e-03 0.0037668372 0.998116581
[56,] 1.242048e-03 0.0024840950 0.998757952
[57,] 1.078898e-03 0.0021577967 0.998921102
[58,] 1.865923e-03 0.0037318455 0.998134077
[59,] 1.265700e-03 0.0025313992 0.998734300
[60,] 8.555900e-04 0.0017111801 0.999144410
[61,] 5.645734e-04 0.0011291468 0.999435427
[62,] 3.989118e-04 0.0007978237 0.999601088
[63,] 3.013370e-04 0.0006026740 0.999698663
[64,] 1.905516e-04 0.0003811031 0.999809448
[65,] 1.551923e-04 0.0003103846 0.999844808
[66,] 3.399272e-04 0.0006798544 0.999660073
[67,] 2.379530e-04 0.0004759060 0.999762047
[68,] 1.641718e-04 0.0003283435 0.999835828
[69,] 1.476131e-04 0.0002952263 0.999852387
[70,] 8.957659e-01 0.2084682415 0.104234121
[71,] 8.715367e-01 0.2569266283 0.128463314
[72,] 8.490333e-01 0.3019333689 0.150966684
[73,] 8.323113e-01 0.3353774199 0.167688710
[74,] 8.046667e-01 0.3906665822 0.195333291
[75,] 7.683701e-01 0.4632598875 0.231629944
[76,] 7.301956e-01 0.5396087670 0.269804384
[77,] 6.871064e-01 0.6257872664 0.312893633
[78,] 6.601073e-01 0.6797853805 0.339892690
[79,] 6.388655e-01 0.7222689490 0.361134475
[80,] 5.911360e-01 0.8177279835 0.408863992
[81,] 5.499630e-01 0.9000740569 0.450037028
[82,] 5.183012e-01 0.9633976455 0.481698823
[83,] 5.875640e-01 0.8248720301 0.412436015
[84,] 6.624729e-01 0.6750542461 0.337527123
[85,] 6.436193e-01 0.7127613298 0.356380665
[86,] 6.215593e-01 0.7568814083 0.378440704
[87,] 5.793267e-01 0.8413465892 0.420673295
[88,] 5.848878e-01 0.8302244959 0.415112248
[89,] 9.985293e-01 0.0029413918 0.001470696
[90,] 9.980214e-01 0.0039572458 0.001978623
[91,] 9.985170e-01 0.0029659987 0.001482999
[92,] 9.982838e-01 0.0034324170 0.001716209
[93,] 9.988541e-01 0.0022917967 0.001145898
[94,] 9.981292e-01 0.0037415787 0.001870789
[95,] 9.972672e-01 0.0054655756 0.002732788
[96,] 9.984130e-01 0.0031739782 0.001586989
[97,] 9.983940e-01 0.0032120347 0.001606017
[98,] 9.973643e-01 0.0052714078 0.002635704
[99,] 9.961653e-01 0.0076694777 0.003834739
[100,] 9.940589e-01 0.0118822898 0.005941145
[101,] 9.975460e-01 0.0049079488 0.002453974
[102,] 9.961538e-01 0.0076923561 0.003846178
[103,] 9.941326e-01 0.0117348894 0.005867445
[104,] 9.921053e-01 0.0157894270 0.007894714
[105,] 9.932341e-01 0.0135318834 0.006765942
[106,] 9.907659e-01 0.0184681199 0.009234060
[107,] 9.852990e-01 0.0294020225 0.014701011
[108,] 9.805380e-01 0.0389240061 0.019462003
[109,] 9.858866e-01 0.0282267278 0.014113364
[110,] 9.887526e-01 0.0224947636 0.011247382
[111,] 9.949160e-01 0.0101680515 0.005084026
[112,] 9.909662e-01 0.0180675019 0.009033751
[113,] 9.891879e-01 0.0216242427 0.010812121
[114,] 9.937585e-01 0.0124830532 0.006241527
[115,] 9.937896e-01 0.0124207951 0.006210398
[116,] 9.918707e-01 0.0162586525 0.008129326
[117,] 9.851177e-01 0.0297645742 0.014882287
[118,] 9.729651e-01 0.0540698929 0.027034946
[119,] 9.571886e-01 0.0856228659 0.042811433
[120,] 9.614715e-01 0.0770570212 0.038528511
[121,] 9.831763e-01 0.0336474403 0.016823720
[122,] 9.717962e-01 0.0564076625 0.028203831
[123,] 9.503905e-01 0.0992189980 0.049609499
[124,] 9.062131e-01 0.1875737535 0.093786877
[125,] 8.469838e-01 0.3060323039 0.153016152
[126,] 7.289846e-01 0.5420308192 0.271015410
> postscript(file="/var/www/html/rcomp/tmp/1vjeu1292061566.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/2vjeu1292061566.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/3vjeu1292061566.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/45swx1292061566.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/55swx1292061566.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 = 143
Frequency = 1
1 2 3 4 5 6
-2.00425988 4.16323126 -3.03860123 0.60768038 2.58508503 7.22219150
7 8 9 10 11 12
1.80656822 -11.03868785 0.86721623 3.78474628 -12.34801834 2.83445695
13 14 15 16 17 18
0.72422783 -3.94987864 -9.07964633 -3.46448895 -1.05217205 -4.72202402
19 20 21 22 23 24
2.32872139 -2.67874175 4.24231111 0.59439870 -3.55733224 0.04521647
25 26 27 28 29 30
2.90081198 -1.45322896 -14.08875336 -3.21420083 -1.82042878 2.46745688
31 32 33 34 35 36
-5.15071534 9.17608035 1.55339242 0.99672467 4.45802318 -5.07387545
37 38 39 40 41 42
-1.32915243 2.72441232 -0.14621777 -1.61537628 -3.60480504 -2.39594866
43 44 45 46 47 48
0.35413608 -0.97610982 -0.41754557 2.94270308 -12.06773583 -9.83154347
49 50 51 52 53 54
0.22597115 12.78742284 2.30422289 2.91144916 1.91055296 -4.61578120
55 56 57 58 59 60
-9.46501666 3.34782624 -2.39058694 2.07797150 -0.47136741 5.45592177
61 62 63 64 65 66
5.82025907 -4.52965969 11.40806933 -0.48713875 5.51536905 -9.92034602
67 68 69 70 71 72
-1.71820625 -1.39693320 -1.58402024 2.09276968 4.67960826 1.21752347
73 74 75 76 77 78
4.85508784 -11.42367566 2.14487238 3.10624435 4.39697531 -40.84432021
79 80 81 82 83 84
-0.93391832 3.41535418 -1.68450838 3.21988173 0.67556581 -0.34708400
85 86 87 88 89 90
1.46562461 2.51055319 0.92162698 -0.23181410 -1.06632398 1.74580672
91 92 93 94 95 96
-8.98332207 -10.26350418 5.68815356 4.21391258 3.43438884 7.88807190
97 98 99 100 101 102
-30.21063589 6.10237213 -2.84605035 -1.40247930 -6.58254441 -0.42444907
103 104 105 106 107 108
1.57413908 12.14802645 -2.28532865 1.00057690 -0.91555944 1.43002957
109 110 111 112 113 114
-10.48663172 3.27476746 -0.25729714 -0.03539525 10.05659926 4.53255502
115 116 117 118 119 120
0.67996297 7.11945769 -1.87043283 -5.66783369 0.26703003 -1.09662288
121 122 123 124 125 126
-0.74825945 2.50548024 7.80734164 1.48780552 5.21636870 1.52460300
127 128 129 130 131 132
13.24029182 -2.73435747 0.34405613 -0.08289826 -0.23154348 4.74706213
133 134 135 136 137 138
4.89315863 1.28023383 10.42678717 -1.05217205 -0.85366556 -1.29262304
139 140 141 142 143
6.44187196 11.04753406 -1.09955652 8.18717437 6.50121713
> postscript(file="/var/www/html/rcomp/tmp/65swx1292061566.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 = 143
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.00425988 NA
1 4.16323126 -2.00425988
2 -3.03860123 4.16323126
3 0.60768038 -3.03860123
4 2.58508503 0.60768038
5 7.22219150 2.58508503
6 1.80656822 7.22219150
7 -11.03868785 1.80656822
8 0.86721623 -11.03868785
9 3.78474628 0.86721623
10 -12.34801834 3.78474628
11 2.83445695 -12.34801834
12 0.72422783 2.83445695
13 -3.94987864 0.72422783
14 -9.07964633 -3.94987864
15 -3.46448895 -9.07964633
16 -1.05217205 -3.46448895
17 -4.72202402 -1.05217205
18 2.32872139 -4.72202402
19 -2.67874175 2.32872139
20 4.24231111 -2.67874175
21 0.59439870 4.24231111
22 -3.55733224 0.59439870
23 0.04521647 -3.55733224
24 2.90081198 0.04521647
25 -1.45322896 2.90081198
26 -14.08875336 -1.45322896
27 -3.21420083 -14.08875336
28 -1.82042878 -3.21420083
29 2.46745688 -1.82042878
30 -5.15071534 2.46745688
31 9.17608035 -5.15071534
32 1.55339242 9.17608035
33 0.99672467 1.55339242
34 4.45802318 0.99672467
35 -5.07387545 4.45802318
36 -1.32915243 -5.07387545
37 2.72441232 -1.32915243
38 -0.14621777 2.72441232
39 -1.61537628 -0.14621777
40 -3.60480504 -1.61537628
41 -2.39594866 -3.60480504
42 0.35413608 -2.39594866
43 -0.97610982 0.35413608
44 -0.41754557 -0.97610982
45 2.94270308 -0.41754557
46 -12.06773583 2.94270308
47 -9.83154347 -12.06773583
48 0.22597115 -9.83154347
49 12.78742284 0.22597115
50 2.30422289 12.78742284
51 2.91144916 2.30422289
52 1.91055296 2.91144916
53 -4.61578120 1.91055296
54 -9.46501666 -4.61578120
55 3.34782624 -9.46501666
56 -2.39058694 3.34782624
57 2.07797150 -2.39058694
58 -0.47136741 2.07797150
59 5.45592177 -0.47136741
60 5.82025907 5.45592177
61 -4.52965969 5.82025907
62 11.40806933 -4.52965969
63 -0.48713875 11.40806933
64 5.51536905 -0.48713875
65 -9.92034602 5.51536905
66 -1.71820625 -9.92034602
67 -1.39693320 -1.71820625
68 -1.58402024 -1.39693320
69 2.09276968 -1.58402024
70 4.67960826 2.09276968
71 1.21752347 4.67960826
72 4.85508784 1.21752347
73 -11.42367566 4.85508784
74 2.14487238 -11.42367566
75 3.10624435 2.14487238
76 4.39697531 3.10624435
77 -40.84432021 4.39697531
78 -0.93391832 -40.84432021
79 3.41535418 -0.93391832
80 -1.68450838 3.41535418
81 3.21988173 -1.68450838
82 0.67556581 3.21988173
83 -0.34708400 0.67556581
84 1.46562461 -0.34708400
85 2.51055319 1.46562461
86 0.92162698 2.51055319
87 -0.23181410 0.92162698
88 -1.06632398 -0.23181410
89 1.74580672 -1.06632398
90 -8.98332207 1.74580672
91 -10.26350418 -8.98332207
92 5.68815356 -10.26350418
93 4.21391258 5.68815356
94 3.43438884 4.21391258
95 7.88807190 3.43438884
96 -30.21063589 7.88807190
97 6.10237213 -30.21063589
98 -2.84605035 6.10237213
99 -1.40247930 -2.84605035
100 -6.58254441 -1.40247930
101 -0.42444907 -6.58254441
102 1.57413908 -0.42444907
103 12.14802645 1.57413908
104 -2.28532865 12.14802645
105 1.00057690 -2.28532865
106 -0.91555944 1.00057690
107 1.43002957 -0.91555944
108 -10.48663172 1.43002957
109 3.27476746 -10.48663172
110 -0.25729714 3.27476746
111 -0.03539525 -0.25729714
112 10.05659926 -0.03539525
113 4.53255502 10.05659926
114 0.67996297 4.53255502
115 7.11945769 0.67996297
116 -1.87043283 7.11945769
117 -5.66783369 -1.87043283
118 0.26703003 -5.66783369
119 -1.09662288 0.26703003
120 -0.74825945 -1.09662288
121 2.50548024 -0.74825945
122 7.80734164 2.50548024
123 1.48780552 7.80734164
124 5.21636870 1.48780552
125 1.52460300 5.21636870
126 13.24029182 1.52460300
127 -2.73435747 13.24029182
128 0.34405613 -2.73435747
129 -0.08289826 0.34405613
130 -0.23154348 -0.08289826
131 4.74706213 -0.23154348
132 4.89315863 4.74706213
133 1.28023383 4.89315863
134 10.42678717 1.28023383
135 -1.05217205 10.42678717
136 -0.85366556 -1.05217205
137 -1.29262304 -0.85366556
138 6.44187196 -1.29262304
139 11.04753406 6.44187196
140 -1.09955652 11.04753406
141 8.18717437 -1.09955652
142 6.50121713 8.18717437
143 NA 6.50121713
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 4.16323126 -2.00425988
[2,] -3.03860123 4.16323126
[3,] 0.60768038 -3.03860123
[4,] 2.58508503 0.60768038
[5,] 7.22219150 2.58508503
[6,] 1.80656822 7.22219150
[7,] -11.03868785 1.80656822
[8,] 0.86721623 -11.03868785
[9,] 3.78474628 0.86721623
[10,] -12.34801834 3.78474628
[11,] 2.83445695 -12.34801834
[12,] 0.72422783 2.83445695
[13,] -3.94987864 0.72422783
[14,] -9.07964633 -3.94987864
[15,] -3.46448895 -9.07964633
[16,] -1.05217205 -3.46448895
[17,] -4.72202402 -1.05217205
[18,] 2.32872139 -4.72202402
[19,] -2.67874175 2.32872139
[20,] 4.24231111 -2.67874175
[21,] 0.59439870 4.24231111
[22,] -3.55733224 0.59439870
[23,] 0.04521647 -3.55733224
[24,] 2.90081198 0.04521647
[25,] -1.45322896 2.90081198
[26,] -14.08875336 -1.45322896
[27,] -3.21420083 -14.08875336
[28,] -1.82042878 -3.21420083
[29,] 2.46745688 -1.82042878
[30,] -5.15071534 2.46745688
[31,] 9.17608035 -5.15071534
[32,] 1.55339242 9.17608035
[33,] 0.99672467 1.55339242
[34,] 4.45802318 0.99672467
[35,] -5.07387545 4.45802318
[36,] -1.32915243 -5.07387545
[37,] 2.72441232 -1.32915243
[38,] -0.14621777 2.72441232
[39,] -1.61537628 -0.14621777
[40,] -3.60480504 -1.61537628
[41,] -2.39594866 -3.60480504
[42,] 0.35413608 -2.39594866
[43,] -0.97610982 0.35413608
[44,] -0.41754557 -0.97610982
[45,] 2.94270308 -0.41754557
[46,] -12.06773583 2.94270308
[47,] -9.83154347 -12.06773583
[48,] 0.22597115 -9.83154347
[49,] 12.78742284 0.22597115
[50,] 2.30422289 12.78742284
[51,] 2.91144916 2.30422289
[52,] 1.91055296 2.91144916
[53,] -4.61578120 1.91055296
[54,] -9.46501666 -4.61578120
[55,] 3.34782624 -9.46501666
[56,] -2.39058694 3.34782624
[57,] 2.07797150 -2.39058694
[58,] -0.47136741 2.07797150
[59,] 5.45592177 -0.47136741
[60,] 5.82025907 5.45592177
[61,] -4.52965969 5.82025907
[62,] 11.40806933 -4.52965969
[63,] -0.48713875 11.40806933
[64,] 5.51536905 -0.48713875
[65,] -9.92034602 5.51536905
[66,] -1.71820625 -9.92034602
[67,] -1.39693320 -1.71820625
[68,] -1.58402024 -1.39693320
[69,] 2.09276968 -1.58402024
[70,] 4.67960826 2.09276968
[71,] 1.21752347 4.67960826
[72,] 4.85508784 1.21752347
[73,] -11.42367566 4.85508784
[74,] 2.14487238 -11.42367566
[75,] 3.10624435 2.14487238
[76,] 4.39697531 3.10624435
[77,] -40.84432021 4.39697531
[78,] -0.93391832 -40.84432021
[79,] 3.41535418 -0.93391832
[80,] -1.68450838 3.41535418
[81,] 3.21988173 -1.68450838
[82,] 0.67556581 3.21988173
[83,] -0.34708400 0.67556581
[84,] 1.46562461 -0.34708400
[85,] 2.51055319 1.46562461
[86,] 0.92162698 2.51055319
[87,] -0.23181410 0.92162698
[88,] -1.06632398 -0.23181410
[89,] 1.74580672 -1.06632398
[90,] -8.98332207 1.74580672
[91,] -10.26350418 -8.98332207
[92,] 5.68815356 -10.26350418
[93,] 4.21391258 5.68815356
[94,] 3.43438884 4.21391258
[95,] 7.88807190 3.43438884
[96,] -30.21063589 7.88807190
[97,] 6.10237213 -30.21063589
[98,] -2.84605035 6.10237213
[99,] -1.40247930 -2.84605035
[100,] -6.58254441 -1.40247930
[101,] -0.42444907 -6.58254441
[102,] 1.57413908 -0.42444907
[103,] 12.14802645 1.57413908
[104,] -2.28532865 12.14802645
[105,] 1.00057690 -2.28532865
[106,] -0.91555944 1.00057690
[107,] 1.43002957 -0.91555944
[108,] -10.48663172 1.43002957
[109,] 3.27476746 -10.48663172
[110,] -0.25729714 3.27476746
[111,] -0.03539525 -0.25729714
[112,] 10.05659926 -0.03539525
[113,] 4.53255502 10.05659926
[114,] 0.67996297 4.53255502
[115,] 7.11945769 0.67996297
[116,] -1.87043283 7.11945769
[117,] -5.66783369 -1.87043283
[118,] 0.26703003 -5.66783369
[119,] -1.09662288 0.26703003
[120,] -0.74825945 -1.09662288
[121,] 2.50548024 -0.74825945
[122,] 7.80734164 2.50548024
[123,] 1.48780552 7.80734164
[124,] 5.21636870 1.48780552
[125,] 1.52460300 5.21636870
[126,] 13.24029182 1.52460300
[127,] -2.73435747 13.24029182
[128,] 0.34405613 -2.73435747
[129,] -0.08289826 0.34405613
[130,] -0.23154348 -0.08289826
[131,] 4.74706213 -0.23154348
[132,] 4.89315863 4.74706213
[133,] 1.28023383 4.89315863
[134,] 10.42678717 1.28023383
[135,] -1.05217205 10.42678717
[136,] -0.85366556 -1.05217205
[137,] -1.29262304 -0.85366556
[138,] 6.44187196 -1.29262304
[139,] 11.04753406 6.44187196
[140,] -1.09955652 11.04753406
[141,] 8.18717437 -1.09955652
[142,] 6.50121713 8.18717437
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 4.16323126 -2.00425988
2 -3.03860123 4.16323126
3 0.60768038 -3.03860123
4 2.58508503 0.60768038
5 7.22219150 2.58508503
6 1.80656822 7.22219150
7 -11.03868785 1.80656822
8 0.86721623 -11.03868785
9 3.78474628 0.86721623
10 -12.34801834 3.78474628
11 2.83445695 -12.34801834
12 0.72422783 2.83445695
13 -3.94987864 0.72422783
14 -9.07964633 -3.94987864
15 -3.46448895 -9.07964633
16 -1.05217205 -3.46448895
17 -4.72202402 -1.05217205
18 2.32872139 -4.72202402
19 -2.67874175 2.32872139
20 4.24231111 -2.67874175
21 0.59439870 4.24231111
22 -3.55733224 0.59439870
23 0.04521647 -3.55733224
24 2.90081198 0.04521647
25 -1.45322896 2.90081198
26 -14.08875336 -1.45322896
27 -3.21420083 -14.08875336
28 -1.82042878 -3.21420083
29 2.46745688 -1.82042878
30 -5.15071534 2.46745688
31 9.17608035 -5.15071534
32 1.55339242 9.17608035
33 0.99672467 1.55339242
34 4.45802318 0.99672467
35 -5.07387545 4.45802318
36 -1.32915243 -5.07387545
37 2.72441232 -1.32915243
38 -0.14621777 2.72441232
39 -1.61537628 -0.14621777
40 -3.60480504 -1.61537628
41 -2.39594866 -3.60480504
42 0.35413608 -2.39594866
43 -0.97610982 0.35413608
44 -0.41754557 -0.97610982
45 2.94270308 -0.41754557
46 -12.06773583 2.94270308
47 -9.83154347 -12.06773583
48 0.22597115 -9.83154347
49 12.78742284 0.22597115
50 2.30422289 12.78742284
51 2.91144916 2.30422289
52 1.91055296 2.91144916
53 -4.61578120 1.91055296
54 -9.46501666 -4.61578120
55 3.34782624 -9.46501666
56 -2.39058694 3.34782624
57 2.07797150 -2.39058694
58 -0.47136741 2.07797150
59 5.45592177 -0.47136741
60 5.82025907 5.45592177
61 -4.52965969 5.82025907
62 11.40806933 -4.52965969
63 -0.48713875 11.40806933
64 5.51536905 -0.48713875
65 -9.92034602 5.51536905
66 -1.71820625 -9.92034602
67 -1.39693320 -1.71820625
68 -1.58402024 -1.39693320
69 2.09276968 -1.58402024
70 4.67960826 2.09276968
71 1.21752347 4.67960826
72 4.85508784 1.21752347
73 -11.42367566 4.85508784
74 2.14487238 -11.42367566
75 3.10624435 2.14487238
76 4.39697531 3.10624435
77 -40.84432021 4.39697531
78 -0.93391832 -40.84432021
79 3.41535418 -0.93391832
80 -1.68450838 3.41535418
81 3.21988173 -1.68450838
82 0.67556581 3.21988173
83 -0.34708400 0.67556581
84 1.46562461 -0.34708400
85 2.51055319 1.46562461
86 0.92162698 2.51055319
87 -0.23181410 0.92162698
88 -1.06632398 -0.23181410
89 1.74580672 -1.06632398
90 -8.98332207 1.74580672
91 -10.26350418 -8.98332207
92 5.68815356 -10.26350418
93 4.21391258 5.68815356
94 3.43438884 4.21391258
95 7.88807190 3.43438884
96 -30.21063589 7.88807190
97 6.10237213 -30.21063589
98 -2.84605035 6.10237213
99 -1.40247930 -2.84605035
100 -6.58254441 -1.40247930
101 -0.42444907 -6.58254441
102 1.57413908 -0.42444907
103 12.14802645 1.57413908
104 -2.28532865 12.14802645
105 1.00057690 -2.28532865
106 -0.91555944 1.00057690
107 1.43002957 -0.91555944
108 -10.48663172 1.43002957
109 3.27476746 -10.48663172
110 -0.25729714 3.27476746
111 -0.03539525 -0.25729714
112 10.05659926 -0.03539525
113 4.53255502 10.05659926
114 0.67996297 4.53255502
115 7.11945769 0.67996297
116 -1.87043283 7.11945769
117 -5.66783369 -1.87043283
118 0.26703003 -5.66783369
119 -1.09662288 0.26703003
120 -0.74825945 -1.09662288
121 2.50548024 -0.74825945
122 7.80734164 2.50548024
123 1.48780552 7.80734164
124 5.21636870 1.48780552
125 1.52460300 5.21636870
126 13.24029182 1.52460300
127 -2.73435747 13.24029182
128 0.34405613 -2.73435747
129 -0.08289826 0.34405613
130 -0.23154348 -0.08289826
131 4.74706213 -0.23154348
132 4.89315863 4.74706213
133 1.28023383 4.89315863
134 10.42678717 1.28023383
135 -1.05217205 10.42678717
136 -0.85366556 -1.05217205
137 -1.29262304 -0.85366556
138 6.44187196 -1.29262304
139 11.04753406 6.44187196
140 -1.09955652 11.04753406
141 8.18717437 -1.09955652
142 6.50121713 8.18717437
> 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/7ykv01292061566.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/89tu31292061566.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/99tu31292061566.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/109tu31292061566.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/1153sc1292061566.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/12fu9f1292061566.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/134d6q1292061566.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/14xmnt1292061566.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/15bwlk1292061566.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/16ff281292061566.tab")
+ }
>
> try(system("convert tmp/1vjeu1292061566.ps tmp/1vjeu1292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/2vjeu1292061566.ps tmp/2vjeu1292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/3vjeu1292061566.ps tmp/3vjeu1292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/45swx1292061566.ps tmp/45swx1292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/55swx1292061566.ps tmp/55swx1292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/65swx1292061566.ps tmp/65swx1292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ykv01292061566.ps tmp/7ykv01292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/89tu31292061566.ps tmp/89tu31292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/99tu31292061566.ps tmp/99tu31292061566.png",intern=TRUE))
character(0)
> try(system("convert tmp/109tu31292061566.ps tmp/109tu31292061566.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.815 1.886 10.571