R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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(9
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,9
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,9
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,9
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,9
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,9
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,10
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,10
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,10
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,10
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,10
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,10
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,10
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,10
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,10
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,10
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,10
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,10
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,10
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,10
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,10
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,10
+ ,16
+ ,18
+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organization
'),1:159))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '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
ParentalCriticism Month DoubtsActions ParentalExpectations Standards
1 12 9 14 11 24
2 8 9 11 7 25
3 8 9 6 17 30
4 8 9 12 10 19
5 9 9 8 12 22
6 7 9 10 12 22
7 4 10 10 11 25
8 11 10 11 11 23
9 7 10 16 12 17
10 7 10 11 13 21
11 12 10 13 14 19
12 10 10 12 16 19
13 10 10 8 11 15
14 8 10 12 10 16
15 8 10 11 11 23
16 4 10 4 15 27
17 9 10 9 9 22
18 8 10 8 11 14
19 7 10 8 17 22
20 11 10 14 17 23
21 9 10 15 11 23
22 11 10 16 18 21
23 13 10 9 14 19
24 8 10 14 10 18
25 8 10 11 11 20
26 9 10 8 15 23
27 6 10 9 15 25
28 9 10 9 13 19
29 9 10 9 16 24
30 6 10 9 13 22
31 6 10 10 9 25
32 16 10 16 18 26
33 5 10 11 18 29
34 7 10 8 12 32
35 9 10 9 17 25
36 6 10 16 9 29
37 6 10 11 9 28
38 5 10 16 12 17
39 12 10 12 18 28
40 7 10 12 12 29
41 10 10 14 18 26
42 9 10 9 14 25
43 8 10 10 15 14
44 5 10 9 16 25
45 8 10 10 10 26
46 8 10 12 11 20
47 10 10 14 14 18
48 6 10 14 9 32
49 8 10 10 12 25
50 7 10 14 17 25
51 4 10 16 5 23
52 8 10 9 12 21
53 8 10 10 12 20
54 4 10 6 6 15
55 20 10 8 24 30
56 8 10 13 12 24
57 8 10 10 12 26
58 6 10 8 14 24
59 4 10 7 7 22
60 8 10 15 13 14
61 9 10 9 12 24
62 6 10 10 13 24
63 7 10 12 14 24
64 9 10 13 8 24
65 5 10 10 11 19
66 5 10 11 9 31
67 8 10 8 11 22
68 8 10 9 13 27
69 6 10 13 10 19
70 8 10 11 11 25
71 7 10 8 12 20
72 7 10 9 9 21
73 9 10 9 15 27
74 11 10 15 18 23
75 6 10 9 15 25
76 8 10 10 12 20
77 6 10 14 13 21
78 9 10 12 14 22
79 8 10 12 10 23
80 6 10 11 13 25
81 10 10 14 13 25
82 8 10 6 11 17
83 8 10 12 13 19
84 10 10 8 16 25
85 5 10 14 8 19
86 7 10 11 16 20
87 5 10 10 11 26
88 8 10 14 9 23
89 14 10 12 16 27
90 7 10 10 12 17
91 8 10 14 14 17
92 6 10 5 8 19
93 5 10 11 9 17
94 6 10 10 15 22
95 10 10 9 11 21
96 12 10 10 21 32
97 9 10 16 14 21
98 12 10 13 18 21
99 7 10 9 12 18
100 8 10 10 13 18
101 10 10 10 15 23
102 6 10 7 12 19
103 10 10 9 19 20
104 10 10 8 15 21
105 10 10 14 11 20
106 5 10 14 11 17
107 7 10 8 10 18
108 10 10 9 13 19
109 11 10 14 15 22
110 6 10 14 12 15
111 7 10 8 12 14
112 12 10 8 16 18
113 11 10 8 9 24
114 11 10 7 18 35
115 11 10 6 8 29
116 5 10 8 13 21
117 8 10 6 17 25
118 6 10 11 9 20
119 9 10 14 15 22
120 4 10 11 8 13
121 4 10 11 7 26
122 7 10 11 12 17
123 11 10 14 14 25
124 6 10 8 6 20
125 7 10 20 8 19
126 8 10 11 17 21
127 4 10 8 10 22
128 8 10 11 11 24
129 9 10 10 14 21
130 8 10 14 11 26
131 11 10 11 13 24
132 8 10 9 12 16
133 5 10 9 11 23
134 4 10 8 9 18
135 8 10 10 12 16
136 10 10 13 20 26
137 6 10 13 12 19
138 9 10 12 13 21
139 9 10 8 12 21
140 13 10 13 12 22
141 9 10 14 9 23
142 10 10 12 15 29
143 20 10 14 24 21
144 5 10 15 7 21
145 11 10 13 17 23
146 6 10 16 11 27
147 9 10 9 17 25
148 7 10 9 11 21
149 9 10 9 12 10
150 10 10 8 14 20
151 9 10 7 11 26
152 8 10 16 16 24
153 7 10 11 21 29
154 6 10 9 14 19
155 13 10 11 20 24
156 6 10 9 13 19
157 8 10 14 11 24
158 10 10 13 15 22
159 16 10 16 19 17
Organization\r
1 26
2 23
3 25
4 23
5 19
6 29
7 25
8 21
9 22
10 25
11 24
12 18
13 22
14 15
15 22
16 28
17 20
18 12
19 24
20 20
21 21
22 20
23 21
24 23
25 28
26 24
27 24
28 24
29 23
30 23
31 29
32 24
33 18
34 25
35 21
36 26
37 22
38 22
39 22
40 23
41 30
42 23
43 17
44 23
45 23
46 25
47 24
48 24
49 23
50 21
51 24
52 24
53 28
54 16
55 20
56 29
57 27
58 22
59 28
60 16
61 25
62 24
63 28
64 24
65 23
66 30
67 24
68 21
69 25
70 25
71 22
72 23
73 26
74 23
75 25
76 21
77 25
78 24
79 29
80 22
81 27
82 26
83 22
84 24
85 27
86 24
87 24
88 29
89 22
90 21
91 24
92 24
93 23
94 20
95 27
96 26
97 25
98 21
99 21
100 19
101 21
102 21
103 16
104 22
105 29
106 15
107 17
108 15
109 21
110 21
111 19
112 24
113 20
114 17
115 23
116 24
117 14
118 19
119 24
120 13
121 22
122 16
123 19
124 25
125 25
126 23
127 24
128 26
129 26
130 25
131 18
132 21
133 26
134 23
135 23
136 22
137 20
138 13
139 24
140 15
141 14
142 22
143 10
144 24
145 22
146 24
147 19
148 20
149 13
150 20
151 22
152 24
153 29
154 12
155 20
156 21
157 24
158 22
159 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month DoubtsActions
16.02340 -1.34666 0.15083
ParentalExpectations Standards `Organization\r`
0.44122 0.02969 -0.10538
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.12182 -1.30646 -0.03253 1.13980 6.86444
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.02340 9.09176 1.762 0.0800 .
Month -1.34666 0.89779 -1.500 0.1357
DoubtsActions 0.15083 0.06113 2.467 0.0147 *
ParentalExpectations 0.44122 0.05300 8.324 4.42e-14 ***
Standards 0.02969 0.04571 0.649 0.5170
`Organization\r` -0.10538 0.04853 -2.171 0.0314 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.136 on 153 degrees of freedom
Multiple R-squared: 0.3972, Adjusted R-squared: 0.3775
F-statistic: 20.16 on 5 and 153 DF, p-value: 2.025e-15
> 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.838660337 0.32267933 0.16133966
[2,] 0.755482639 0.48903472 0.24451736
[3,] 0.872884456 0.25423109 0.12711554
[4,] 0.809493175 0.38101365 0.19050683
[5,] 0.860527729 0.27894454 0.13947227
[6,] 0.826912779 0.34617444 0.17308722
[7,] 0.757820985 0.48435803 0.24217901
[8,] 0.732075055 0.53584989 0.26792494
[9,] 0.707583243 0.58483351 0.29241676
[10,] 0.652904217 0.69419157 0.34709578
[11,] 0.589664517 0.82067097 0.41033548
[12,] 0.516748601 0.96650280 0.48325140
[13,] 0.442878837 0.88575767 0.55712116
[14,] 0.367622076 0.73524415 0.63237792
[15,] 0.642988921 0.71402216 0.35701108
[16,] 0.584468612 0.83106278 0.41553139
[17,] 0.524192716 0.95161457 0.47580728
[18,] 0.472385893 0.94477179 0.52761411
[19,] 0.467397122 0.93479424 0.53260288
[20,] 0.415919016 0.83183803 0.58408098
[21,] 0.358842450 0.71768490 0.64115755
[22,] 0.346202247 0.69240449 0.65379775
[23,] 0.288884007 0.57776801 0.71111599
[24,] 0.565924206 0.86815159 0.43407579
[25,] 0.792881527 0.41423695 0.20711847
[26,] 0.770208851 0.45958230 0.22979115
[27,] 0.729645890 0.54070822 0.27035411
[28,] 0.707977812 0.58404438 0.29202219
[29,] 0.659078818 0.68184236 0.34092118
[30,] 0.829119561 0.34176088 0.17088044
[31,] 0.829236589 0.34152682 0.17076341
[32,] 0.797103654 0.40579269 0.20289635
[33,] 0.756978663 0.48604267 0.24302134
[34,] 0.723374286 0.55325143 0.27662571
[35,] 0.705275588 0.58944882 0.29472441
[36,] 0.791481582 0.41703684 0.20851842
[37,] 0.765756519 0.46848696 0.23424348
[38,] 0.726625123 0.54674975 0.27337488
[39,] 0.689235283 0.62152943 0.31076472
[40,] 0.652414779 0.69517044 0.34758522
[41,] 0.607145112 0.78570978 0.39285489
[42,] 0.672229510 0.65554098 0.32777049
[43,] 0.678918680 0.64216264 0.32108132
[44,] 0.636047465 0.72790507 0.36395253
[45,] 0.593403548 0.81319290 0.40659645
[46,] 0.565567718 0.86886456 0.43443228
[47,] 0.940005194 0.11998961 0.05999481
[48,] 0.924889635 0.15022073 0.07511037
[49,] 0.908809498 0.18238100 0.09119050
[50,] 0.910060075 0.17987985 0.08993993
[51,] 0.889555173 0.22088965 0.11044483
[52,] 0.877391582 0.24521684 0.12260842
[53,] 0.868104156 0.26379169 0.13189584
[54,] 0.863140674 0.27371865 0.13685933
[55,] 0.846682697 0.30663461 0.15331730
[56,] 0.863500618 0.27299876 0.13649938
[57,] 0.861290621 0.27741876 0.13870938
[58,] 0.840095530 0.31980894 0.15990447
[59,] 0.820282380 0.35943524 0.17971762
[60,] 0.789311084 0.42137783 0.21068892
[61,] 0.760697636 0.47860473 0.23930236
[62,] 0.728230394 0.54353921 0.27176961
[63,] 0.688801367 0.62239727 0.31119863
[64,] 0.653459989 0.69308002 0.34654001
[65,] 0.611427130 0.77714574 0.38857287
[66,] 0.565766916 0.86846617 0.43423308
[67,] 0.590020058 0.81995988 0.40997994
[68,] 0.544463855 0.91107229 0.45553615
[69,] 0.556934710 0.88613058 0.44306529
[70,] 0.511249970 0.97750006 0.48875003
[71,] 0.486476189 0.97295238 0.51352381
[72,] 0.497384535 0.99476907 0.50261547
[73,] 0.476461968 0.95292394 0.52353803
[74,] 0.463708826 0.92741765 0.53629117
[75,] 0.418860650 0.83772130 0.58113935
[76,] 0.382566175 0.76513235 0.61743382
[77,] 0.348467274 0.69693455 0.65153273
[78,] 0.356501585 0.71300317 0.64349841
[79,] 0.360858325 0.72171665 0.63914168
[80,] 0.340972531 0.68194506 0.65902747
[81,] 0.453417929 0.90683586 0.54658207
[82,] 0.410839667 0.82167933 0.58916033
[83,] 0.372006840 0.74401368 0.62799316
[84,] 0.338713815 0.67742763 0.66128618
[85,] 0.309993232 0.61998646 0.69000677
[86,] 0.362091956 0.72418391 0.63790804
[87,] 0.429239445 0.85847889 0.57076055
[88,] 0.385480204 0.77096041 0.61451980
[89,] 0.340658328 0.68131666 0.65934167
[90,] 0.309314223 0.61862845 0.69068578
[91,] 0.269881740 0.53976348 0.73011826
[92,] 0.231925028 0.46385006 0.76807497
[93,] 0.201591045 0.40318209 0.79840895
[94,] 0.178958652 0.35791730 0.82104135
[95,] 0.158482858 0.31696572 0.84151714
[96,] 0.139585464 0.27917093 0.86041454
[97,] 0.171041463 0.34208293 0.82895854
[98,] 0.218911912 0.43782382 0.78108809
[99,] 0.185010778 0.37002156 0.81498922
[100,] 0.165287931 0.33057586 0.83471207
[101,] 0.146107543 0.29221509 0.85389246
[102,] 0.141777781 0.28355556 0.85822222
[103,] 0.116112433 0.23222487 0.88388757
[104,] 0.155957901 0.31191580 0.84404210
[105,] 0.286130848 0.57226170 0.71386915
[106,] 0.248102017 0.49620403 0.75189798
[107,] 0.593853576 0.81229285 0.40614642
[108,] 0.590831989 0.81833602 0.40916801
[109,] 0.599834665 0.80033067 0.40016534
[110,] 0.550593704 0.89881259 0.44940630
[111,] 0.496421688 0.99284338 0.50357831
[112,] 0.582027940 0.83594412 0.41797206
[113,] 0.550291634 0.89941673 0.44970837
[114,] 0.547966237 0.90406753 0.45203376
[115,] 0.508060688 0.98387862 0.49193931
[116,] 0.527685599 0.94462880 0.47231440
[117,] 0.468468019 0.93693604 0.53153198
[118,] 0.453220184 0.90644037 0.54677982
[119,] 0.429228503 0.85845701 0.57077150
[120,] 0.411370383 0.82274077 0.58862962
[121,] 0.385322649 0.77064530 0.61467735
[122,] 0.343051149 0.68610230 0.65694885
[123,] 0.340517097 0.68103419 0.65948290
[124,] 0.286380652 0.57276130 0.71361935
[125,] 0.239619196 0.47923839 0.76038080
[126,] 0.204602211 0.40920442 0.79539779
[127,] 0.164617590 0.32923518 0.83538241
[128,] 0.152030054 0.30406011 0.84796995
[129,] 0.163100196 0.32620039 0.83689980
[130,] 0.147351757 0.29470351 0.85264824
[131,] 0.182073900 0.36414780 0.81792610
[132,] 0.231895279 0.46379056 0.76810472
[133,] 0.176992281 0.35398456 0.82300772
[134,] 0.140774896 0.28154979 0.85922510
[135,] 0.212972169 0.42594434 0.78702783
[136,] 0.161709529 0.32341906 0.83829047
[137,] 0.116398568 0.23279714 0.88360143
[138,] 0.085031712 0.17006342 0.91496829
[139,] 0.051397993 0.10279599 0.94860201
[140,] 0.027970501 0.05594100 0.97202950
[141,] 0.015958987 0.03191797 0.98404101
[142,] 0.008440951 0.01688190 0.99155905
> postscript(file="/var/www/html/freestat/rcomp/tmp/1s3uf1293491331.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/freestat/rcomp/tmp/2s3uf1293491331.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/freestat/rcomp/tmp/3s3uf1293491331.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/freestat/rcomp/tmp/42uc01293491331.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/freestat/rcomp/tmp/52uc01293491331.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 159
Frequency = 1
1 2 3 4 5 6
3.15907876 1.03059746 -2.56511049 -0.26577090 -0.05549396 -1.30330087
7 8 9 10 11 12
-3.02601981 3.46098445 -1.45087371 -0.94054141 3.27057073 -0.09334836
13 14 15 16 17 18
3.25634185 0.32686780 0.56636938 -3.62914380 2.56937935 0.23217861
19 20 21 22 23 24
-2.38800334 0.25580240 0.85767210 -0.42770053 4.55772830 0.80891898
25 26 27 28 29 30
1.28773702 0.46474825 -2.74545189 1.31510189 -0.26236960 -1.87934111
31 32 33 34 35 36
0.27795752 4.84540904 -6.12181816 -0.37338463 -0.94404429 -1.06190989
37 38 39 40 41 42
-0.69962313 -3.45087371 1.17857949 -1.09840875 -0.22062522 0.59038200
43 44 45 46 47 48
-1.30742817 -4.29205562 1.17474312 0.82075415 1.14942867 -1.06008165
49 50 51 52 53 54
0.32199153 -3.69818473 -1.32968834 0.69694865 0.99734629 -0.86821748
55 56 57 58 59 60
6.86443707 0.53150285 0.71384521 -2.33448882 -0.40344744 -1.28451592
61 62 63 64 65 66
1.71327550 -1.98415633 -1.30549161 2.76945346 -2.05867350 -0.94560180
67 68 69 70 71 72
1.25930952 -0.23854110 -0.85916910 0.82315211 -0.33330709 0.91522015
73 74 75 76 77 78
0.40594591 -0.02008972 -2.64006696 0.25965181 -2.39302567 0.33234074
79 80 81 82 83 84
1.59445459 -2.37544030 1.69900008 1.92016568 -0.34815222 0.96415739
85 86 87 88 89 90
-0.91678971 -2.33989674 -2.16109076 1.73401722 4.09070313 -0.65129011
91 92 93 94 95 96
-0.82088530 1.12450829 -1.26769192 -3.22876160 3.45432224 0.45937483
97 98 99 100 101 102
-0.13590066 1.13016866 -0.53014805 -0.33296480 0.84693730 -1.25817790
103 104 105 106 107 108
-1.20497641 1.31335045 2.94063768 -3.44569321 0.08157795 1.36663755
109 110 111 112 113 114
1.27331097 -2.19523041 -0.47134571 3.17195957 4.66083538 0.19799311
115 116 117 118 119 120
5.57143501 -2.59344207 -2.22925451 -0.77828970 -0.41053425 -2.76157827
121 122 123 124 125 126
-1.75781346 -1.32904284 1.41470185 1.63016055 -0.03252809 -1.91618650
127 128 129 130 131 132
-2.29947167 0.95822306 0.87445279 0.34098182 2.23270602 0.52922400
133 134 135 136 137 138
-1.71043474 -1.84489368 0.58916577 -1.79531417 -2.26853136 -0.35598862
139 140 141 142 143 144
1.84777674 4.11548593 1.15324332 0.47254989 5.17279351 -1.00192582
145 146 147 148 149 150
0.61740034 -2.09574531 -1.15481414 -0.28337225 0.86426074 1.57348543
151 152 153 154 155 156
2.08062365 -2.21278128 -4.28624040 -3.39073604 1.35494421 -2.00105289
157 158 159
0.29496894 0.52952399 4.24982476
> postscript(file="/var/www/html/freestat/rcomp/tmp/62uc01293491331.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 3.15907876 NA
1 1.03059746 3.15907876
2 -2.56511049 1.03059746
3 -0.26577090 -2.56511049
4 -0.05549396 -0.26577090
5 -1.30330087 -0.05549396
6 -3.02601981 -1.30330087
7 3.46098445 -3.02601981
8 -1.45087371 3.46098445
9 -0.94054141 -1.45087371
10 3.27057073 -0.94054141
11 -0.09334836 3.27057073
12 3.25634185 -0.09334836
13 0.32686780 3.25634185
14 0.56636938 0.32686780
15 -3.62914380 0.56636938
16 2.56937935 -3.62914380
17 0.23217861 2.56937935
18 -2.38800334 0.23217861
19 0.25580240 -2.38800334
20 0.85767210 0.25580240
21 -0.42770053 0.85767210
22 4.55772830 -0.42770053
23 0.80891898 4.55772830
24 1.28773702 0.80891898
25 0.46474825 1.28773702
26 -2.74545189 0.46474825
27 1.31510189 -2.74545189
28 -0.26236960 1.31510189
29 -1.87934111 -0.26236960
30 0.27795752 -1.87934111
31 4.84540904 0.27795752
32 -6.12181816 4.84540904
33 -0.37338463 -6.12181816
34 -0.94404429 -0.37338463
35 -1.06190989 -0.94404429
36 -0.69962313 -1.06190989
37 -3.45087371 -0.69962313
38 1.17857949 -3.45087371
39 -1.09840875 1.17857949
40 -0.22062522 -1.09840875
41 0.59038200 -0.22062522
42 -1.30742817 0.59038200
43 -4.29205562 -1.30742817
44 1.17474312 -4.29205562
45 0.82075415 1.17474312
46 1.14942867 0.82075415
47 -1.06008165 1.14942867
48 0.32199153 -1.06008165
49 -3.69818473 0.32199153
50 -1.32968834 -3.69818473
51 0.69694865 -1.32968834
52 0.99734629 0.69694865
53 -0.86821748 0.99734629
54 6.86443707 -0.86821748
55 0.53150285 6.86443707
56 0.71384521 0.53150285
57 -2.33448882 0.71384521
58 -0.40344744 -2.33448882
59 -1.28451592 -0.40344744
60 1.71327550 -1.28451592
61 -1.98415633 1.71327550
62 -1.30549161 -1.98415633
63 2.76945346 -1.30549161
64 -2.05867350 2.76945346
65 -0.94560180 -2.05867350
66 1.25930952 -0.94560180
67 -0.23854110 1.25930952
68 -0.85916910 -0.23854110
69 0.82315211 -0.85916910
70 -0.33330709 0.82315211
71 0.91522015 -0.33330709
72 0.40594591 0.91522015
73 -0.02008972 0.40594591
74 -2.64006696 -0.02008972
75 0.25965181 -2.64006696
76 -2.39302567 0.25965181
77 0.33234074 -2.39302567
78 1.59445459 0.33234074
79 -2.37544030 1.59445459
80 1.69900008 -2.37544030
81 1.92016568 1.69900008
82 -0.34815222 1.92016568
83 0.96415739 -0.34815222
84 -0.91678971 0.96415739
85 -2.33989674 -0.91678971
86 -2.16109076 -2.33989674
87 1.73401722 -2.16109076
88 4.09070313 1.73401722
89 -0.65129011 4.09070313
90 -0.82088530 -0.65129011
91 1.12450829 -0.82088530
92 -1.26769192 1.12450829
93 -3.22876160 -1.26769192
94 3.45432224 -3.22876160
95 0.45937483 3.45432224
96 -0.13590066 0.45937483
97 1.13016866 -0.13590066
98 -0.53014805 1.13016866
99 -0.33296480 -0.53014805
100 0.84693730 -0.33296480
101 -1.25817790 0.84693730
102 -1.20497641 -1.25817790
103 1.31335045 -1.20497641
104 2.94063768 1.31335045
105 -3.44569321 2.94063768
106 0.08157795 -3.44569321
107 1.36663755 0.08157795
108 1.27331097 1.36663755
109 -2.19523041 1.27331097
110 -0.47134571 -2.19523041
111 3.17195957 -0.47134571
112 4.66083538 3.17195957
113 0.19799311 4.66083538
114 5.57143501 0.19799311
115 -2.59344207 5.57143501
116 -2.22925451 -2.59344207
117 -0.77828970 -2.22925451
118 -0.41053425 -0.77828970
119 -2.76157827 -0.41053425
120 -1.75781346 -2.76157827
121 -1.32904284 -1.75781346
122 1.41470185 -1.32904284
123 1.63016055 1.41470185
124 -0.03252809 1.63016055
125 -1.91618650 -0.03252809
126 -2.29947167 -1.91618650
127 0.95822306 -2.29947167
128 0.87445279 0.95822306
129 0.34098182 0.87445279
130 2.23270602 0.34098182
131 0.52922400 2.23270602
132 -1.71043474 0.52922400
133 -1.84489368 -1.71043474
134 0.58916577 -1.84489368
135 -1.79531417 0.58916577
136 -2.26853136 -1.79531417
137 -0.35598862 -2.26853136
138 1.84777674 -0.35598862
139 4.11548593 1.84777674
140 1.15324332 4.11548593
141 0.47254989 1.15324332
142 5.17279351 0.47254989
143 -1.00192582 5.17279351
144 0.61740034 -1.00192582
145 -2.09574531 0.61740034
146 -1.15481414 -2.09574531
147 -0.28337225 -1.15481414
148 0.86426074 -0.28337225
149 1.57348543 0.86426074
150 2.08062365 1.57348543
151 -2.21278128 2.08062365
152 -4.28624040 -2.21278128
153 -3.39073604 -4.28624040
154 1.35494421 -3.39073604
155 -2.00105289 1.35494421
156 0.29496894 -2.00105289
157 0.52952399 0.29496894
158 4.24982476 0.52952399
159 NA 4.24982476
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.03059746 3.15907876
[2,] -2.56511049 1.03059746
[3,] -0.26577090 -2.56511049
[4,] -0.05549396 -0.26577090
[5,] -1.30330087 -0.05549396
[6,] -3.02601981 -1.30330087
[7,] 3.46098445 -3.02601981
[8,] -1.45087371 3.46098445
[9,] -0.94054141 -1.45087371
[10,] 3.27057073 -0.94054141
[11,] -0.09334836 3.27057073
[12,] 3.25634185 -0.09334836
[13,] 0.32686780 3.25634185
[14,] 0.56636938 0.32686780
[15,] -3.62914380 0.56636938
[16,] 2.56937935 -3.62914380
[17,] 0.23217861 2.56937935
[18,] -2.38800334 0.23217861
[19,] 0.25580240 -2.38800334
[20,] 0.85767210 0.25580240
[21,] -0.42770053 0.85767210
[22,] 4.55772830 -0.42770053
[23,] 0.80891898 4.55772830
[24,] 1.28773702 0.80891898
[25,] 0.46474825 1.28773702
[26,] -2.74545189 0.46474825
[27,] 1.31510189 -2.74545189
[28,] -0.26236960 1.31510189
[29,] -1.87934111 -0.26236960
[30,] 0.27795752 -1.87934111
[31,] 4.84540904 0.27795752
[32,] -6.12181816 4.84540904
[33,] -0.37338463 -6.12181816
[34,] -0.94404429 -0.37338463
[35,] -1.06190989 -0.94404429
[36,] -0.69962313 -1.06190989
[37,] -3.45087371 -0.69962313
[38,] 1.17857949 -3.45087371
[39,] -1.09840875 1.17857949
[40,] -0.22062522 -1.09840875
[41,] 0.59038200 -0.22062522
[42,] -1.30742817 0.59038200
[43,] -4.29205562 -1.30742817
[44,] 1.17474312 -4.29205562
[45,] 0.82075415 1.17474312
[46,] 1.14942867 0.82075415
[47,] -1.06008165 1.14942867
[48,] 0.32199153 -1.06008165
[49,] -3.69818473 0.32199153
[50,] -1.32968834 -3.69818473
[51,] 0.69694865 -1.32968834
[52,] 0.99734629 0.69694865
[53,] -0.86821748 0.99734629
[54,] 6.86443707 -0.86821748
[55,] 0.53150285 6.86443707
[56,] 0.71384521 0.53150285
[57,] -2.33448882 0.71384521
[58,] -0.40344744 -2.33448882
[59,] -1.28451592 -0.40344744
[60,] 1.71327550 -1.28451592
[61,] -1.98415633 1.71327550
[62,] -1.30549161 -1.98415633
[63,] 2.76945346 -1.30549161
[64,] -2.05867350 2.76945346
[65,] -0.94560180 -2.05867350
[66,] 1.25930952 -0.94560180
[67,] -0.23854110 1.25930952
[68,] -0.85916910 -0.23854110
[69,] 0.82315211 -0.85916910
[70,] -0.33330709 0.82315211
[71,] 0.91522015 -0.33330709
[72,] 0.40594591 0.91522015
[73,] -0.02008972 0.40594591
[74,] -2.64006696 -0.02008972
[75,] 0.25965181 -2.64006696
[76,] -2.39302567 0.25965181
[77,] 0.33234074 -2.39302567
[78,] 1.59445459 0.33234074
[79,] -2.37544030 1.59445459
[80,] 1.69900008 -2.37544030
[81,] 1.92016568 1.69900008
[82,] -0.34815222 1.92016568
[83,] 0.96415739 -0.34815222
[84,] -0.91678971 0.96415739
[85,] -2.33989674 -0.91678971
[86,] -2.16109076 -2.33989674
[87,] 1.73401722 -2.16109076
[88,] 4.09070313 1.73401722
[89,] -0.65129011 4.09070313
[90,] -0.82088530 -0.65129011
[91,] 1.12450829 -0.82088530
[92,] -1.26769192 1.12450829
[93,] -3.22876160 -1.26769192
[94,] 3.45432224 -3.22876160
[95,] 0.45937483 3.45432224
[96,] -0.13590066 0.45937483
[97,] 1.13016866 -0.13590066
[98,] -0.53014805 1.13016866
[99,] -0.33296480 -0.53014805
[100,] 0.84693730 -0.33296480
[101,] -1.25817790 0.84693730
[102,] -1.20497641 -1.25817790
[103,] 1.31335045 -1.20497641
[104,] 2.94063768 1.31335045
[105,] -3.44569321 2.94063768
[106,] 0.08157795 -3.44569321
[107,] 1.36663755 0.08157795
[108,] 1.27331097 1.36663755
[109,] -2.19523041 1.27331097
[110,] -0.47134571 -2.19523041
[111,] 3.17195957 -0.47134571
[112,] 4.66083538 3.17195957
[113,] 0.19799311 4.66083538
[114,] 5.57143501 0.19799311
[115,] -2.59344207 5.57143501
[116,] -2.22925451 -2.59344207
[117,] -0.77828970 -2.22925451
[118,] -0.41053425 -0.77828970
[119,] -2.76157827 -0.41053425
[120,] -1.75781346 -2.76157827
[121,] -1.32904284 -1.75781346
[122,] 1.41470185 -1.32904284
[123,] 1.63016055 1.41470185
[124,] -0.03252809 1.63016055
[125,] -1.91618650 -0.03252809
[126,] -2.29947167 -1.91618650
[127,] 0.95822306 -2.29947167
[128,] 0.87445279 0.95822306
[129,] 0.34098182 0.87445279
[130,] 2.23270602 0.34098182
[131,] 0.52922400 2.23270602
[132,] -1.71043474 0.52922400
[133,] -1.84489368 -1.71043474
[134,] 0.58916577 -1.84489368
[135,] -1.79531417 0.58916577
[136,] -2.26853136 -1.79531417
[137,] -0.35598862 -2.26853136
[138,] 1.84777674 -0.35598862
[139,] 4.11548593 1.84777674
[140,] 1.15324332 4.11548593
[141,] 0.47254989 1.15324332
[142,] 5.17279351 0.47254989
[143,] -1.00192582 5.17279351
[144,] 0.61740034 -1.00192582
[145,] -2.09574531 0.61740034
[146,] -1.15481414 -2.09574531
[147,] -0.28337225 -1.15481414
[148,] 0.86426074 -0.28337225
[149,] 1.57348543 0.86426074
[150,] 2.08062365 1.57348543
[151,] -2.21278128 2.08062365
[152,] -4.28624040 -2.21278128
[153,] -3.39073604 -4.28624040
[154,] 1.35494421 -3.39073604
[155,] -2.00105289 1.35494421
[156,] 0.29496894 -2.00105289
[157,] 0.52952399 0.29496894
[158,] 4.24982476 0.52952399
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.03059746 3.15907876
2 -2.56511049 1.03059746
3 -0.26577090 -2.56511049
4 -0.05549396 -0.26577090
5 -1.30330087 -0.05549396
6 -3.02601981 -1.30330087
7 3.46098445 -3.02601981
8 -1.45087371 3.46098445
9 -0.94054141 -1.45087371
10 3.27057073 -0.94054141
11 -0.09334836 3.27057073
12 3.25634185 -0.09334836
13 0.32686780 3.25634185
14 0.56636938 0.32686780
15 -3.62914380 0.56636938
16 2.56937935 -3.62914380
17 0.23217861 2.56937935
18 -2.38800334 0.23217861
19 0.25580240 -2.38800334
20 0.85767210 0.25580240
21 -0.42770053 0.85767210
22 4.55772830 -0.42770053
23 0.80891898 4.55772830
24 1.28773702 0.80891898
25 0.46474825 1.28773702
26 -2.74545189 0.46474825
27 1.31510189 -2.74545189
28 -0.26236960 1.31510189
29 -1.87934111 -0.26236960
30 0.27795752 -1.87934111
31 4.84540904 0.27795752
32 -6.12181816 4.84540904
33 -0.37338463 -6.12181816
34 -0.94404429 -0.37338463
35 -1.06190989 -0.94404429
36 -0.69962313 -1.06190989
37 -3.45087371 -0.69962313
38 1.17857949 -3.45087371
39 -1.09840875 1.17857949
40 -0.22062522 -1.09840875
41 0.59038200 -0.22062522
42 -1.30742817 0.59038200
43 -4.29205562 -1.30742817
44 1.17474312 -4.29205562
45 0.82075415 1.17474312
46 1.14942867 0.82075415
47 -1.06008165 1.14942867
48 0.32199153 -1.06008165
49 -3.69818473 0.32199153
50 -1.32968834 -3.69818473
51 0.69694865 -1.32968834
52 0.99734629 0.69694865
53 -0.86821748 0.99734629
54 6.86443707 -0.86821748
55 0.53150285 6.86443707
56 0.71384521 0.53150285
57 -2.33448882 0.71384521
58 -0.40344744 -2.33448882
59 -1.28451592 -0.40344744
60 1.71327550 -1.28451592
61 -1.98415633 1.71327550
62 -1.30549161 -1.98415633
63 2.76945346 -1.30549161
64 -2.05867350 2.76945346
65 -0.94560180 -2.05867350
66 1.25930952 -0.94560180
67 -0.23854110 1.25930952
68 -0.85916910 -0.23854110
69 0.82315211 -0.85916910
70 -0.33330709 0.82315211
71 0.91522015 -0.33330709
72 0.40594591 0.91522015
73 -0.02008972 0.40594591
74 -2.64006696 -0.02008972
75 0.25965181 -2.64006696
76 -2.39302567 0.25965181
77 0.33234074 -2.39302567
78 1.59445459 0.33234074
79 -2.37544030 1.59445459
80 1.69900008 -2.37544030
81 1.92016568 1.69900008
82 -0.34815222 1.92016568
83 0.96415739 -0.34815222
84 -0.91678971 0.96415739
85 -2.33989674 -0.91678971
86 -2.16109076 -2.33989674
87 1.73401722 -2.16109076
88 4.09070313 1.73401722
89 -0.65129011 4.09070313
90 -0.82088530 -0.65129011
91 1.12450829 -0.82088530
92 -1.26769192 1.12450829
93 -3.22876160 -1.26769192
94 3.45432224 -3.22876160
95 0.45937483 3.45432224
96 -0.13590066 0.45937483
97 1.13016866 -0.13590066
98 -0.53014805 1.13016866
99 -0.33296480 -0.53014805
100 0.84693730 -0.33296480
101 -1.25817790 0.84693730
102 -1.20497641 -1.25817790
103 1.31335045 -1.20497641
104 2.94063768 1.31335045
105 -3.44569321 2.94063768
106 0.08157795 -3.44569321
107 1.36663755 0.08157795
108 1.27331097 1.36663755
109 -2.19523041 1.27331097
110 -0.47134571 -2.19523041
111 3.17195957 -0.47134571
112 4.66083538 3.17195957
113 0.19799311 4.66083538
114 5.57143501 0.19799311
115 -2.59344207 5.57143501
116 -2.22925451 -2.59344207
117 -0.77828970 -2.22925451
118 -0.41053425 -0.77828970
119 -2.76157827 -0.41053425
120 -1.75781346 -2.76157827
121 -1.32904284 -1.75781346
122 1.41470185 -1.32904284
123 1.63016055 1.41470185
124 -0.03252809 1.63016055
125 -1.91618650 -0.03252809
126 -2.29947167 -1.91618650
127 0.95822306 -2.29947167
128 0.87445279 0.95822306
129 0.34098182 0.87445279
130 2.23270602 0.34098182
131 0.52922400 2.23270602
132 -1.71043474 0.52922400
133 -1.84489368 -1.71043474
134 0.58916577 -1.84489368
135 -1.79531417 0.58916577
136 -2.26853136 -1.79531417
137 -0.35598862 -2.26853136
138 1.84777674 -0.35598862
139 4.11548593 1.84777674
140 1.15324332 4.11548593
141 0.47254989 1.15324332
142 5.17279351 0.47254989
143 -1.00192582 5.17279351
144 0.61740034 -1.00192582
145 -2.09574531 0.61740034
146 -1.15481414 -2.09574531
147 -0.28337225 -1.15481414
148 0.86426074 -0.28337225
149 1.57348543 0.86426074
150 2.08062365 1.57348543
151 -2.21278128 2.08062365
152 -4.28624040 -2.21278128
153 -3.39073604 -4.28624040
154 1.35494421 -3.39073604
155 -2.00105289 1.35494421
156 0.29496894 -2.00105289
157 0.52952399 0.29496894
158 4.24982476 0.52952399
> 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/freestat/rcomp/tmp/7v3b31293491331.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/freestat/rcomp/tmp/8ovso1293491331.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/freestat/rcomp/tmp/9ovso1293491331.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/freestat/rcomp/tmp/10ovso1293491331.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11kn8w1293491331.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/freestat/rcomp/tmp/12vepz1293491331.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/freestat/rcomp/tmp/131fmb1293491331.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/freestat/rcomp/tmp/14nxlh1293491331.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/freestat/rcomp/tmp/1518m01293491332.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/freestat/rcomp/tmp/16mqk51293491332.tab")
+ }
>
> try(system("convert tmp/1s3uf1293491331.ps tmp/1s3uf1293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/2s3uf1293491331.ps tmp/2s3uf1293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/3s3uf1293491331.ps tmp/3s3uf1293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/42uc01293491331.ps tmp/42uc01293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/52uc01293491331.ps tmp/52uc01293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/62uc01293491331.ps tmp/62uc01293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/7v3b31293491331.ps tmp/7v3b31293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ovso1293491331.ps tmp/8ovso1293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ovso1293491331.ps tmp/9ovso1293491331.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ovso1293491331.ps tmp/10ovso1293491331.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.708 2.693 6.075