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(14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,16
+ ,18
+ ,11
+ ,21
+ ,20
+ ,9
+ ,14
+ ,13
+ ,19
+ ,21
+ ,14
+ ,10
+ ,8
+ ,18
+ ,23
+ ,11
+ ,11
+ ,8
+ ,20
+ ,28
+ ,8
+ ,15
+ ,9
+ ,23
+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,1:159))
> y <- array(NA,dim=c(5,159),dimnames=list(c('DoubtsAboutActions','ParentalExpectations','ParentalCriticism','PersonalStandards','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
PersonalStandards DoubtsAboutActions ParentalExpectations ParentalCriticism
1 24 14 11 12
2 25 11 7 8
3 30 6 17 8
4 19 12 10 8
5 22 8 12 9
6 22 10 12 7
7 25 10 11 4
8 23 11 11 11
9 17 16 12 7
10 21 11 13 7
11 19 13 14 12
12 19 12 16 10
13 15 8 11 10
14 16 12 10 8
15 23 11 11 8
16 27 4 15 4
17 22 9 9 9
18 14 8 11 8
19 22 8 17 7
20 23 14 17 11
21 23 15 11 9
22 21 16 18 11
23 19 9 14 13
24 18 14 10 8
25 20 11 11 8
26 23 8 15 9
27 25 9 15 6
28 19 9 13 9
29 24 9 16 9
30 22 9 13 6
31 25 10 9 6
32 26 16 18 16
33 29 11 18 5
34 32 8 12 7
35 25 9 17 9
36 29 16 9 6
37 28 11 9 6
38 17 16 12 5
39 28 12 18 12
40 29 12 12 7
41 26 14 18 10
42 25 9 14 9
43 14 10 15 8
44 25 9 16 5
45 26 10 10 8
46 20 12 11 8
47 18 14 14 10
48 32 14 9 6
49 25 10 12 8
50 25 14 17 7
51 23 16 5 4
52 21 9 12 8
53 20 10 12 8
54 15 6 6 4
55 30 8 24 20
56 24 13 12 8
57 26 10 12 8
58 24 8 14 6
59 22 7 7 4
60 14 15 13 8
61 24 9 12 9
62 24 10 13 6
63 24 12 14 7
64 24 13 8 9
65 19 10 11 5
66 31 11 9 5
67 22 8 11 8
68 27 9 13 8
69 19 13 10 6
70 25 11 11 8
71 20 8 12 7
72 21 9 9 7
73 27 9 15 9
74 23 15 18 11
75 25 9 15 6
76 20 10 12 8
77 21 14 13 6
78 22 12 14 9
79 23 12 10 8
80 25 11 13 6
81 25 14 13 10
82 17 6 11 8
83 19 12 13 8
84 25 8 16 10
85 19 14 8 5
86 20 11 16 7
87 26 10 11 5
88 23 14 9 8
89 27 12 16 14
90 17 10 12 7
91 17 14 14 8
92 19 5 8 6
93 17 11 9 5
94 22 10 15 6
95 21 9 11 10
96 32 10 21 12
97 21 16 14 9
98 21 13 18 12
99 18 9 12 7
100 18 10 13 8
101 23 10 15 10
102 19 7 12 6
103 20 9 19 10
104 21 8 15 10
105 20 14 11 10
106 17 14 11 5
107 18 8 10 7
108 19 9 13 10
109 22 14 15 11
110 15 14 12 6
111 14 8 12 7
112 18 8 16 12
113 24 8 9 11
114 35 7 18 11
115 29 6 8 11
116 21 8 13 5
117 25 6 17 8
118 20 11 9 6
119 22 14 15 9
120 13 11 8 4
121 26 11 7 4
122 17 11 12 7
123 25 14 14 11
124 20 8 6 6
125 19 20 8 7
126 21 11 17 8
127 22 8 10 4
128 24 11 11 8
129 21 10 14 9
130 26 14 11 8
131 24 11 13 11
132 16 9 12 8
133 23 9 11 5
134 18 8 9 4
135 16 10 12 8
136 26 13 20 10
137 19 13 12 6
138 21 12 13 9
139 21 8 12 9
140 22 13 12 13
141 23 14 9 9
142 29 12 15 10
143 21 14 24 20
144 21 15 7 5
145 23 13 17 11
146 27 16 11 6
147 25 9 17 9
148 21 9 11 7
149 10 9 12 9
150 20 8 14 10
151 26 7 11 9
152 24 16 16 8
153 29 11 21 7
154 19 9 14 6
155 24 11 20 13
156 19 9 13 6
157 24 14 11 8
158 22 13 15 10
159 17 16 19 16
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) DoubtsAboutActions ParentalExpectations
8.3678 -0.1190 0.3304
ParentalCriticism `Organization\r`
0.1047 0.4462
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.0040 -2.5779 -0.4049 2.1613 12.7816
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.36784 2.47748 3.378 0.000926 ***
DoubtsAboutActions -0.11900 0.10920 -1.090 0.277530
ParentalExpectations 0.33038 0.10844 3.047 0.002722 **
ParentalCriticism 0.10470 0.14126 0.741 0.459727
`Organization\r` 0.44618 0.07884 5.660 7.21e-08 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.766 on 154 degrees of freedom
Multiple R-squared: 0.2227, Adjusted R-squared: 0.2025
F-statistic: 11.03 on 4 and 154 DF, p-value: 6.845e-08
> 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.57745837 0.84508326 0.4225416
[2,] 0.41139829 0.82279657 0.5886017
[3,] 0.30415841 0.60831682 0.6958416
[4,] 0.24899418 0.49798836 0.7510058
[5,] 0.15918331 0.31836663 0.8408167
[6,] 0.65816431 0.68367138 0.3418357
[7,] 0.56620916 0.86758169 0.4337908
[8,] 0.49641068 0.99282137 0.5035893
[9,] 0.41479041 0.82958083 0.5852096
[10,] 0.33497913 0.66995826 0.6650209
[11,] 0.31151546 0.62303092 0.6884845
[12,] 0.25193247 0.50386494 0.7480675
[13,] 0.26177902 0.52355805 0.7382210
[14,] 0.26279254 0.52558509 0.7372075
[15,] 0.20757879 0.41515758 0.7924212
[16,] 0.18024171 0.36048343 0.8197583
[17,] 0.16311130 0.32622259 0.8368887
[18,] 0.17057474 0.34114947 0.8294253
[19,] 0.12952917 0.25905834 0.8704708
[20,] 0.10245035 0.20490070 0.8975496
[21,] 0.10337920 0.20675840 0.8966208
[22,] 0.07872792 0.15745583 0.9212721
[23,] 0.05716918 0.11433836 0.9428308
[24,] 0.04224020 0.08448039 0.9577598
[25,] 0.04267219 0.08534438 0.9573278
[26,] 0.10153071 0.20306142 0.8984693
[27,] 0.29814482 0.59628963 0.7018552
[28,] 0.25698019 0.51396038 0.7430198
[29,] 0.36869504 0.73739008 0.6313050
[30,] 0.48852648 0.97705296 0.5114735
[31,] 0.55347408 0.89305184 0.4465259
[32,] 0.58185447 0.83629105 0.4181455
[33,] 0.67908379 0.64183243 0.3209162
[34,] 0.63558961 0.72882078 0.3644104
[35,] 0.59527781 0.80944439 0.4047222
[36,] 0.69646486 0.60707028 0.3035351
[37,] 0.65458230 0.69083540 0.3454177
[38,] 0.66185020 0.67629960 0.3381498
[39,] 0.64413701 0.71172599 0.3558630
[40,] 0.67598313 0.64803375 0.3240169
[41,] 0.88467571 0.23064857 0.1153243
[42,] 0.86968039 0.26063923 0.1303196
[43,] 0.85222375 0.29555251 0.1477763
[44,] 0.83844305 0.32311389 0.1615569
[45,] 0.81667956 0.36664087 0.1833204
[46,] 0.83645365 0.32709269 0.1635463
[47,] 0.82626841 0.34746318 0.1737316
[48,] 0.86738091 0.26523817 0.1326191
[49,] 0.84210323 0.31579354 0.1578968
[50,] 0.81812561 0.36374879 0.1818744
[51,] 0.78934747 0.42130506 0.2106525
[52,] 0.75798053 0.48403894 0.2420195
[53,] 0.78277241 0.43445519 0.2172276
[54,] 0.74689888 0.50620224 0.2531011
[55,] 0.71159884 0.57680233 0.2884012
[56,] 0.67615473 0.64769054 0.3238453
[57,] 0.65617318 0.68765364 0.3438268
[58,] 0.63796075 0.72407850 0.3620393
[59,] 0.73147988 0.53704024 0.2685201
[60,] 0.69294292 0.61411416 0.3070571
[61,] 0.73034005 0.53931990 0.2696600
[62,] 0.71938494 0.56123012 0.2806151
[63,] 0.69488750 0.61022500 0.3051125
[64,] 0.66448196 0.67103608 0.3355180
[65,] 0.62197291 0.75605418 0.3780271
[66,] 0.59459426 0.81081148 0.4054057
[67,] 0.55151982 0.89696036 0.4484802
[68,] 0.51284303 0.97431394 0.4871570
[69,] 0.47178920 0.94357840 0.5282108
[70,] 0.43946525 0.87893050 0.5605347
[71,] 0.39868876 0.79737752 0.6013112
[72,] 0.36069763 0.72139525 0.6393024
[73,] 0.35238063 0.70476125 0.6476194
[74,] 0.31412805 0.62825609 0.6858720
[75,] 0.40224412 0.80448824 0.5977559
[76,] 0.38203798 0.76407596 0.6179620
[77,] 0.34022822 0.68045644 0.6597718
[78,] 0.32452068 0.64904135 0.6754793
[79,] 0.32171220 0.64342440 0.6782878
[80,] 0.33265965 0.66531930 0.6673404
[81,] 0.29282723 0.58565447 0.7071728
[82,] 0.28885578 0.57771156 0.7111442
[83,] 0.29459767 0.58919534 0.7054023
[84,] 0.34504285 0.69008570 0.6549572
[85,] 0.32141240 0.64282480 0.6785876
[86,] 0.31692644 0.63385287 0.6830736
[87,] 0.27719841 0.55439682 0.7228016
[88,] 0.26101504 0.52203008 0.7389850
[89,] 0.29834649 0.59669298 0.7016535
[90,] 0.26923736 0.53847471 0.7307626
[91,] 0.24385067 0.48770134 0.7561493
[92,] 0.23198929 0.46397857 0.7680107
[93,] 0.21326689 0.42653378 0.7867331
[94,] 0.18070541 0.36141081 0.8192946
[95,] 0.16076254 0.32152508 0.8392375
[96,] 0.13737507 0.27475015 0.8626249
[97,] 0.11965550 0.23931100 0.8803445
[98,] 0.12643512 0.25287023 0.8735649
[99,] 0.10306541 0.20613082 0.8969346
[100,] 0.08467617 0.16935234 0.9153238
[101,] 0.06836158 0.13672316 0.9316384
[102,] 0.05367180 0.10734360 0.9463282
[103,] 0.06981061 0.13962123 0.9301894
[104,] 0.10932002 0.21864004 0.8906800
[105,] 0.17287514 0.34575029 0.8271249
[106,] 0.16086366 0.32172733 0.8391363
[107,] 0.61814558 0.76370883 0.3818544
[108,] 0.75184750 0.49630500 0.2481525
[109,] 0.71642294 0.56715411 0.2835771
[110,] 0.76475405 0.47049191 0.2352460
[111,] 0.72173399 0.55653203 0.2782660
[112,] 0.68469450 0.63061100 0.3153055
[113,] 0.68743357 0.62513286 0.3125664
[114,] 0.75879879 0.48240241 0.2412012
[115,] 0.73124246 0.53751508 0.2687575
[116,] 0.72783643 0.54432713 0.2721636
[117,] 0.67817033 0.64365933 0.3218297
[118,] 0.70508967 0.58982065 0.2949103
[119,] 0.67750995 0.64498010 0.3224900
[120,] 0.62294285 0.75411430 0.3770571
[121,] 0.56788827 0.86422347 0.4321117
[122,] 0.53579240 0.92841519 0.4642076
[123,] 0.50480135 0.99039731 0.4951987
[124,] 0.50413478 0.99173043 0.4958652
[125,] 0.54444572 0.91110855 0.4555543
[126,] 0.47787417 0.95574833 0.5221258
[127,] 0.45317100 0.90634200 0.5468290
[128,] 0.58533045 0.82933910 0.4146695
[129,] 0.52524331 0.94951337 0.4747567
[130,] 0.49989777 0.99979553 0.5001022
[131,] 0.44939846 0.89879692 0.5506015
[132,] 0.40130218 0.80260436 0.5986978
[133,] 0.36784035 0.73568070 0.6321597
[134,] 0.49000714 0.98001429 0.5099929
[135,] 0.61982129 0.76035741 0.3801787
[136,] 0.74821281 0.50357438 0.2517872
[137,] 0.69464792 0.61070416 0.3053521
[138,] 0.60304062 0.79391875 0.3969594
[139,] 0.61625421 0.76749158 0.3837458
[140,] 0.60817873 0.78364253 0.3918213
[141,] 0.48823916 0.97647832 0.5117608
[142,] 0.70081640 0.59836719 0.2991836
[143,] 0.63348792 0.73302416 0.3665121
[144,] 0.57920834 0.84158332 0.4207917
> postscript(file="/var/www/html/freestat/rcomp/tmp/1dl7t1293555107.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/2dl7t1293555107.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/35upe1293555107.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/45upe1293555107.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/55upe1293555107.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
0.80696450 4.52881353 4.73767958 -2.34333252 1.19993851 -2.81445023
7 8 9 10 11 12
2.61472462 1.78555948 -3.97724015 -2.24112744 -4.41081788 -2.30412088
13 14 15 16 17 18
-6.91290757 -1.77391647 1.65346891 1.24070093 1.86389790 -3.24174657
19 20 21 22 23 24
-2.47345759 0.60643958 2.47093114 -1.48595048 -3.65296304 -3.10534217
25 26 27 28 29 30
-4.02359313 -1.02208773 1.41099388 -4.24233174 0.21270404 -0.48206831
31 32 33 34 35 36
1.28138646 1.20586412 7.43960052 8.73226744 1.77467765 7.33388853
37 38 39 40 41 42
7.52362067 -3.76784919 4.04101933 7.10060215 -1.08101541 1.87346486
43 44 45 46 47 48
-6.55616287 1.63148595 4.41867713 -2.56606693 -5.08243175 10.98825219
49 50 51 52 53 54
2.75791632 2.57904448 3.75715512 -1.80725586 -4.47296871 -2.19376100
55 56 57 58 59 60
3.63754639 -0.56216019 1.97320830 1.51473312 -0.75927029 -4.85424917
61 62 63 64 65 66
0.64187166 1.19074986 -0.79104369 2.88555099 -2.59761684 7.05890011
67 68 69 70 71 72
-0.59587063 5.20089475 -2.90730040 2.31493789 -1.92920155 -0.26524216
73 74 75 76 77 78
2.20455343 -0.94347667 0.96481687 -1.34972967 -1.77944644 -1.21572662
79 80 81 82 83 84
-1.02039455 3.20209905 0.90941764 -6.72621499 -2.88829673 0.54283639
85 86 87 88 89 90
-2.91520295 -3.78609166 3.95620615 -0.45202379 3.49238919 -4.24503419
91 92 93 94 95 96
-5.87304080 -2.75232398 -3.81786086 0.31469707 -3.02479742 5.02717974
97 98 99 100 101 102
-2.18592293 -2.39380849 -3.36402937 -2.78775606 0.44973816 -2.49732424
103 104 105 106 107 108
-1.75989361 -2.23442920 -4.32217556 -0.55222010 -1.03755571 -0.33143417
109 110 111 112 113 114
-0.17897662 -5.66435801 -6.59067053 -6.66655457 3.53551177 12.78162396
115 116 117 118 119 120
7.28937081 -1.94254501 4.64562664 0.86215169 -1.30811668 -2.92101492
121 122 123 124 125 126
6.39377244 -1.89515399 4.04375780 -1.18075465 -1.51826884 -2.77499053
127 128 129 130 131 132
0.15329168 0.86876089 -3.34607098 3.67192342 3.46332969 -5.46872484
133 134 135 136 137 138
-0.05514303 -3.07015090 -6.24208368 1.70864465 -1.33717618 3.02260084
139 140 141 142 143 144
-2.03094651 3.16084050 6.13593581 6.24155150 -0.18671250 0.87270365
145 146 147 148 149 150
-0.40490961 5.56548173 2.66703166 0.41252804 -8.00400428 -2.01169478
151 152 153 154 155 156
4.07279273 0.70418874 1.33112129 1.09549835 0.04892188 -2.58971430
157 158 159
2.11810042 -0.63945332 -6.33980827
> postscript(file="/var/www/html/freestat/rcomp/tmp/6ym6h1293555107.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 0.80696450 NA
1 4.52881353 0.80696450
2 4.73767958 4.52881353
3 -2.34333252 4.73767958
4 1.19993851 -2.34333252
5 -2.81445023 1.19993851
6 2.61472462 -2.81445023
7 1.78555948 2.61472462
8 -3.97724015 1.78555948
9 -2.24112744 -3.97724015
10 -4.41081788 -2.24112744
11 -2.30412088 -4.41081788
12 -6.91290757 -2.30412088
13 -1.77391647 -6.91290757
14 1.65346891 -1.77391647
15 1.24070093 1.65346891
16 1.86389790 1.24070093
17 -3.24174657 1.86389790
18 -2.47345759 -3.24174657
19 0.60643958 -2.47345759
20 2.47093114 0.60643958
21 -1.48595048 2.47093114
22 -3.65296304 -1.48595048
23 -3.10534217 -3.65296304
24 -4.02359313 -3.10534217
25 -1.02208773 -4.02359313
26 1.41099388 -1.02208773
27 -4.24233174 1.41099388
28 0.21270404 -4.24233174
29 -0.48206831 0.21270404
30 1.28138646 -0.48206831
31 1.20586412 1.28138646
32 7.43960052 1.20586412
33 8.73226744 7.43960052
34 1.77467765 8.73226744
35 7.33388853 1.77467765
36 7.52362067 7.33388853
37 -3.76784919 7.52362067
38 4.04101933 -3.76784919
39 7.10060215 4.04101933
40 -1.08101541 7.10060215
41 1.87346486 -1.08101541
42 -6.55616287 1.87346486
43 1.63148595 -6.55616287
44 4.41867713 1.63148595
45 -2.56606693 4.41867713
46 -5.08243175 -2.56606693
47 10.98825219 -5.08243175
48 2.75791632 10.98825219
49 2.57904448 2.75791632
50 3.75715512 2.57904448
51 -1.80725586 3.75715512
52 -4.47296871 -1.80725586
53 -2.19376100 -4.47296871
54 3.63754639 -2.19376100
55 -0.56216019 3.63754639
56 1.97320830 -0.56216019
57 1.51473312 1.97320830
58 -0.75927029 1.51473312
59 -4.85424917 -0.75927029
60 0.64187166 -4.85424917
61 1.19074986 0.64187166
62 -0.79104369 1.19074986
63 2.88555099 -0.79104369
64 -2.59761684 2.88555099
65 7.05890011 -2.59761684
66 -0.59587063 7.05890011
67 5.20089475 -0.59587063
68 -2.90730040 5.20089475
69 2.31493789 -2.90730040
70 -1.92920155 2.31493789
71 -0.26524216 -1.92920155
72 2.20455343 -0.26524216
73 -0.94347667 2.20455343
74 0.96481687 -0.94347667
75 -1.34972967 0.96481687
76 -1.77944644 -1.34972967
77 -1.21572662 -1.77944644
78 -1.02039455 -1.21572662
79 3.20209905 -1.02039455
80 0.90941764 3.20209905
81 -6.72621499 0.90941764
82 -2.88829673 -6.72621499
83 0.54283639 -2.88829673
84 -2.91520295 0.54283639
85 -3.78609166 -2.91520295
86 3.95620615 -3.78609166
87 -0.45202379 3.95620615
88 3.49238919 -0.45202379
89 -4.24503419 3.49238919
90 -5.87304080 -4.24503419
91 -2.75232398 -5.87304080
92 -3.81786086 -2.75232398
93 0.31469707 -3.81786086
94 -3.02479742 0.31469707
95 5.02717974 -3.02479742
96 -2.18592293 5.02717974
97 -2.39380849 -2.18592293
98 -3.36402937 -2.39380849
99 -2.78775606 -3.36402937
100 0.44973816 -2.78775606
101 -2.49732424 0.44973816
102 -1.75989361 -2.49732424
103 -2.23442920 -1.75989361
104 -4.32217556 -2.23442920
105 -0.55222010 -4.32217556
106 -1.03755571 -0.55222010
107 -0.33143417 -1.03755571
108 -0.17897662 -0.33143417
109 -5.66435801 -0.17897662
110 -6.59067053 -5.66435801
111 -6.66655457 -6.59067053
112 3.53551177 -6.66655457
113 12.78162396 3.53551177
114 7.28937081 12.78162396
115 -1.94254501 7.28937081
116 4.64562664 -1.94254501
117 0.86215169 4.64562664
118 -1.30811668 0.86215169
119 -2.92101492 -1.30811668
120 6.39377244 -2.92101492
121 -1.89515399 6.39377244
122 4.04375780 -1.89515399
123 -1.18075465 4.04375780
124 -1.51826884 -1.18075465
125 -2.77499053 -1.51826884
126 0.15329168 -2.77499053
127 0.86876089 0.15329168
128 -3.34607098 0.86876089
129 3.67192342 -3.34607098
130 3.46332969 3.67192342
131 -5.46872484 3.46332969
132 -0.05514303 -5.46872484
133 -3.07015090 -0.05514303
134 -6.24208368 -3.07015090
135 1.70864465 -6.24208368
136 -1.33717618 1.70864465
137 3.02260084 -1.33717618
138 -2.03094651 3.02260084
139 3.16084050 -2.03094651
140 6.13593581 3.16084050
141 6.24155150 6.13593581
142 -0.18671250 6.24155150
143 0.87270365 -0.18671250
144 -0.40490961 0.87270365
145 5.56548173 -0.40490961
146 2.66703166 5.56548173
147 0.41252804 2.66703166
148 -8.00400428 0.41252804
149 -2.01169478 -8.00400428
150 4.07279273 -2.01169478
151 0.70418874 4.07279273
152 1.33112129 0.70418874
153 1.09549835 1.33112129
154 0.04892188 1.09549835
155 -2.58971430 0.04892188
156 2.11810042 -2.58971430
157 -0.63945332 2.11810042
158 -6.33980827 -0.63945332
159 NA -6.33980827
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 4.52881353 0.80696450
[2,] 4.73767958 4.52881353
[3,] -2.34333252 4.73767958
[4,] 1.19993851 -2.34333252
[5,] -2.81445023 1.19993851
[6,] 2.61472462 -2.81445023
[7,] 1.78555948 2.61472462
[8,] -3.97724015 1.78555948
[9,] -2.24112744 -3.97724015
[10,] -4.41081788 -2.24112744
[11,] -2.30412088 -4.41081788
[12,] -6.91290757 -2.30412088
[13,] -1.77391647 -6.91290757
[14,] 1.65346891 -1.77391647
[15,] 1.24070093 1.65346891
[16,] 1.86389790 1.24070093
[17,] -3.24174657 1.86389790
[18,] -2.47345759 -3.24174657
[19,] 0.60643958 -2.47345759
[20,] 2.47093114 0.60643958
[21,] -1.48595048 2.47093114
[22,] -3.65296304 -1.48595048
[23,] -3.10534217 -3.65296304
[24,] -4.02359313 -3.10534217
[25,] -1.02208773 -4.02359313
[26,] 1.41099388 -1.02208773
[27,] -4.24233174 1.41099388
[28,] 0.21270404 -4.24233174
[29,] -0.48206831 0.21270404
[30,] 1.28138646 -0.48206831
[31,] 1.20586412 1.28138646
[32,] 7.43960052 1.20586412
[33,] 8.73226744 7.43960052
[34,] 1.77467765 8.73226744
[35,] 7.33388853 1.77467765
[36,] 7.52362067 7.33388853
[37,] -3.76784919 7.52362067
[38,] 4.04101933 -3.76784919
[39,] 7.10060215 4.04101933
[40,] -1.08101541 7.10060215
[41,] 1.87346486 -1.08101541
[42,] -6.55616287 1.87346486
[43,] 1.63148595 -6.55616287
[44,] 4.41867713 1.63148595
[45,] -2.56606693 4.41867713
[46,] -5.08243175 -2.56606693
[47,] 10.98825219 -5.08243175
[48,] 2.75791632 10.98825219
[49,] 2.57904448 2.75791632
[50,] 3.75715512 2.57904448
[51,] -1.80725586 3.75715512
[52,] -4.47296871 -1.80725586
[53,] -2.19376100 -4.47296871
[54,] 3.63754639 -2.19376100
[55,] -0.56216019 3.63754639
[56,] 1.97320830 -0.56216019
[57,] 1.51473312 1.97320830
[58,] -0.75927029 1.51473312
[59,] -4.85424917 -0.75927029
[60,] 0.64187166 -4.85424917
[61,] 1.19074986 0.64187166
[62,] -0.79104369 1.19074986
[63,] 2.88555099 -0.79104369
[64,] -2.59761684 2.88555099
[65,] 7.05890011 -2.59761684
[66,] -0.59587063 7.05890011
[67,] 5.20089475 -0.59587063
[68,] -2.90730040 5.20089475
[69,] 2.31493789 -2.90730040
[70,] -1.92920155 2.31493789
[71,] -0.26524216 -1.92920155
[72,] 2.20455343 -0.26524216
[73,] -0.94347667 2.20455343
[74,] 0.96481687 -0.94347667
[75,] -1.34972967 0.96481687
[76,] -1.77944644 -1.34972967
[77,] -1.21572662 -1.77944644
[78,] -1.02039455 -1.21572662
[79,] 3.20209905 -1.02039455
[80,] 0.90941764 3.20209905
[81,] -6.72621499 0.90941764
[82,] -2.88829673 -6.72621499
[83,] 0.54283639 -2.88829673
[84,] -2.91520295 0.54283639
[85,] -3.78609166 -2.91520295
[86,] 3.95620615 -3.78609166
[87,] -0.45202379 3.95620615
[88,] 3.49238919 -0.45202379
[89,] -4.24503419 3.49238919
[90,] -5.87304080 -4.24503419
[91,] -2.75232398 -5.87304080
[92,] -3.81786086 -2.75232398
[93,] 0.31469707 -3.81786086
[94,] -3.02479742 0.31469707
[95,] 5.02717974 -3.02479742
[96,] -2.18592293 5.02717974
[97,] -2.39380849 -2.18592293
[98,] -3.36402937 -2.39380849
[99,] -2.78775606 -3.36402937
[100,] 0.44973816 -2.78775606
[101,] -2.49732424 0.44973816
[102,] -1.75989361 -2.49732424
[103,] -2.23442920 -1.75989361
[104,] -4.32217556 -2.23442920
[105,] -0.55222010 -4.32217556
[106,] -1.03755571 -0.55222010
[107,] -0.33143417 -1.03755571
[108,] -0.17897662 -0.33143417
[109,] -5.66435801 -0.17897662
[110,] -6.59067053 -5.66435801
[111,] -6.66655457 -6.59067053
[112,] 3.53551177 -6.66655457
[113,] 12.78162396 3.53551177
[114,] 7.28937081 12.78162396
[115,] -1.94254501 7.28937081
[116,] 4.64562664 -1.94254501
[117,] 0.86215169 4.64562664
[118,] -1.30811668 0.86215169
[119,] -2.92101492 -1.30811668
[120,] 6.39377244 -2.92101492
[121,] -1.89515399 6.39377244
[122,] 4.04375780 -1.89515399
[123,] -1.18075465 4.04375780
[124,] -1.51826884 -1.18075465
[125,] -2.77499053 -1.51826884
[126,] 0.15329168 -2.77499053
[127,] 0.86876089 0.15329168
[128,] -3.34607098 0.86876089
[129,] 3.67192342 -3.34607098
[130,] 3.46332969 3.67192342
[131,] -5.46872484 3.46332969
[132,] -0.05514303 -5.46872484
[133,] -3.07015090 -0.05514303
[134,] -6.24208368 -3.07015090
[135,] 1.70864465 -6.24208368
[136,] -1.33717618 1.70864465
[137,] 3.02260084 -1.33717618
[138,] -2.03094651 3.02260084
[139,] 3.16084050 -2.03094651
[140,] 6.13593581 3.16084050
[141,] 6.24155150 6.13593581
[142,] -0.18671250 6.24155150
[143,] 0.87270365 -0.18671250
[144,] -0.40490961 0.87270365
[145,] 5.56548173 -0.40490961
[146,] 2.66703166 5.56548173
[147,] 0.41252804 2.66703166
[148,] -8.00400428 0.41252804
[149,] -2.01169478 -8.00400428
[150,] 4.07279273 -2.01169478
[151,] 0.70418874 4.07279273
[152,] 1.33112129 0.70418874
[153,] 1.09549835 1.33112129
[154,] 0.04892188 1.09549835
[155,] -2.58971430 0.04892188
[156,] 2.11810042 -2.58971430
[157,] -0.63945332 2.11810042
[158,] -6.33980827 -0.63945332
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 4.52881353 0.80696450
2 4.73767958 4.52881353
3 -2.34333252 4.73767958
4 1.19993851 -2.34333252
5 -2.81445023 1.19993851
6 2.61472462 -2.81445023
7 1.78555948 2.61472462
8 -3.97724015 1.78555948
9 -2.24112744 -3.97724015
10 -4.41081788 -2.24112744
11 -2.30412088 -4.41081788
12 -6.91290757 -2.30412088
13 -1.77391647 -6.91290757
14 1.65346891 -1.77391647
15 1.24070093 1.65346891
16 1.86389790 1.24070093
17 -3.24174657 1.86389790
18 -2.47345759 -3.24174657
19 0.60643958 -2.47345759
20 2.47093114 0.60643958
21 -1.48595048 2.47093114
22 -3.65296304 -1.48595048
23 -3.10534217 -3.65296304
24 -4.02359313 -3.10534217
25 -1.02208773 -4.02359313
26 1.41099388 -1.02208773
27 -4.24233174 1.41099388
28 0.21270404 -4.24233174
29 -0.48206831 0.21270404
30 1.28138646 -0.48206831
31 1.20586412 1.28138646
32 7.43960052 1.20586412
33 8.73226744 7.43960052
34 1.77467765 8.73226744
35 7.33388853 1.77467765
36 7.52362067 7.33388853
37 -3.76784919 7.52362067
38 4.04101933 -3.76784919
39 7.10060215 4.04101933
40 -1.08101541 7.10060215
41 1.87346486 -1.08101541
42 -6.55616287 1.87346486
43 1.63148595 -6.55616287
44 4.41867713 1.63148595
45 -2.56606693 4.41867713
46 -5.08243175 -2.56606693
47 10.98825219 -5.08243175
48 2.75791632 10.98825219
49 2.57904448 2.75791632
50 3.75715512 2.57904448
51 -1.80725586 3.75715512
52 -4.47296871 -1.80725586
53 -2.19376100 -4.47296871
54 3.63754639 -2.19376100
55 -0.56216019 3.63754639
56 1.97320830 -0.56216019
57 1.51473312 1.97320830
58 -0.75927029 1.51473312
59 -4.85424917 -0.75927029
60 0.64187166 -4.85424917
61 1.19074986 0.64187166
62 -0.79104369 1.19074986
63 2.88555099 -0.79104369
64 -2.59761684 2.88555099
65 7.05890011 -2.59761684
66 -0.59587063 7.05890011
67 5.20089475 -0.59587063
68 -2.90730040 5.20089475
69 2.31493789 -2.90730040
70 -1.92920155 2.31493789
71 -0.26524216 -1.92920155
72 2.20455343 -0.26524216
73 -0.94347667 2.20455343
74 0.96481687 -0.94347667
75 -1.34972967 0.96481687
76 -1.77944644 -1.34972967
77 -1.21572662 -1.77944644
78 -1.02039455 -1.21572662
79 3.20209905 -1.02039455
80 0.90941764 3.20209905
81 -6.72621499 0.90941764
82 -2.88829673 -6.72621499
83 0.54283639 -2.88829673
84 -2.91520295 0.54283639
85 -3.78609166 -2.91520295
86 3.95620615 -3.78609166
87 -0.45202379 3.95620615
88 3.49238919 -0.45202379
89 -4.24503419 3.49238919
90 -5.87304080 -4.24503419
91 -2.75232398 -5.87304080
92 -3.81786086 -2.75232398
93 0.31469707 -3.81786086
94 -3.02479742 0.31469707
95 5.02717974 -3.02479742
96 -2.18592293 5.02717974
97 -2.39380849 -2.18592293
98 -3.36402937 -2.39380849
99 -2.78775606 -3.36402937
100 0.44973816 -2.78775606
101 -2.49732424 0.44973816
102 -1.75989361 -2.49732424
103 -2.23442920 -1.75989361
104 -4.32217556 -2.23442920
105 -0.55222010 -4.32217556
106 -1.03755571 -0.55222010
107 -0.33143417 -1.03755571
108 -0.17897662 -0.33143417
109 -5.66435801 -0.17897662
110 -6.59067053 -5.66435801
111 -6.66655457 -6.59067053
112 3.53551177 -6.66655457
113 12.78162396 3.53551177
114 7.28937081 12.78162396
115 -1.94254501 7.28937081
116 4.64562664 -1.94254501
117 0.86215169 4.64562664
118 -1.30811668 0.86215169
119 -2.92101492 -1.30811668
120 6.39377244 -2.92101492
121 -1.89515399 6.39377244
122 4.04375780 -1.89515399
123 -1.18075465 4.04375780
124 -1.51826884 -1.18075465
125 -2.77499053 -1.51826884
126 0.15329168 -2.77499053
127 0.86876089 0.15329168
128 -3.34607098 0.86876089
129 3.67192342 -3.34607098
130 3.46332969 3.67192342
131 -5.46872484 3.46332969
132 -0.05514303 -5.46872484
133 -3.07015090 -0.05514303
134 -6.24208368 -3.07015090
135 1.70864465 -6.24208368
136 -1.33717618 1.70864465
137 3.02260084 -1.33717618
138 -2.03094651 3.02260084
139 3.16084050 -2.03094651
140 6.13593581 3.16084050
141 6.24155150 6.13593581
142 -0.18671250 6.24155150
143 0.87270365 -0.18671250
144 -0.40490961 0.87270365
145 5.56548173 -0.40490961
146 2.66703166 5.56548173
147 0.41252804 2.66703166
148 -8.00400428 0.41252804
149 -2.01169478 -8.00400428
150 4.07279273 -2.01169478
151 0.70418874 4.07279273
152 1.33112129 0.70418874
153 1.09549835 1.33112129
154 0.04892188 1.09549835
155 -2.58971430 0.04892188
156 2.11810042 -2.58971430
157 -0.63945332 2.11810042
158 -6.33980827 -0.63945332
> 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/7rvnk1293555107.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/8rvnk1293555107.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/9rvnk1293555107.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/1014m51293555107.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/11n5lt1293555107.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/128nkz1293555107.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/13x6ga1293555107.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/14qgye1293555107.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/15byw11293555107.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/16egu71293555107.tab")
+ }
>
> try(system("convert tmp/1dl7t1293555107.ps tmp/1dl7t1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/2dl7t1293555107.ps tmp/2dl7t1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/35upe1293555107.ps tmp/35upe1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/45upe1293555107.ps tmp/45upe1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/55upe1293555107.ps tmp/55upe1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ym6h1293555107.ps tmp/6ym6h1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/7rvnk1293555107.ps tmp/7rvnk1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/8rvnk1293555107.ps tmp/8rvnk1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/9rvnk1293555107.ps tmp/9rvnk1293555107.png",intern=TRUE))
character(0)
> try(system("convert tmp/1014m51293555107.ps tmp/1014m51293555107.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.560 2.650 5.954