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(41
+ ,25
+ ,15
+ ,9
+ ,3
+ ,38
+ ,25
+ ,15
+ ,9
+ ,4
+ ,37
+ ,19
+ ,14
+ ,9
+ ,4
+ ,42
+ ,18
+ ,10
+ ,8
+ ,4
+ ,40
+ ,23
+ ,18
+ ,15
+ ,3
+ ,43
+ ,25
+ ,14
+ ,9
+ ,4
+ ,40
+ ,23
+ ,11
+ ,11
+ ,4
+ ,45
+ ,30
+ ,17
+ ,6
+ ,5
+ ,45
+ ,32
+ ,21
+ ,10
+ ,4
+ ,44
+ ,25
+ ,7
+ ,11
+ ,4
+ ,42
+ ,26
+ ,18
+ ,16
+ ,4
+ ,32
+ ,25
+ ,13
+ ,11
+ ,5
+ ,32
+ ,25
+ ,13
+ ,11
+ ,5
+ ,41
+ ,35
+ ,18
+ ,7
+ ,4
+ ,38
+ ,20
+ ,12
+ ,10
+ ,4
+ ,38
+ ,21
+ ,9
+ ,9
+ ,4
+ ,24
+ ,23
+ ,11
+ ,15
+ ,3
+ ,46
+ ,17
+ ,11
+ ,6
+ ,5
+ ,42
+ ,27
+ ,16
+ ,12
+ ,4
+ ,46
+ ,25
+ ,12
+ ,10
+ ,4
+ ,43
+ ,18
+ ,14
+ ,14
+ ,5
+ ,38
+ ,22
+ ,13
+ ,9
+ ,4
+ ,39
+ ,23
+ ,17
+ ,14
+ ,4
+ ,40
+ ,25
+ ,13
+ ,14
+ ,3
+ ,37
+ ,19
+ ,13
+ ,9
+ ,2
+ ,41
+ ,20
+ ,12
+ ,8
+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 ,20
+ ,11
+ ,11
+ ,4
+ ,33
+ ,14
+ ,15
+ ,10
+ ,2
+ ,39
+ ,17
+ ,12
+ ,16
+ ,4
+ ,32
+ ,29
+ ,12
+ ,12
+ ,4
+ ,45
+ ,21
+ ,12
+ ,8
+ ,3
+ ,35
+ ,19
+ ,11
+ ,10
+ ,4
+ ,38
+ ,17
+ ,9
+ ,11
+ ,3
+ ,36
+ ,19
+ ,8
+ ,14
+ ,3
+ ,42
+ ,17
+ ,12
+ ,10
+ ,3
+ ,41
+ ,19
+ ,13
+ ,12
+ ,4
+ ,47
+ ,21
+ ,17
+ ,11
+ ,3
+ ,35
+ ,20
+ ,16
+ ,11
+ ,3
+ ,43
+ ,20
+ ,11
+ ,14
+ ,3
+ ,40
+ ,29
+ ,9
+ ,16
+ ,4
+ ,46
+ ,23
+ ,11
+ ,9
+ ,4
+ ,44
+ ,23
+ ,11
+ ,11
+ ,5
+ ,35
+ ,19
+ ,13
+ ,9
+ ,3
+ ,29
+ ,22
+ ,15
+ ,14
+ ,4)
+ ,dim=c(5
+ ,146)
+ ,dimnames=list(c('StudyForCareer'
+ ,'PersonalStandards'
+ ,'ParentalExpectations'
+ ,'Doubts'
+ ,'LeaderPreference')
+ ,1:146))
> y <- array(NA,dim=c(5,146),dimnames=list(c('StudyForCareer','PersonalStandards','ParentalExpectations','Doubts','LeaderPreference'),1:146))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'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
StudyForCareer PersonalStandards ParentalExpectations Doubts
1 41 25 15 9
2 38 25 15 9
3 37 19 14 9
4 42 18 10 8
5 40 23 18 15
6 43 25 14 9
7 40 23 11 11
8 45 30 17 6
9 45 32 21 10
10 44 25 7 11
11 42 26 18 16
12 32 25 13 11
13 32 25 13 11
14 41 35 18 7
15 38 20 12 10
16 38 21 9 9
17 24 23 11 15
18 46 17 11 6
19 42 27 16 12
20 46 25 12 10
21 43 18 14 14
22 38 22 13 9
23 39 23 17 14
24 40 25 13 14
25 37 19 13 9
26 41 20 12 8
27 46 26 12 10
28 26 16 12 9
29 37 22 9 9
30 39 25 17 9
31 44 29 18 11
32 38 22 12 10
33 38 32 12 8
34 38 23 9 14
35 33 18 13 10
36 43 26 11 14
37 41 14 13 15
38 49 20 6 8
39 45 25 11 10
40 31 21 18 13
41 30 21 18 13
42 38 23 15 10
43 39 24 11 11
44 40 21 14 10
45 36 17 12 16
46 49 29 8 6
47 41 25 11 11
48 18 16 10 12
49 42 25 17 14
50 41 25 16 9
51 43 21 13 11
52 46 23 15 8
53 41 25 16 8
54 39 25 7 11
55 42 24 16 16
56 35 21 13 12
57 36 22 15 14
58 48 14 12 8
59 41 20 12 10
60 47 21 24 14
61 41 22 15 10
62 31 19 8 5
63 36 28 18 12
64 46 25 17 9
65 44 21 15 8
66 43 27 11 16
67 40 19 12 13
68 40 20 14 8
69 46 17 11 14
70 39 22 10 8
71 44 26 11 7
72 38 17 12 11
73 39 15 6 6
74 41 27 15 9
75 39 25 14 14
76 40 19 16 12
77 44 18 16 8
78 42 15 11 8
79 46 29 15 12
80 44 24 12 13
81 37 24 13 11
82 39 22 14 12
83 40 22 12 13
84 42 25 17 14
85 37 21 11 9
86 33 21 13 8
87 35 18 9 8
88 42 10 12 9
89 36 18 10 14
90 44 23 9 14
91 45 24 11 14
92 47 32 9 14
93 40 24 16 9
94 49 17 14 14
95 48 30 24 8
96 29 25 9 10
97 45 23 11 11
98 29 19 14 13
99 41 21 12 9
100 34 24 8 13
101 38 23 5 16
102 37 19 10 12
103 48 27 15 4
104 39 26 10 10
105 34 26 18 14
106 35 16 12 10
107 41 27 13 9
108 43 14 11 8
109 41 18 12 9
110 39 21 7 15
111 36 22 17 8
112 32 31 9 11
113 46 23 10 12
114 42 24 12 9
115 42 19 10 13
116 45 22 7 7
117 39 24 13 10
118 45 28 9 11
119 48 24 9 8
120 28 15 12 14
121 35 21 11 9
122 38 21 14 16
123 42 13 8 11
124 36 20 11 12
125 37 22 11 8
126 38 19 12 7
127 43 26 20 13
128 35 19 8 20
129 36 20 11 11
130 33 14 15 10
131 39 17 12 16
132 32 29 12 12
133 45 21 12 8
134 35 19 11 10
135 38 17 9 11
136 36 19 8 14
137 42 17 12 10
138 41 19 13 12
139 47 21 17 11
140 35 20 16 11
141 43 20 11 14
142 40 29 9 16
143 46 23 11 9
144 44 23 11 11
145 35 19 13 9
146 29 22 15 14
LeaderPreference
1 3
2 4
3 4
4 4
5 3
6 4
7 4
8 5
9 4
10 4
11 4
12 5
13 5
14 4
15 4
16 4
17 3
18 5
19 4
20 4
21 5
22 4
23 4
24 3
25 2
26 4
27 4
28 3
29 3
30 4
31 5
32 2
33 0
34 4
35 3
36 4
37 2
38 4
39 5
40 3
41 3
42 4
43 4
44 4
45 2
46 5
47 4
48 2
49 3
50 5
51 4
52 3
53 5
54 4
55 4
56 5
57 3
58 4
59 4
60 3
61 3
62 5
63 4
64 4
65 4
66 2
67 5
68 3
69 3
70 4
71 4
72 2
73 4
74 5
75 3
76 4
77 4
78 4
79 5
80 4
81 4
82 2
83 3
84 3
85 3
86 2
87 4
88 2
89 2
90 4
91 4
92 4
93 4
94 4
95 5
96 4
97 5
98 2
99 4
100 2
101 2
102 3
103 5
104 4
105 4
106 2
107 3
108 4
109 3
110 2
111 4
112 4
113 4
114 4
115 2
116 3
117 4
118 4
119 5
120 4
121 2
122 4
123 4
124 3
125 4
126 3
127 4
128 2
129 4
130 2
131 4
132 4
133 3
134 4
135 3
136 3
137 3
138 4
139 3
140 3
141 3
142 4
143 4
144 5
145 3
146 4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) PersonalStandards ParentalExpectations
32.52021 0.17419 0.04668
Doubts LeaderPreference
-0.21737 1.39807
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-17.962 -2.227 0.633 3.246 10.316
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 32.52021 3.25036 10.005 < 2e-16 ***
PersonalStandards 0.17419 0.10383 1.678 0.09563 .
ParentalExpectations 0.04668 0.12794 0.365 0.71578
Doubts -0.21737 0.15497 -1.403 0.16291
LeaderPreference 1.39807 0.48222 2.899 0.00434 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 4.982 on 141 degrees of freedom
Multiple R-squared: 0.1354, Adjusted R-squared: 0.1108
F-statistic: 5.519 on 4 and 141 DF, p-value: 0.0003713
> 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.21114499 0.42228998 0.78885501
[2,] 0.11120490 0.22240979 0.88879510
[3,] 0.05028840 0.10057681 0.94971160
[4,] 0.02126025 0.04252050 0.97873975
[5,] 0.19229041 0.38458083 0.80770959
[6,] 0.23129304 0.46258609 0.76870696
[7,] 0.25524931 0.51049863 0.74475069
[8,] 0.18067673 0.36135346 0.81932327
[9,] 0.12827417 0.25654834 0.87172583
[10,] 0.67986880 0.64026241 0.32013120
[11,] 0.66331981 0.67336037 0.33668019
[12,] 0.61833712 0.76332577 0.38166288
[13,] 0.67188145 0.65623709 0.32811855
[14,] 0.67126267 0.65747466 0.32873733
[15,] 0.62109094 0.75781813 0.37890906
[16,] 0.55042690 0.89914620 0.44957310
[17,] 0.51197937 0.97604126 0.48802063
[18,] 0.45423669 0.90847337 0.54576331
[19,] 0.38671558 0.77343115 0.61328442
[20,] 0.42413651 0.84827302 0.57586349
[21,] 0.69628236 0.60743528 0.30371764
[22,] 0.64023178 0.71953645 0.35976822
[23,] 0.59107406 0.81785187 0.40892594
[24,] 0.53065250 0.93869501 0.46934750
[25,] 0.47885133 0.95770265 0.52114867
[26,] 0.42139129 0.84278257 0.57860871
[27,] 0.36557167 0.73114335 0.63442833
[28,] 0.34539104 0.69078208 0.65460896
[29,] 0.32202504 0.64405009 0.67797496
[30,] 0.39573588 0.79147176 0.60426412
[31,] 0.53599895 0.92800210 0.46400105
[32,] 0.49641177 0.99282353 0.50358823
[33,] 0.52411022 0.95177956 0.47588978
[34,] 0.57017793 0.85964413 0.42982207
[35,] 0.52464142 0.95071716 0.47535858
[36,] 0.47498016 0.94996032 0.52501984
[37,] 0.42332040 0.84664079 0.57667960
[38,] 0.38227573 0.76455146 0.61772427
[39,] 0.36671735 0.73343471 0.63328265
[40,] 0.31783838 0.63567677 0.68216162
[41,] 0.81214378 0.37571245 0.18785622
[42,] 0.80377458 0.39245083 0.19622542
[43,] 0.76950325 0.46099350 0.23049675
[44,] 0.75193800 0.49612400 0.24806200
[45,] 0.79031107 0.41937786 0.20968893
[46,] 0.75704053 0.48591894 0.24295947
[47,] 0.72285427 0.55429145 0.27714573
[48,] 0.69647155 0.60705690 0.30352845
[49,] 0.71290418 0.57419165 0.28709582
[50,] 0.67756948 0.64486104 0.32243052
[51,] 0.78488138 0.43023724 0.21511862
[52,] 0.74964028 0.50071943 0.25035972
[53,] 0.82802494 0.34395013 0.17197506
[54,] 0.80050341 0.39899318 0.19949659
[55,] 0.90282284 0.19435432 0.09717716
[56,] 0.90525991 0.18948018 0.09474009
[57,] 0.90162245 0.19675511 0.09837755
[58,] 0.88864833 0.22270334 0.11135167
[59,] 0.90200199 0.19599602 0.09799801
[60,] 0.88124819 0.23750362 0.11875181
[61,] 0.85665260 0.28669481 0.14334740
[62,] 0.90909859 0.18180281 0.09090141
[63,] 0.89026541 0.21946918 0.10973459
[64,] 0.87148176 0.25703648 0.12851824
[65,] 0.84777428 0.30445144 0.15222572
[66,] 0.82034548 0.35930905 0.17965452
[67,] 0.79254563 0.41490875 0.20745437
[68,] 0.75643704 0.48712591 0.24356296
[69,] 0.71730520 0.56538960 0.28269480
[70,] 0.69693199 0.60613602 0.30306801
[71,] 0.66241849 0.67516302 0.33758151
[72,] 0.63729873 0.72540254 0.36270127
[73,] 0.62004245 0.75991511 0.37995755
[74,] 0.59500731 0.80998537 0.40499269
[75,] 0.55622458 0.88755085 0.44377542
[76,] 0.51404249 0.97191502 0.48595751
[77,] 0.49345687 0.98691373 0.50654313
[78,] 0.45105468 0.90210935 0.54894532
[79,] 0.44087417 0.88174834 0.55912583
[80,] 0.45381663 0.90763326 0.54618337
[81,] 0.47654145 0.95308290 0.52345855
[82,] 0.42743784 0.85487567 0.57256216
[83,] 0.41434875 0.82869749 0.58565125
[84,] 0.41911232 0.83822464 0.58088768
[85,] 0.45403998 0.90807996 0.54596002
[86,] 0.40540053 0.81080105 0.59459947
[87,] 0.57640458 0.84719085 0.42359542
[88,] 0.60326368 0.79347263 0.39673632
[89,] 0.82214194 0.35571611 0.17785806
[90,] 0.80215682 0.39568637 0.19784318
[91,] 0.82999951 0.34000098 0.17000049
[92,] 0.79435457 0.41129085 0.20564543
[93,] 0.77557484 0.44885032 0.22442516
[94,] 0.73607119 0.52785762 0.26392881
[95,] 0.69307820 0.61384361 0.30692180
[96,] 0.68229415 0.63541170 0.31770585
[97,] 0.63992688 0.72014624 0.36007312
[98,] 0.62659758 0.74680485 0.37340242
[99,] 0.58659974 0.82680053 0.41340026
[100,] 0.53365314 0.93269372 0.46634686
[101,] 0.49650050 0.99300101 0.50349950
[102,] 0.44918778 0.89837555 0.55081222
[103,] 0.40144643 0.80289286 0.59855357
[104,] 0.38176267 0.76352534 0.61823733
[105,] 0.56751690 0.86496620 0.43248310
[106,] 0.58535655 0.82928691 0.41464345
[107,] 0.52607541 0.94784918 0.47392459
[108,] 0.53159870 0.93680261 0.46840130
[109,] 0.50660909 0.98678183 0.49339091
[110,] 0.45050705 0.90101410 0.54949295
[111,] 0.41507657 0.83015314 0.58492343
[112,] 0.43076921 0.86153841 0.56923079
[113,] 0.62403341 0.75193318 0.37596659
[114,] 0.56991302 0.86017396 0.43008698
[115,] 0.50033720 0.99932560 0.49966280
[116,] 0.45988634 0.91977268 0.54011366
[117,] 0.39885854 0.79771708 0.60114146
[118,] 0.35706810 0.71413621 0.64293190
[119,] 0.29770407 0.59540813 0.70229593
[120,] 0.28209949 0.56419899 0.71790051
[121,] 0.21933698 0.43867396 0.78066302
[122,] 0.19083512 0.38167024 0.80916488
[123,] 0.18544957 0.37089914 0.81455043
[124,] 0.14569957 0.29139914 0.85430043
[125,] 0.29484198 0.58968397 0.70515802
[126,] 0.22265891 0.44531783 0.77734109
[127,] 0.21660469 0.43320938 0.78339531
[128,] 0.15141667 0.30283335 0.84858333
[129,] 0.10856687 0.21713375 0.89143313
[130,] 0.06138365 0.12276729 0.93861635
[131,] 0.03548486 0.07096972 0.96451514
> postscript(file="/var/www/html/freestat/rcomp/tmp/10n5t1292682892.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/2teme1292682892.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/3teme1292682892.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/4teme1292682892.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/5teme1292682892.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 = 146
Frequency = 1
1 2 3 4 5 6
1.1869570 -3.2111084 -3.1192741 2.0242613 1.6995439 1.8355706
7 8 9 10 11 12
-0.2412610 0.7743862 2.5068430 3.5970699 1.9962741 -10.0810694
13 14 15 16 17 18
-10.0810694 -2.5278170 -1.9827355 -2.2342642 -13.9737031 4.3189632
19 20 21 22 23 24
1.0459470 5.1463018 2.7437188 -2.5951727 -0.8692156 1.3671806
25 26 27 28 29 30
-0.2764644 0.5825182 4.9721092 -12.1052731 -2.0103914 -2.3044663
31 32 33 34 35 36
0.9887654 0.4650101 1.0844690 -1.4957836 -5.2829641 2.8882807
37 38 39 40 41 42
5.8987371 8.8625922 2.7949154 -7.3868173 -8.3868173 -2.6453501
43 44 45 46 47 48
-1.4154536 -0.2502861 0.6402116 5.3686897 0.4103539 -17.9617304
49 50 51 52 53 54
3.1804647 -1.6558527 3.0137661 6.3179689 -1.8732258 -1.4029301
55 56 57 58 59 60
2.4380171 -6.1669261 -2.2035997 8.6276735 1.0172645 8.5504819
61 62 63 64 65 66
1.9269078 -11.1067580 -5.2216036 4.6955337 3.2682887 5.9449652
67 68 69 70 71 72
-0.5544889 0.8872256 8.8540790 -1.6725089 2.3666688 1.5533459
73 74 75 76 77 78
-0.7011914 -1.9575588 0.3205017 0.4394873 3.7441873 2.5001599
79 80 81 82 83 84
3.3461755 3.9726137 -3.5088116 1.8063984 1.7190641 3.1804647
85 86 87 88 89 90
-1.9295569 -4.8422226 -4.9290597 6.3379475 0.1246308 4.5042164
91 92 93 94 95 96
5.2366658 5.9364835 -1.0835948 10.3159767 3.8823795 -11.7136613
97 98 99 100 101 102
3.3606736 -7.4536509 0.6256988 -3.0445396 1.9218093 -0.8823734
103 104 105 106 107 108
3.9555755 -1.9345328 -6.4384722 -1.4898347 0.9319299 3.6743525
109 110 111 112 113 114
2.5463418 2.9594632 -4.9992618 -9.5414434 6.0227911 1.1031212
115 116 117 118 119 120
5.7330651 5.6482203 -1.7261847 3.9811342 5.6277197 -10.2422803
121 122 123 124 125 126
-2.5314915 -0.9460472 3.6407014 -2.1032449 -3.7191879 -1.0625970
127 128 129 130 131 132
2.2507967 0.3480350 -3.7186834 -3.2814866 0.8440809 -9.1157221
133 134 135 136 137 138
5.8063910 -4.7618640 0.2953176 -1.3542691 3.9379074 1.5795243
139 140 141 142 143 144
8.2251154 -3.5540130 5.3315013 -0.1061926 5.3239927 2.3606736
145 146
-3.6745298 -10.6016650
> postscript(file="/var/www/html/freestat/rcomp/tmp/6464z1292682892.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 = 146
Frequency = 1
lag(myerror, k = 1) myerror
0 1.1869570 NA
1 -3.2111084 1.1869570
2 -3.1192741 -3.2111084
3 2.0242613 -3.1192741
4 1.6995439 2.0242613
5 1.8355706 1.6995439
6 -0.2412610 1.8355706
7 0.7743862 -0.2412610
8 2.5068430 0.7743862
9 3.5970699 2.5068430
10 1.9962741 3.5970699
11 -10.0810694 1.9962741
12 -10.0810694 -10.0810694
13 -2.5278170 -10.0810694
14 -1.9827355 -2.5278170
15 -2.2342642 -1.9827355
16 -13.9737031 -2.2342642
17 4.3189632 -13.9737031
18 1.0459470 4.3189632
19 5.1463018 1.0459470
20 2.7437188 5.1463018
21 -2.5951727 2.7437188
22 -0.8692156 -2.5951727
23 1.3671806 -0.8692156
24 -0.2764644 1.3671806
25 0.5825182 -0.2764644
26 4.9721092 0.5825182
27 -12.1052731 4.9721092
28 -2.0103914 -12.1052731
29 -2.3044663 -2.0103914
30 0.9887654 -2.3044663
31 0.4650101 0.9887654
32 1.0844690 0.4650101
33 -1.4957836 1.0844690
34 -5.2829641 -1.4957836
35 2.8882807 -5.2829641
36 5.8987371 2.8882807
37 8.8625922 5.8987371
38 2.7949154 8.8625922
39 -7.3868173 2.7949154
40 -8.3868173 -7.3868173
41 -2.6453501 -8.3868173
42 -1.4154536 -2.6453501
43 -0.2502861 -1.4154536
44 0.6402116 -0.2502861
45 5.3686897 0.6402116
46 0.4103539 5.3686897
47 -17.9617304 0.4103539
48 3.1804647 -17.9617304
49 -1.6558527 3.1804647
50 3.0137661 -1.6558527
51 6.3179689 3.0137661
52 -1.8732258 6.3179689
53 -1.4029301 -1.8732258
54 2.4380171 -1.4029301
55 -6.1669261 2.4380171
56 -2.2035997 -6.1669261
57 8.6276735 -2.2035997
58 1.0172645 8.6276735
59 8.5504819 1.0172645
60 1.9269078 8.5504819
61 -11.1067580 1.9269078
62 -5.2216036 -11.1067580
63 4.6955337 -5.2216036
64 3.2682887 4.6955337
65 5.9449652 3.2682887
66 -0.5544889 5.9449652
67 0.8872256 -0.5544889
68 8.8540790 0.8872256
69 -1.6725089 8.8540790
70 2.3666688 -1.6725089
71 1.5533459 2.3666688
72 -0.7011914 1.5533459
73 -1.9575588 -0.7011914
74 0.3205017 -1.9575588
75 0.4394873 0.3205017
76 3.7441873 0.4394873
77 2.5001599 3.7441873
78 3.3461755 2.5001599
79 3.9726137 3.3461755
80 -3.5088116 3.9726137
81 1.8063984 -3.5088116
82 1.7190641 1.8063984
83 3.1804647 1.7190641
84 -1.9295569 3.1804647
85 -4.8422226 -1.9295569
86 -4.9290597 -4.8422226
87 6.3379475 -4.9290597
88 0.1246308 6.3379475
89 4.5042164 0.1246308
90 5.2366658 4.5042164
91 5.9364835 5.2366658
92 -1.0835948 5.9364835
93 10.3159767 -1.0835948
94 3.8823795 10.3159767
95 -11.7136613 3.8823795
96 3.3606736 -11.7136613
97 -7.4536509 3.3606736
98 0.6256988 -7.4536509
99 -3.0445396 0.6256988
100 1.9218093 -3.0445396
101 -0.8823734 1.9218093
102 3.9555755 -0.8823734
103 -1.9345328 3.9555755
104 -6.4384722 -1.9345328
105 -1.4898347 -6.4384722
106 0.9319299 -1.4898347
107 3.6743525 0.9319299
108 2.5463418 3.6743525
109 2.9594632 2.5463418
110 -4.9992618 2.9594632
111 -9.5414434 -4.9992618
112 6.0227911 -9.5414434
113 1.1031212 6.0227911
114 5.7330651 1.1031212
115 5.6482203 5.7330651
116 -1.7261847 5.6482203
117 3.9811342 -1.7261847
118 5.6277197 3.9811342
119 -10.2422803 5.6277197
120 -2.5314915 -10.2422803
121 -0.9460472 -2.5314915
122 3.6407014 -0.9460472
123 -2.1032449 3.6407014
124 -3.7191879 -2.1032449
125 -1.0625970 -3.7191879
126 2.2507967 -1.0625970
127 0.3480350 2.2507967
128 -3.7186834 0.3480350
129 -3.2814866 -3.7186834
130 0.8440809 -3.2814866
131 -9.1157221 0.8440809
132 5.8063910 -9.1157221
133 -4.7618640 5.8063910
134 0.2953176 -4.7618640
135 -1.3542691 0.2953176
136 3.9379074 -1.3542691
137 1.5795243 3.9379074
138 8.2251154 1.5795243
139 -3.5540130 8.2251154
140 5.3315013 -3.5540130
141 -0.1061926 5.3315013
142 5.3239927 -0.1061926
143 2.3606736 5.3239927
144 -3.6745298 2.3606736
145 -10.6016650 -3.6745298
146 NA -10.6016650
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -3.2111084 1.1869570
[2,] -3.1192741 -3.2111084
[3,] 2.0242613 -3.1192741
[4,] 1.6995439 2.0242613
[5,] 1.8355706 1.6995439
[6,] -0.2412610 1.8355706
[7,] 0.7743862 -0.2412610
[8,] 2.5068430 0.7743862
[9,] 3.5970699 2.5068430
[10,] 1.9962741 3.5970699
[11,] -10.0810694 1.9962741
[12,] -10.0810694 -10.0810694
[13,] -2.5278170 -10.0810694
[14,] -1.9827355 -2.5278170
[15,] -2.2342642 -1.9827355
[16,] -13.9737031 -2.2342642
[17,] 4.3189632 -13.9737031
[18,] 1.0459470 4.3189632
[19,] 5.1463018 1.0459470
[20,] 2.7437188 5.1463018
[21,] -2.5951727 2.7437188
[22,] -0.8692156 -2.5951727
[23,] 1.3671806 -0.8692156
[24,] -0.2764644 1.3671806
[25,] 0.5825182 -0.2764644
[26,] 4.9721092 0.5825182
[27,] -12.1052731 4.9721092
[28,] -2.0103914 -12.1052731
[29,] -2.3044663 -2.0103914
[30,] 0.9887654 -2.3044663
[31,] 0.4650101 0.9887654
[32,] 1.0844690 0.4650101
[33,] -1.4957836 1.0844690
[34,] -5.2829641 -1.4957836
[35,] 2.8882807 -5.2829641
[36,] 5.8987371 2.8882807
[37,] 8.8625922 5.8987371
[38,] 2.7949154 8.8625922
[39,] -7.3868173 2.7949154
[40,] -8.3868173 -7.3868173
[41,] -2.6453501 -8.3868173
[42,] -1.4154536 -2.6453501
[43,] -0.2502861 -1.4154536
[44,] 0.6402116 -0.2502861
[45,] 5.3686897 0.6402116
[46,] 0.4103539 5.3686897
[47,] -17.9617304 0.4103539
[48,] 3.1804647 -17.9617304
[49,] -1.6558527 3.1804647
[50,] 3.0137661 -1.6558527
[51,] 6.3179689 3.0137661
[52,] -1.8732258 6.3179689
[53,] -1.4029301 -1.8732258
[54,] 2.4380171 -1.4029301
[55,] -6.1669261 2.4380171
[56,] -2.2035997 -6.1669261
[57,] 8.6276735 -2.2035997
[58,] 1.0172645 8.6276735
[59,] 8.5504819 1.0172645
[60,] 1.9269078 8.5504819
[61,] -11.1067580 1.9269078
[62,] -5.2216036 -11.1067580
[63,] 4.6955337 -5.2216036
[64,] 3.2682887 4.6955337
[65,] 5.9449652 3.2682887
[66,] -0.5544889 5.9449652
[67,] 0.8872256 -0.5544889
[68,] 8.8540790 0.8872256
[69,] -1.6725089 8.8540790
[70,] 2.3666688 -1.6725089
[71,] 1.5533459 2.3666688
[72,] -0.7011914 1.5533459
[73,] -1.9575588 -0.7011914
[74,] 0.3205017 -1.9575588
[75,] 0.4394873 0.3205017
[76,] 3.7441873 0.4394873
[77,] 2.5001599 3.7441873
[78,] 3.3461755 2.5001599
[79,] 3.9726137 3.3461755
[80,] -3.5088116 3.9726137
[81,] 1.8063984 -3.5088116
[82,] 1.7190641 1.8063984
[83,] 3.1804647 1.7190641
[84,] -1.9295569 3.1804647
[85,] -4.8422226 -1.9295569
[86,] -4.9290597 -4.8422226
[87,] 6.3379475 -4.9290597
[88,] 0.1246308 6.3379475
[89,] 4.5042164 0.1246308
[90,] 5.2366658 4.5042164
[91,] 5.9364835 5.2366658
[92,] -1.0835948 5.9364835
[93,] 10.3159767 -1.0835948
[94,] 3.8823795 10.3159767
[95,] -11.7136613 3.8823795
[96,] 3.3606736 -11.7136613
[97,] -7.4536509 3.3606736
[98,] 0.6256988 -7.4536509
[99,] -3.0445396 0.6256988
[100,] 1.9218093 -3.0445396
[101,] -0.8823734 1.9218093
[102,] 3.9555755 -0.8823734
[103,] -1.9345328 3.9555755
[104,] -6.4384722 -1.9345328
[105,] -1.4898347 -6.4384722
[106,] 0.9319299 -1.4898347
[107,] 3.6743525 0.9319299
[108,] 2.5463418 3.6743525
[109,] 2.9594632 2.5463418
[110,] -4.9992618 2.9594632
[111,] -9.5414434 -4.9992618
[112,] 6.0227911 -9.5414434
[113,] 1.1031212 6.0227911
[114,] 5.7330651 1.1031212
[115,] 5.6482203 5.7330651
[116,] -1.7261847 5.6482203
[117,] 3.9811342 -1.7261847
[118,] 5.6277197 3.9811342
[119,] -10.2422803 5.6277197
[120,] -2.5314915 -10.2422803
[121,] -0.9460472 -2.5314915
[122,] 3.6407014 -0.9460472
[123,] -2.1032449 3.6407014
[124,] -3.7191879 -2.1032449
[125,] -1.0625970 -3.7191879
[126,] 2.2507967 -1.0625970
[127,] 0.3480350 2.2507967
[128,] -3.7186834 0.3480350
[129,] -3.2814866 -3.7186834
[130,] 0.8440809 -3.2814866
[131,] -9.1157221 0.8440809
[132,] 5.8063910 -9.1157221
[133,] -4.7618640 5.8063910
[134,] 0.2953176 -4.7618640
[135,] -1.3542691 0.2953176
[136,] 3.9379074 -1.3542691
[137,] 1.5795243 3.9379074
[138,] 8.2251154 1.5795243
[139,] -3.5540130 8.2251154
[140,] 5.3315013 -3.5540130
[141,] -0.1061926 5.3315013
[142,] 5.3239927 -0.1061926
[143,] 2.3606736 5.3239927
[144,] -3.6745298 2.3606736
[145,] -10.6016650 -3.6745298
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -3.2111084 1.1869570
2 -3.1192741 -3.2111084
3 2.0242613 -3.1192741
4 1.6995439 2.0242613
5 1.8355706 1.6995439
6 -0.2412610 1.8355706
7 0.7743862 -0.2412610
8 2.5068430 0.7743862
9 3.5970699 2.5068430
10 1.9962741 3.5970699
11 -10.0810694 1.9962741
12 -10.0810694 -10.0810694
13 -2.5278170 -10.0810694
14 -1.9827355 -2.5278170
15 -2.2342642 -1.9827355
16 -13.9737031 -2.2342642
17 4.3189632 -13.9737031
18 1.0459470 4.3189632
19 5.1463018 1.0459470
20 2.7437188 5.1463018
21 -2.5951727 2.7437188
22 -0.8692156 -2.5951727
23 1.3671806 -0.8692156
24 -0.2764644 1.3671806
25 0.5825182 -0.2764644
26 4.9721092 0.5825182
27 -12.1052731 4.9721092
28 -2.0103914 -12.1052731
29 -2.3044663 -2.0103914
30 0.9887654 -2.3044663
31 0.4650101 0.9887654
32 1.0844690 0.4650101
33 -1.4957836 1.0844690
34 -5.2829641 -1.4957836
35 2.8882807 -5.2829641
36 5.8987371 2.8882807
37 8.8625922 5.8987371
38 2.7949154 8.8625922
39 -7.3868173 2.7949154
40 -8.3868173 -7.3868173
41 -2.6453501 -8.3868173
42 -1.4154536 -2.6453501
43 -0.2502861 -1.4154536
44 0.6402116 -0.2502861
45 5.3686897 0.6402116
46 0.4103539 5.3686897
47 -17.9617304 0.4103539
48 3.1804647 -17.9617304
49 -1.6558527 3.1804647
50 3.0137661 -1.6558527
51 6.3179689 3.0137661
52 -1.8732258 6.3179689
53 -1.4029301 -1.8732258
54 2.4380171 -1.4029301
55 -6.1669261 2.4380171
56 -2.2035997 -6.1669261
57 8.6276735 -2.2035997
58 1.0172645 8.6276735
59 8.5504819 1.0172645
60 1.9269078 8.5504819
61 -11.1067580 1.9269078
62 -5.2216036 -11.1067580
63 4.6955337 -5.2216036
64 3.2682887 4.6955337
65 5.9449652 3.2682887
66 -0.5544889 5.9449652
67 0.8872256 -0.5544889
68 8.8540790 0.8872256
69 -1.6725089 8.8540790
70 2.3666688 -1.6725089
71 1.5533459 2.3666688
72 -0.7011914 1.5533459
73 -1.9575588 -0.7011914
74 0.3205017 -1.9575588
75 0.4394873 0.3205017
76 3.7441873 0.4394873
77 2.5001599 3.7441873
78 3.3461755 2.5001599
79 3.9726137 3.3461755
80 -3.5088116 3.9726137
81 1.8063984 -3.5088116
82 1.7190641 1.8063984
83 3.1804647 1.7190641
84 -1.9295569 3.1804647
85 -4.8422226 -1.9295569
86 -4.9290597 -4.8422226
87 6.3379475 -4.9290597
88 0.1246308 6.3379475
89 4.5042164 0.1246308
90 5.2366658 4.5042164
91 5.9364835 5.2366658
92 -1.0835948 5.9364835
93 10.3159767 -1.0835948
94 3.8823795 10.3159767
95 -11.7136613 3.8823795
96 3.3606736 -11.7136613
97 -7.4536509 3.3606736
98 0.6256988 -7.4536509
99 -3.0445396 0.6256988
100 1.9218093 -3.0445396
101 -0.8823734 1.9218093
102 3.9555755 -0.8823734
103 -1.9345328 3.9555755
104 -6.4384722 -1.9345328
105 -1.4898347 -6.4384722
106 0.9319299 -1.4898347
107 3.6743525 0.9319299
108 2.5463418 3.6743525
109 2.9594632 2.5463418
110 -4.9992618 2.9594632
111 -9.5414434 -4.9992618
112 6.0227911 -9.5414434
113 1.1031212 6.0227911
114 5.7330651 1.1031212
115 5.6482203 5.7330651
116 -1.7261847 5.6482203
117 3.9811342 -1.7261847
118 5.6277197 3.9811342
119 -10.2422803 5.6277197
120 -2.5314915 -10.2422803
121 -0.9460472 -2.5314915
122 3.6407014 -0.9460472
123 -2.1032449 3.6407014
124 -3.7191879 -2.1032449
125 -1.0625970 -3.7191879
126 2.2507967 -1.0625970
127 0.3480350 2.2507967
128 -3.7186834 0.3480350
129 -3.2814866 -3.7186834
130 0.8440809 -3.2814866
131 -9.1157221 0.8440809
132 5.8063910 -9.1157221
133 -4.7618640 5.8063910
134 0.2953176 -4.7618640
135 -1.3542691 0.2953176
136 3.9379074 -1.3542691
137 1.5795243 3.9379074
138 8.2251154 1.5795243
139 -3.5540130 8.2251154
140 5.3315013 -3.5540130
141 -0.1061926 5.3315013
142 5.3239927 -0.1061926
143 2.3606736 5.3239927
144 -3.6745298 2.3606736
145 -10.6016650 -3.6745298
> 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/7ff311292682892.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/8ff311292682892.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/9762m1292682892.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/10762m1292682892.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/11bpjs1292682892.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/12w7zy1292682892.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/13ahf71292682892.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/14dzvv1292682892.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/15hic11292682892.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/16vaa91292682892.tab")
+ }
>
> try(system("convert tmp/10n5t1292682892.ps tmp/10n5t1292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/2teme1292682892.ps tmp/2teme1292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/3teme1292682892.ps tmp/3teme1292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/4teme1292682892.ps tmp/4teme1292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/5teme1292682892.ps tmp/5teme1292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/6464z1292682892.ps tmp/6464z1292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ff311292682892.ps tmp/7ff311292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ff311292682892.ps tmp/8ff311292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/9762m1292682892.ps tmp/9762m1292682892.png",intern=TRUE))
character(0)
> try(system("convert tmp/10762m1292682892.ps tmp/10762m1292682892.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.359 2.686 5.691