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(13
+ ,11
+ ,23
+ ,1
+ ,6
+ ,12
+ ,22
+ ,24
+ ,2
+ ,5
+ ,26
+ ,23
+ ,24
+ ,2
+ ,20
+ ,16
+ ,21
+ ,21
+ ,2
+ ,12
+ ,18
+ ,19
+ ,21
+ ,2
+ ,11
+ ,12
+ ,12
+ ,19
+ ,2
+ ,12
+ ,18
+ ,24
+ ,12
+ ,1
+ ,11
+ ,20
+ ,21
+ ,21
+ ,1
+ ,9
+ ,18
+ ,21
+ ,25
+ ,2
+ ,13
+ ,24
+ ,26
+ ,27
+ ,2
+ ,9
+ ,17
+ ,18
+ ,21
+ ,1
+ ,14
+ ,19
+ ,21
+ ,27
+ ,1
+ ,12
+ ,12
+ ,22
+ ,20
+ ,1
+ ,18
+ ,25
+ ,26
+ ,16
+ ,2
+ ,9
+ ,23
+ ,20
+ ,26
+ ,1
+ ,15
+ ,22
+ ,20
+ ,24
+ ,2
+ ,12
+ ,23
+ ,26
+ ,25
+ ,2
+ ,12
+ ,16
+ ,27
+ ,25
+ ,1
+ ,12
+ ,16
+ ,27
+ ,27
+ ,1
+ ,15
+ ,15
+ ,16
+ ,23
+ ,2
+ ,11
+ ,24
+ ,26
+ ,22
+ ,1
+ ,13
+ ,18
+ ,20
+ ,10
+ ,1
+ ,10
+ ,23
+ ,25
+ ,25
+ ,2
+ ,17
+ ,18
+ ,16
+ ,18
+ ,1
+ ,13
+ ,19
+ ,20
+ ,21
+ ,1
+ ,17
+ ,17
+ ,20
+ ,20
+ ,1
+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 ,21
+ ,18
+ ,2
+ ,15
+ ,16
+ ,22
+ ,18
+ ,1
+ ,18
+ ,16
+ ,18
+ ,23
+ ,1
+ ,11
+ ,19
+ ,18
+ ,17
+ ,1
+ ,13
+ ,24
+ ,18
+ ,19
+ ,2
+ ,11
+ ,18
+ ,21
+ ,21
+ ,2
+ ,13
+ ,16
+ ,21
+ ,12
+ ,2
+ ,12
+ ,20
+ ,25
+ ,25
+ ,2
+ ,11
+ ,19
+ ,24
+ ,25
+ ,1
+ ,11
+ ,20
+ ,24
+ ,24
+ ,1
+ ,13
+ ,27
+ ,28
+ ,24
+ ,2
+ ,8
+ ,24
+ ,24
+ ,24
+ ,2
+ ,12
+ ,23
+ ,22
+ ,22
+ ,2
+ ,9
+ ,20
+ ,22
+ ,22
+ ,1
+ ,14
+ ,20
+ ,20
+ ,21
+ ,1
+ ,18
+ ,20
+ ,25
+ ,23
+ ,1
+ ,15
+ ,15
+ ,13
+ ,21
+ ,1
+ ,9
+ ,17
+ ,21
+ ,24
+ ,1
+ ,11
+ ,16
+ ,23
+ ,22
+ ,1
+ ,17
+ ,20
+ ,18
+ ,25
+ ,2
+ ,12)
+ ,dim=c(5
+ ,148)
+ ,dimnames=list(c('I/Accomp.'
+ ,'E/Introjected'
+ ,'E/Ext.Regulation'
+ ,'gender'
+ ,'PE')
+ ,1:148))
> y <- array(NA,dim=c(5,148),dimnames=list(c('I/Accomp.','E/Introjected','E/Ext.Regulation','gender','PE'),1:148))
> 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 = '2'
> #'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
E/Introjected I/Accomp. E/Ext.Regulation gender PE
1 11 13 23 1 6
2 22 12 24 2 5
3 23 26 24 2 20
4 21 16 21 2 12
5 19 18 21 2 11
6 12 12 19 2 12
7 24 18 12 1 11
8 21 20 21 1 9
9 21 18 25 2 13
10 26 24 27 2 9
11 18 17 21 1 14
12 21 19 27 1 12
13 22 12 20 1 18
14 26 25 16 2 9
15 20 23 26 1 15
16 20 22 24 2 12
17 26 23 25 2 12
18 27 16 25 1 12
19 27 16 27 1 15
20 16 15 23 2 11
21 26 24 22 1 13
22 20 18 10 1 10
23 25 23 25 2 17
24 16 18 18 1 13
25 20 19 21 1 17
26 20 17 20 1 15
27 24 22 18 1 13
28 24 22 25 1 17
29 22 8 28 1 21
30 18 12 27 1 12
31 21 22 20 2 12
32 17 16 20 1 15
33 15 12 20 2 8
34 28 28 27 2 15
35 23 15 23 1 16
36 19 17 23 2 9
37 15 16 22 2 13
38 26 24 26 1 11
39 20 27 21 1 9
40 11 10 17 1 15
41 17 20 27 2 9
42 16 17 16 2 15
43 21 20 26 1 14
44 18 16 17 1 8
45 17 16 24 2 11
46 21 22 23 2 14
47 18 19 20 1 14
48 16 11 10 1 12
49 13 11 21 1 15
50 28 28 25 1 11
51 25 12 28 1 11
52 24 22 25 2 9
53 15 15 20 2 8
54 21 19 20 1 13
55 11 12 27 1 12
56 27 18 26 1 24
57 23 21 19 2 11
58 21 21 26 1 11
59 16 15 20 2 16
60 20 12 22 1 12
61 21 25 19 2 18
62 10 12 23 2 12
63 18 25 28 2 14
64 20 17 22 2 16
65 21 26 27 2 24
66 24 24 14 1 13
67 26 18 25 1 11
68 23 20 22 1 14
69 22 17 24 1 16
70 13 11 23 1 12
71 27 27 25 1 21
72 24 14 28 2 11
73 19 22 28 1 6
74 17 19 16 2 9
75 16 19 25 1 14
76 20 18 21 1 16
77 8 9 27 1 18
78 16 22 21 2 9
79 17 17 22 1 13
80 23 23 26 2 17
81 18 16 21 1 11
82 24 23 24 1 16
83 17 13 24 1 11
84 20 21 23 1 11
85 22 17 26 2 11
86 22 15 21 1 20
87 20 16 24 1 10
88 18 19 23 1 12
89 21 19 21 2 11
90 23 16 20 1 14
91 28 23 22 1 12
92 19 19 26 1 12
93 22 17 23 1 12
94 17 20 23 2 10
95 25 25 22 2 12
96 22 22 25 2 10
97 21 18 21 2 10
98 15 16 21 1 13
99 20 18 25 1 12
100 25 15 26 2 13
101 21 19 21 1 9
102 24 23 24 1 14
103 23 20 21 2 14
104 22 24 23 1 12
105 14 17 24 1 18
106 11 20 24 1 17
107 22 11 24 1 12
108 22 20 25 1 15
109 6 8 28 1 8
110 15 22 18 2 8
111 26 20 28 1 12
112 26 23 22 1 10
113 20 11 28 1 18
114 26 22 22 1 15
115 15 10 24 1 16
116 25 19 27 2 11
117 22 26 21 2 10
118 20 22 26 2 7
119 18 12 24 1 17
120 23 13 25 1 7
121 22 19 20 2 14
122 23 19 21 1 12
123 17 21 23 1 15
124 20 11 23 1 13
125 21 21 19 2 10
126 23 25 22 1 16
127 25 27 15 2 11
128 25 21 24 2 7
129 21 14 18 2 15
130 22 16 18 1 18
131 18 16 23 1 11
132 18 19 17 1 13
133 18 24 19 2 11
134 21 18 21 2 13
135 21 16 12 2 12
136 25 20 25 2 11
137 24 19 25 1 11
138 24 20 24 1 13
139 28 27 24 2 8
140 24 24 24 2 12
141 22 23 22 2 9
142 22 20 22 1 14
143 20 20 21 1 18
144 25 20 23 1 15
145 13 15 21 1 9
146 21 17 24 1 11
147 23 16 22 1 17
148 18 20 25 2 12
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `I/Accomp.` `E/Ext.Regulation` gender
7.1989 0.5371 0.1397 -0.6692
PE
0.0868
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-11.0993 -2.1290 0.2915 2.3898 7.3434
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.19886 2.58879 2.781 0.00615 **
`I/Accomp.` 0.53710 0.06759 7.947 5.21e-13 ***
`E/Ext.Regulation` 0.13967 0.08301 1.683 0.09464 .
gender -0.66921 0.64133 -1.043 0.29849
PE 0.08680 0.09022 0.962 0.33764
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.583 on 143 degrees of freedom
Multiple R-squared: 0.3258, Adjusted R-squared: 0.3069
F-statistic: 17.27 on 4 and 143 DF, p-value: 1.394e-11
> 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.6252191 0.74956183 0.37478092
[2,] 0.5747868 0.85042644 0.42521322
[3,] 0.5513459 0.89730818 0.44865409
[4,] 0.5620459 0.87590825 0.43795413
[5,] 0.5593554 0.88128914 0.44064457
[6,] 0.8059153 0.38816948 0.19408474
[7,] 0.7390348 0.52193031 0.26096516
[8,] 0.6909198 0.61816049 0.30908024
[9,] 0.6419312 0.71613764 0.35806882
[10,] 0.6175176 0.76496489 0.38248245
[11,] 0.8385840 0.32283201 0.16141600
[12,] 0.9083652 0.18326966 0.09163483
[13,] 0.8953118 0.20937631 0.10468815
[14,] 0.8636945 0.27261091 0.13630545
[15,] 0.8235043 0.35299141 0.17649571
[16,] 0.7798760 0.44024807 0.22012404
[17,] 0.8118492 0.37630162 0.18815081
[18,] 0.7737479 0.45250411 0.22625206
[19,] 0.7210269 0.55794612 0.27897306
[20,] 0.6718699 0.65626013 0.32813006
[21,] 0.6114457 0.77710869 0.38855435
[22,] 0.6305293 0.73894134 0.36947067
[23,] 0.5768122 0.84637566 0.42318783
[24,] 0.5194479 0.96110413 0.48055207
[25,] 0.5034989 0.99300216 0.49650108
[26,] 0.4541514 0.90830281 0.54584860
[27,] 0.4064148 0.81282964 0.59358518
[28,] 0.3876632 0.77532647 0.61233676
[29,] 0.3337082 0.66741644 0.66629178
[30,] 0.3544888 0.70897761 0.64551120
[31,] 0.3091296 0.61825919 0.69087041
[32,] 0.3542984 0.70859673 0.64570163
[33,] 0.4122055 0.82441108 0.58779446
[34,] 0.4402024 0.88040474 0.55979763
[35,] 0.4108868 0.82177363 0.58911318
[36,] 0.3714265 0.74285295 0.62857352
[37,] 0.3213647 0.64272934 0.67863533
[38,] 0.2864410 0.57288203 0.71355899
[39,] 0.2465722 0.49314434 0.75342783
[40,] 0.2335636 0.46712730 0.76643635
[41,] 0.2001095 0.40021894 0.79989053
[42,] 0.2116419 0.42328379 0.78835811
[43,] 0.1843326 0.36866521 0.81566740
[44,] 0.2771261 0.55425222 0.72287389
[45,] 0.2483825 0.49676501 0.75161750
[46,] 0.2249461 0.44989224 0.77505388
[47,] 0.1884108 0.37682161 0.81158920
[48,] 0.3182124 0.63642472 0.68178764
[49,] 0.3476055 0.69521093 0.65239453
[50,] 0.3220633 0.64412656 0.67793672
[51,] 0.2877023 0.57540467 0.71229766
[52,] 0.2617821 0.52356425 0.73821788
[53,] 0.2449959 0.48999183 0.75500409
[54,] 0.2256529 0.45130586 0.77434707
[55,] 0.3204899 0.64097983 0.67951008
[56,] 0.4181502 0.83630048 0.58184976
[57,] 0.3730558 0.74611158 0.62694421
[58,] 0.4072722 0.81454439 0.59272780
[59,] 0.3697251 0.73945011 0.63027495
[60,] 0.4212275 0.84245506 0.57877247
[61,] 0.3813390 0.76267801 0.61866099
[62,] 0.3430006 0.68600114 0.65699943
[63,] 0.3515022 0.70300436 0.64849782
[64,] 0.3100185 0.62003692 0.68998154
[65,] 0.3742084 0.74841671 0.62579164
[66,] 0.3817866 0.76357327 0.61821337
[67,] 0.3544178 0.70883558 0.64558221
[68,] 0.4141390 0.82827796 0.58586102
[69,] 0.3690426 0.73808523 0.63095739
[70,] 0.6119991 0.77600185 0.38800092
[71,] 0.6712569 0.65748621 0.32874310
[72,] 0.6551205 0.68975900 0.34487950
[73,] 0.6132541 0.77349172 0.38674586
[74,] 0.5695040 0.86099202 0.43049601
[75,] 0.5222645 0.95547102 0.47773551
[76,] 0.4768833 0.95376662 0.52311669
[77,] 0.4405510 0.88110193 0.55944904
[78,] 0.4108189 0.82163790 0.58918105
[79,] 0.3863337 0.77266745 0.61366628
[80,] 0.3416533 0.68330651 0.65834674
[81,] 0.3259037 0.65180746 0.67409627
[82,] 0.2865863 0.57317261 0.71341369
[83,] 0.2901874 0.58037482 0.70981259
[84,] 0.3390912 0.67818235 0.66090882
[85,] 0.3120167 0.62403346 0.68798327
[86,] 0.2839356 0.56787130 0.71606435
[87,] 0.2980865 0.59617297 0.70191351
[88,] 0.2624900 0.52497991 0.73751005
[89,] 0.2256745 0.45134906 0.77432547
[90,] 0.1947571 0.38951415 0.80524293
[91,] 0.2044722 0.40894443 0.79552778
[92,] 0.1712218 0.34244361 0.82877819
[93,] 0.2182964 0.43659287 0.78170356
[94,] 0.1828718 0.36574360 0.81712820
[95,] 0.1522876 0.30457512 0.84771244
[96,] 0.1307878 0.26157551 0.86921224
[97,] 0.1082367 0.21647338 0.89176331
[98,] 0.1704436 0.34088728 0.82955636
[99,] 0.6040683 0.79186349 0.39593174
[100,] 0.6556513 0.68869747 0.34434874
[101,] 0.6070355 0.78592899 0.39296449
[102,] 0.9041686 0.19166282 0.09583141
[103,] 0.9529450 0.09410993 0.04705497
[104,] 0.9508989 0.09820226 0.04910113
[105,] 0.9505317 0.09893653 0.04946826
[106,] 0.9342673 0.13146543 0.06573272
[107,] 0.9384647 0.12307061 0.06153530
[108,] 0.9439389 0.11212211 0.05606105
[109,] 0.9370173 0.12596541 0.06298270
[110,] 0.9191890 0.16162200 0.08081100
[111,] 0.9177454 0.16450928 0.08225464
[112,] 0.8980131 0.20397372 0.10198686
[113,] 0.9093117 0.18137653 0.09068827
[114,] 0.8794959 0.24100823 0.12050411
[115,] 0.8639538 0.27209250 0.13604625
[116,] 0.9197024 0.16059524 0.08029762
[117,] 0.8996925 0.20061505 0.10030752
[118,] 0.8635995 0.27280102 0.13640051
[119,] 0.8288401 0.34231974 0.17115987
[120,] 0.7902228 0.41955435 0.20977717
[121,] 0.7959872 0.40802558 0.20401279
[122,] 0.7506290 0.49874196 0.24937098
[123,] 0.6973252 0.60534954 0.30267477
[124,] 0.6283463 0.74330730 0.37165365
[125,] 0.5653528 0.86929442 0.43464721
[126,] 0.7092205 0.58155904 0.29077952
[127,] 0.6179134 0.76417314 0.38208657
[128,] 0.8395275 0.32094504 0.16047252
[129,] 0.8774340 0.24513197 0.12256598
[130,] 0.7992968 0.40140642 0.20070321
[131,] 0.6931078 0.61378434 0.30689217
[132,] 0.5798764 0.84024723 0.42012362
[133,] 0.4119646 0.82392925 0.58803537
> postscript(file="/var/www/html/freestat/rcomp/tmp/13he91293049684.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/23he91293049684.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/33he91293049684.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/4w8wu1293049684.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/5w8wu1293049684.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 = 148
Frequency = 1
1 2 3 4 5 6
-6.24522195 5.90820809 -1.91309774 2.57127198 -0.41612938 -4.00098526
7 8 9 10 11 12
5.17173204 0.01405338 0.85158113 2.69682286 -1.80862807 -0.54728253
13 14 15 16 17 18
4.66935714 3.69614657 -3.81638696 -2.07034215 3.25288479 7.34336190
19 20 21 22 23 24
6.80362658 -2.08418387 2.37880421 1.53787678 1.81890836 -3.83990692
25 26 27 28 29 30
-1.14321058 0.24425137 2.01169978 0.68679553 5.43996674 0.21240574
31 32 33 34 35 36
-0.51164323 -2.21865030 -0.79347885 2.02765785 3.81262855 0.01521005
37 38 39 40 41 42
-3.65519803 1.99369586 -4.74563489 -4.57703616 -4.15478384 -2.52783854
43 44 45 46 47 48
-1.11829670 -0.19205911 -1.76095692 -1.10425799 -2.74314999 1.12397448
49 50 51 52 53 54
-3.67283341 1.98497730 7.15952629 2.05036897 -2.40477382 0.34364530
55 56 57 58 59 60
-6.78759426 5.08794710 2.25192511 -1.39500916 -2.09913610 2.91077939
61 62 63 64 65 66
-2.50403519 -6.55968418 -6.41392662 0.54731779 -4.67930307 1.49620206
67 68 69 70 71 72
5.35596054 1.44040223 1.59875717 -3.69179701 0.65412276 5.75454080
73 74 75 76 77 78
-3.77748052 -2.08126348 -5.44152364 -0.51931697 -8.69707100 -5.39093211
79 80 81 82 83 84
-2.86150752 -0.32076637 -1.01114389 0.37616722 -0.81887311 -1.97598497
85 86 87 88 89 90
2.42259529 2.74479687 0.65662720 -2.98858361 1.04677230 3.86814498
91 92 93 94 95 96
5.00269782 -2.40760780 2.08561304 -3.68288020 1.59771233 -0.03642631
97 98 99 100 101 102
1.67066591 -4.18473446 -0.73083475 6.32320137 0.55115171 0.54975779
103 104 105 106 107 108
2.24928812 -1.67407523 -6.57483340 -11.09933309 5.16852825 -0.06541725
109 110 111 112 113 114
-9.43169455 -5.88511263 3.77594441 3.17628839 2.08905762 3.27941029
115 116 117 118 119 120
-1.64155456 4.20872391 -1.62612069 -1.91571519 0.19745350 5.38863330
121 122 123 124 125 126
1.92606117 2.29076585 -5.32316611 3.22140770 0.33872039 -1.41867997
127 128 129 130 131 132
1.58803408 3.90073260 3.80410697 2.80031330 -1.29049335 -2.23733051
133 134 135 136 137 138
-4.35936986 1.41028005 3.82834456 3.95097505 2.81886221 2.24784805
139 140 141 142 143 144
3.59134737 0.85546120 -0.06770516 0.44040223 -1.76710419 3.21393221
145 146 147 148
-5.30045499 1.03273359 3.32840967 -3.13582024
> postscript(file="/var/www/html/freestat/rcomp/tmp/6w8wu1293049684.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 = 148
Frequency = 1
lag(myerror, k = 1) myerror
0 -6.24522195 NA
1 5.90820809 -6.24522195
2 -1.91309774 5.90820809
3 2.57127198 -1.91309774
4 -0.41612938 2.57127198
5 -4.00098526 -0.41612938
6 5.17173204 -4.00098526
7 0.01405338 5.17173204
8 0.85158113 0.01405338
9 2.69682286 0.85158113
10 -1.80862807 2.69682286
11 -0.54728253 -1.80862807
12 4.66935714 -0.54728253
13 3.69614657 4.66935714
14 -3.81638696 3.69614657
15 -2.07034215 -3.81638696
16 3.25288479 -2.07034215
17 7.34336190 3.25288479
18 6.80362658 7.34336190
19 -2.08418387 6.80362658
20 2.37880421 -2.08418387
21 1.53787678 2.37880421
22 1.81890836 1.53787678
23 -3.83990692 1.81890836
24 -1.14321058 -3.83990692
25 0.24425137 -1.14321058
26 2.01169978 0.24425137
27 0.68679553 2.01169978
28 5.43996674 0.68679553
29 0.21240574 5.43996674
30 -0.51164323 0.21240574
31 -2.21865030 -0.51164323
32 -0.79347885 -2.21865030
33 2.02765785 -0.79347885
34 3.81262855 2.02765785
35 0.01521005 3.81262855
36 -3.65519803 0.01521005
37 1.99369586 -3.65519803
38 -4.74563489 1.99369586
39 -4.57703616 -4.74563489
40 -4.15478384 -4.57703616
41 -2.52783854 -4.15478384
42 -1.11829670 -2.52783854
43 -0.19205911 -1.11829670
44 -1.76095692 -0.19205911
45 -1.10425799 -1.76095692
46 -2.74314999 -1.10425799
47 1.12397448 -2.74314999
48 -3.67283341 1.12397448
49 1.98497730 -3.67283341
50 7.15952629 1.98497730
51 2.05036897 7.15952629
52 -2.40477382 2.05036897
53 0.34364530 -2.40477382
54 -6.78759426 0.34364530
55 5.08794710 -6.78759426
56 2.25192511 5.08794710
57 -1.39500916 2.25192511
58 -2.09913610 -1.39500916
59 2.91077939 -2.09913610
60 -2.50403519 2.91077939
61 -6.55968418 -2.50403519
62 -6.41392662 -6.55968418
63 0.54731779 -6.41392662
64 -4.67930307 0.54731779
65 1.49620206 -4.67930307
66 5.35596054 1.49620206
67 1.44040223 5.35596054
68 1.59875717 1.44040223
69 -3.69179701 1.59875717
70 0.65412276 -3.69179701
71 5.75454080 0.65412276
72 -3.77748052 5.75454080
73 -2.08126348 -3.77748052
74 -5.44152364 -2.08126348
75 -0.51931697 -5.44152364
76 -8.69707100 -0.51931697
77 -5.39093211 -8.69707100
78 -2.86150752 -5.39093211
79 -0.32076637 -2.86150752
80 -1.01114389 -0.32076637
81 0.37616722 -1.01114389
82 -0.81887311 0.37616722
83 -1.97598497 -0.81887311
84 2.42259529 -1.97598497
85 2.74479687 2.42259529
86 0.65662720 2.74479687
87 -2.98858361 0.65662720
88 1.04677230 -2.98858361
89 3.86814498 1.04677230
90 5.00269782 3.86814498
91 -2.40760780 5.00269782
92 2.08561304 -2.40760780
93 -3.68288020 2.08561304
94 1.59771233 -3.68288020
95 -0.03642631 1.59771233
96 1.67066591 -0.03642631
97 -4.18473446 1.67066591
98 -0.73083475 -4.18473446
99 6.32320137 -0.73083475
100 0.55115171 6.32320137
101 0.54975779 0.55115171
102 2.24928812 0.54975779
103 -1.67407523 2.24928812
104 -6.57483340 -1.67407523
105 -11.09933309 -6.57483340
106 5.16852825 -11.09933309
107 -0.06541725 5.16852825
108 -9.43169455 -0.06541725
109 -5.88511263 -9.43169455
110 3.77594441 -5.88511263
111 3.17628839 3.77594441
112 2.08905762 3.17628839
113 3.27941029 2.08905762
114 -1.64155456 3.27941029
115 4.20872391 -1.64155456
116 -1.62612069 4.20872391
117 -1.91571519 -1.62612069
118 0.19745350 -1.91571519
119 5.38863330 0.19745350
120 1.92606117 5.38863330
121 2.29076585 1.92606117
122 -5.32316611 2.29076585
123 3.22140770 -5.32316611
124 0.33872039 3.22140770
125 -1.41867997 0.33872039
126 1.58803408 -1.41867997
127 3.90073260 1.58803408
128 3.80410697 3.90073260
129 2.80031330 3.80410697
130 -1.29049335 2.80031330
131 -2.23733051 -1.29049335
132 -4.35936986 -2.23733051
133 1.41028005 -4.35936986
134 3.82834456 1.41028005
135 3.95097505 3.82834456
136 2.81886221 3.95097505
137 2.24784805 2.81886221
138 3.59134737 2.24784805
139 0.85546120 3.59134737
140 -0.06770516 0.85546120
141 0.44040223 -0.06770516
142 -1.76710419 0.44040223
143 3.21393221 -1.76710419
144 -5.30045499 3.21393221
145 1.03273359 -5.30045499
146 3.32840967 1.03273359
147 -3.13582024 3.32840967
148 NA -3.13582024
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 5.90820809 -6.24522195
[2,] -1.91309774 5.90820809
[3,] 2.57127198 -1.91309774
[4,] -0.41612938 2.57127198
[5,] -4.00098526 -0.41612938
[6,] 5.17173204 -4.00098526
[7,] 0.01405338 5.17173204
[8,] 0.85158113 0.01405338
[9,] 2.69682286 0.85158113
[10,] -1.80862807 2.69682286
[11,] -0.54728253 -1.80862807
[12,] 4.66935714 -0.54728253
[13,] 3.69614657 4.66935714
[14,] -3.81638696 3.69614657
[15,] -2.07034215 -3.81638696
[16,] 3.25288479 -2.07034215
[17,] 7.34336190 3.25288479
[18,] 6.80362658 7.34336190
[19,] -2.08418387 6.80362658
[20,] 2.37880421 -2.08418387
[21,] 1.53787678 2.37880421
[22,] 1.81890836 1.53787678
[23,] -3.83990692 1.81890836
[24,] -1.14321058 -3.83990692
[25,] 0.24425137 -1.14321058
[26,] 2.01169978 0.24425137
[27,] 0.68679553 2.01169978
[28,] 5.43996674 0.68679553
[29,] 0.21240574 5.43996674
[30,] -0.51164323 0.21240574
[31,] -2.21865030 -0.51164323
[32,] -0.79347885 -2.21865030
[33,] 2.02765785 -0.79347885
[34,] 3.81262855 2.02765785
[35,] 0.01521005 3.81262855
[36,] -3.65519803 0.01521005
[37,] 1.99369586 -3.65519803
[38,] -4.74563489 1.99369586
[39,] -4.57703616 -4.74563489
[40,] -4.15478384 -4.57703616
[41,] -2.52783854 -4.15478384
[42,] -1.11829670 -2.52783854
[43,] -0.19205911 -1.11829670
[44,] -1.76095692 -0.19205911
[45,] -1.10425799 -1.76095692
[46,] -2.74314999 -1.10425799
[47,] 1.12397448 -2.74314999
[48,] -3.67283341 1.12397448
[49,] 1.98497730 -3.67283341
[50,] 7.15952629 1.98497730
[51,] 2.05036897 7.15952629
[52,] -2.40477382 2.05036897
[53,] 0.34364530 -2.40477382
[54,] -6.78759426 0.34364530
[55,] 5.08794710 -6.78759426
[56,] 2.25192511 5.08794710
[57,] -1.39500916 2.25192511
[58,] -2.09913610 -1.39500916
[59,] 2.91077939 -2.09913610
[60,] -2.50403519 2.91077939
[61,] -6.55968418 -2.50403519
[62,] -6.41392662 -6.55968418
[63,] 0.54731779 -6.41392662
[64,] -4.67930307 0.54731779
[65,] 1.49620206 -4.67930307
[66,] 5.35596054 1.49620206
[67,] 1.44040223 5.35596054
[68,] 1.59875717 1.44040223
[69,] -3.69179701 1.59875717
[70,] 0.65412276 -3.69179701
[71,] 5.75454080 0.65412276
[72,] -3.77748052 5.75454080
[73,] -2.08126348 -3.77748052
[74,] -5.44152364 -2.08126348
[75,] -0.51931697 -5.44152364
[76,] -8.69707100 -0.51931697
[77,] -5.39093211 -8.69707100
[78,] -2.86150752 -5.39093211
[79,] -0.32076637 -2.86150752
[80,] -1.01114389 -0.32076637
[81,] 0.37616722 -1.01114389
[82,] -0.81887311 0.37616722
[83,] -1.97598497 -0.81887311
[84,] 2.42259529 -1.97598497
[85,] 2.74479687 2.42259529
[86,] 0.65662720 2.74479687
[87,] -2.98858361 0.65662720
[88,] 1.04677230 -2.98858361
[89,] 3.86814498 1.04677230
[90,] 5.00269782 3.86814498
[91,] -2.40760780 5.00269782
[92,] 2.08561304 -2.40760780
[93,] -3.68288020 2.08561304
[94,] 1.59771233 -3.68288020
[95,] -0.03642631 1.59771233
[96,] 1.67066591 -0.03642631
[97,] -4.18473446 1.67066591
[98,] -0.73083475 -4.18473446
[99,] 6.32320137 -0.73083475
[100,] 0.55115171 6.32320137
[101,] 0.54975779 0.55115171
[102,] 2.24928812 0.54975779
[103,] -1.67407523 2.24928812
[104,] -6.57483340 -1.67407523
[105,] -11.09933309 -6.57483340
[106,] 5.16852825 -11.09933309
[107,] -0.06541725 5.16852825
[108,] -9.43169455 -0.06541725
[109,] -5.88511263 -9.43169455
[110,] 3.77594441 -5.88511263
[111,] 3.17628839 3.77594441
[112,] 2.08905762 3.17628839
[113,] 3.27941029 2.08905762
[114,] -1.64155456 3.27941029
[115,] 4.20872391 -1.64155456
[116,] -1.62612069 4.20872391
[117,] -1.91571519 -1.62612069
[118,] 0.19745350 -1.91571519
[119,] 5.38863330 0.19745350
[120,] 1.92606117 5.38863330
[121,] 2.29076585 1.92606117
[122,] -5.32316611 2.29076585
[123,] 3.22140770 -5.32316611
[124,] 0.33872039 3.22140770
[125,] -1.41867997 0.33872039
[126,] 1.58803408 -1.41867997
[127,] 3.90073260 1.58803408
[128,] 3.80410697 3.90073260
[129,] 2.80031330 3.80410697
[130,] -1.29049335 2.80031330
[131,] -2.23733051 -1.29049335
[132,] -4.35936986 -2.23733051
[133,] 1.41028005 -4.35936986
[134,] 3.82834456 1.41028005
[135,] 3.95097505 3.82834456
[136,] 2.81886221 3.95097505
[137,] 2.24784805 2.81886221
[138,] 3.59134737 2.24784805
[139,] 0.85546120 3.59134737
[140,] -0.06770516 0.85546120
[141,] 0.44040223 -0.06770516
[142,] -1.76710419 0.44040223
[143,] 3.21393221 -1.76710419
[144,] -5.30045499 3.21393221
[145,] 1.03273359 -5.30045499
[146,] 3.32840967 1.03273359
[147,] -3.13582024 3.32840967
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 5.90820809 -6.24522195
2 -1.91309774 5.90820809
3 2.57127198 -1.91309774
4 -0.41612938 2.57127198
5 -4.00098526 -0.41612938
6 5.17173204 -4.00098526
7 0.01405338 5.17173204
8 0.85158113 0.01405338
9 2.69682286 0.85158113
10 -1.80862807 2.69682286
11 -0.54728253 -1.80862807
12 4.66935714 -0.54728253
13 3.69614657 4.66935714
14 -3.81638696 3.69614657
15 -2.07034215 -3.81638696
16 3.25288479 -2.07034215
17 7.34336190 3.25288479
18 6.80362658 7.34336190
19 -2.08418387 6.80362658
20 2.37880421 -2.08418387
21 1.53787678 2.37880421
22 1.81890836 1.53787678
23 -3.83990692 1.81890836
24 -1.14321058 -3.83990692
25 0.24425137 -1.14321058
26 2.01169978 0.24425137
27 0.68679553 2.01169978
28 5.43996674 0.68679553
29 0.21240574 5.43996674
30 -0.51164323 0.21240574
31 -2.21865030 -0.51164323
32 -0.79347885 -2.21865030
33 2.02765785 -0.79347885
34 3.81262855 2.02765785
35 0.01521005 3.81262855
36 -3.65519803 0.01521005
37 1.99369586 -3.65519803
38 -4.74563489 1.99369586
39 -4.57703616 -4.74563489
40 -4.15478384 -4.57703616
41 -2.52783854 -4.15478384
42 -1.11829670 -2.52783854
43 -0.19205911 -1.11829670
44 -1.76095692 -0.19205911
45 -1.10425799 -1.76095692
46 -2.74314999 -1.10425799
47 1.12397448 -2.74314999
48 -3.67283341 1.12397448
49 1.98497730 -3.67283341
50 7.15952629 1.98497730
51 2.05036897 7.15952629
52 -2.40477382 2.05036897
53 0.34364530 -2.40477382
54 -6.78759426 0.34364530
55 5.08794710 -6.78759426
56 2.25192511 5.08794710
57 -1.39500916 2.25192511
58 -2.09913610 -1.39500916
59 2.91077939 -2.09913610
60 -2.50403519 2.91077939
61 -6.55968418 -2.50403519
62 -6.41392662 -6.55968418
63 0.54731779 -6.41392662
64 -4.67930307 0.54731779
65 1.49620206 -4.67930307
66 5.35596054 1.49620206
67 1.44040223 5.35596054
68 1.59875717 1.44040223
69 -3.69179701 1.59875717
70 0.65412276 -3.69179701
71 5.75454080 0.65412276
72 -3.77748052 5.75454080
73 -2.08126348 -3.77748052
74 -5.44152364 -2.08126348
75 -0.51931697 -5.44152364
76 -8.69707100 -0.51931697
77 -5.39093211 -8.69707100
78 -2.86150752 -5.39093211
79 -0.32076637 -2.86150752
80 -1.01114389 -0.32076637
81 0.37616722 -1.01114389
82 -0.81887311 0.37616722
83 -1.97598497 -0.81887311
84 2.42259529 -1.97598497
85 2.74479687 2.42259529
86 0.65662720 2.74479687
87 -2.98858361 0.65662720
88 1.04677230 -2.98858361
89 3.86814498 1.04677230
90 5.00269782 3.86814498
91 -2.40760780 5.00269782
92 2.08561304 -2.40760780
93 -3.68288020 2.08561304
94 1.59771233 -3.68288020
95 -0.03642631 1.59771233
96 1.67066591 -0.03642631
97 -4.18473446 1.67066591
98 -0.73083475 -4.18473446
99 6.32320137 -0.73083475
100 0.55115171 6.32320137
101 0.54975779 0.55115171
102 2.24928812 0.54975779
103 -1.67407523 2.24928812
104 -6.57483340 -1.67407523
105 -11.09933309 -6.57483340
106 5.16852825 -11.09933309
107 -0.06541725 5.16852825
108 -9.43169455 -0.06541725
109 -5.88511263 -9.43169455
110 3.77594441 -5.88511263
111 3.17628839 3.77594441
112 2.08905762 3.17628839
113 3.27941029 2.08905762
114 -1.64155456 3.27941029
115 4.20872391 -1.64155456
116 -1.62612069 4.20872391
117 -1.91571519 -1.62612069
118 0.19745350 -1.91571519
119 5.38863330 0.19745350
120 1.92606117 5.38863330
121 2.29076585 1.92606117
122 -5.32316611 2.29076585
123 3.22140770 -5.32316611
124 0.33872039 3.22140770
125 -1.41867997 0.33872039
126 1.58803408 -1.41867997
127 3.90073260 1.58803408
128 3.80410697 3.90073260
129 2.80031330 3.80410697
130 -1.29049335 2.80031330
131 -2.23733051 -1.29049335
132 -4.35936986 -2.23733051
133 1.41028005 -4.35936986
134 3.82834456 1.41028005
135 3.95097505 3.82834456
136 2.81886221 3.95097505
137 2.24784805 2.81886221
138 3.59134737 2.24784805
139 0.85546120 3.59134737
140 -0.06770516 0.85546120
141 0.44040223 -0.06770516
142 -1.76710419 0.44040223
143 3.21393221 -1.76710419
144 -5.30045499 3.21393221
145 1.03273359 -5.30045499
146 3.32840967 1.03273359
147 -3.13582024 3.32840967
> 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/71eoq1293049684.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/81eoq1293049684.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/9unnt1293049684.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/10unnt1293049684.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/11fomh1293049684.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/12jokn1293049684.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/1377hy1293049684.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/140gg11293049684.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/15lhx71293049684.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/16i9dg1293049684.tab")
+ }
>
> try(system("convert tmp/13he91293049684.ps tmp/13he91293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/23he91293049684.ps tmp/23he91293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/33he91293049684.ps tmp/33he91293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/4w8wu1293049684.ps tmp/4w8wu1293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/5w8wu1293049684.ps tmp/5w8wu1293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/6w8wu1293049684.ps tmp/6w8wu1293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/71eoq1293049684.ps tmp/71eoq1293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/81eoq1293049684.ps tmp/81eoq1293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/9unnt1293049684.ps tmp/9unnt1293049684.png",intern=TRUE))
character(0)
> try(system("convert tmp/10unnt1293049684.ps tmp/10unnt1293049684.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.323 2.643 5.687