R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(6.3,2.7,6.1,2.5,6.1,2.2,6.3,2.9,6.3,3.1,6,3,6.2,2.8,6.4,2.5,6.8,1.9,7.5,1.9,7.5,1.8,7.6,2,7.6,2.6,7.4,2.5,7.3,2.5,7.1,1.6,6.9,1.4,6.8,0.8,7.5,1.1,7.6,1.3,7.8,1.2,8,1.3,8.1,1.1,8.2,1.3,8.3,1.2,8.2,1.6,8,1.7,7.9,1.5,7.6,0.9,7.6,1.5,8.3,1.4,8.4,1.6,8.4,1.7,8.4,1.4,8.4,1.8,8.6,1.7,8.9,1.4,8.8,1.2,8.3,1,7.5,1.7,7.2,2.4,7.4,2,8.8,2.1,9.3,2,9.3,1.8,8.7,2.7,8.2,2.3,8.3,1.9,8.5,2,8.6,2.3,8.5,2.8,8.2,2.4,8.1,2.3,7.9,2.7,8.6,2.7,8.7,2.9,8.7,3,8.5,2.2,8.4,2.3,8.5,2.8,8.7,2.8),dim=c(2,61),dimnames=list(c('Werkl','Inflatie'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Werkl','Inflatie'),1:61))
> 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
Werkl Inflatie
1 6.3 2.7
2 6.1 2.5
3 6.1 2.2
4 6.3 2.9
5 6.3 3.1
6 6.0 3.0
7 6.2 2.8
8 6.4 2.5
9 6.8 1.9
10 7.5 1.9
11 7.5 1.8
12 7.6 2.0
13 7.6 2.6
14 7.4 2.5
15 7.3 2.5
16 7.1 1.6
17 6.9 1.4
18 6.8 0.8
19 7.5 1.1
20 7.6 1.3
21 7.8 1.2
22 8.0 1.3
23 8.1 1.1
24 8.2 1.3
25 8.3 1.2
26 8.2 1.6
27 8.0 1.7
28 7.9 1.5
29 7.6 0.9
30 7.6 1.5
31 8.3 1.4
32 8.4 1.6
33 8.4 1.7
34 8.4 1.4
35 8.4 1.8
36 8.6 1.7
37 8.9 1.4
38 8.8 1.2
39 8.3 1.0
40 7.5 1.7
41 7.2 2.4
42 7.4 2.0
43 8.8 2.1
44 9.3 2.0
45 9.3 1.8
46 8.7 2.7
47 8.2 2.3
48 8.3 1.9
49 8.5 2.0
50 8.6 2.3
51 8.5 2.8
52 8.2 2.4
53 8.1 2.3
54 7.9 2.7
55 8.6 2.7
56 8.7 2.9
57 8.7 3.0
58 8.5 2.2
59 8.4 2.3
60 8.5 2.8
61 8.7 2.8
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Inflatie
8.3617 -0.2626
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.6839 -0.4364 0.1797 0.6636 1.4636
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.3617 0.3665 22.813 <2e-16 ***
Inflatie -0.2626 0.1756 -1.496 0.14
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.8432 on 59 degrees of freedom
Multiple R-squared: 0.03654, Adjusted R-squared: 0.02021
F-statistic: 2.238 on 1 and 59 DF, p-value: 0.14
> 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.0009159216 1.831843e-03 9.990841e-01
[2,] 0.0034154101 6.830820e-03 9.965846e-01
[3,] 0.0008806122 1.761224e-03 9.991194e-01
[4,] 0.0009649436 1.929887e-03 9.990351e-01
[5,] 0.0049347363 9.869473e-03 9.950653e-01
[6,] 0.0655840984 1.311682e-01 9.344159e-01
[7,] 0.0725569920 1.451140e-01 9.274430e-01
[8,] 0.1058676821 2.117354e-01 8.941323e-01
[9,] 0.3629610726 7.259221e-01 6.370389e-01
[10,] 0.4657433549 9.314867e-01 5.342566e-01
[11,] 0.5422940957 9.154118e-01 4.577059e-01
[12,] 0.5642050401 8.715899e-01 4.357950e-01
[13,] 0.6704608705 6.590783e-01 3.295391e-01
[14,] 0.8139322155 3.721356e-01 1.860678e-01
[15,] 0.7924017650 4.151965e-01 2.075982e-01
[16,] 0.7815420905 4.369158e-01 2.184579e-01
[17,] 0.7650806827 4.698386e-01 2.349193e-01
[18,] 0.7671627875 4.656744e-01 2.328372e-01
[19,] 0.7482264936 5.035470e-01 2.517735e-01
[20,] 0.7532859966 4.934280e-01 2.467140e-01
[21,] 0.7496007856 5.007984e-01 2.503992e-01
[22,] 0.7660404384 4.679191e-01 2.339596e-01
[23,] 0.7617722796 4.764554e-01 2.382277e-01
[24,] 0.7329311330 5.341377e-01 2.670689e-01
[25,] 0.7426629038 5.146742e-01 2.573371e-01
[26,] 0.7631795346 4.736409e-01 2.368205e-01
[27,] 0.7534205751 4.931588e-01 2.465794e-01
[28,] 0.7697941324 4.604117e-01 2.302059e-01
[29,] 0.7853336027 4.293328e-01 2.146664e-01
[30,] 0.7627670306 4.744659e-01 2.372330e-01
[31,] 0.7717185678 4.565629e-01 2.282814e-01
[32,] 0.7872770937 4.254458e-01 2.127229e-01
[33,] 0.8200719780 3.598560e-01 1.799280e-01
[34,] 0.8211174036 3.577652e-01 1.788826e-01
[35,] 0.7655908383 4.688183e-01 2.344092e-01
[36,] 0.8009268972 3.981462e-01 1.990731e-01
[37,] 0.9340628985 1.318742e-01 6.593710e-02
[38,] 0.9903772637 1.924547e-02 9.622736e-03
[39,] 0.9924895532 1.502089e-02 7.510447e-03
[40,] 0.9989340363 2.131927e-03 1.065964e-03
[41,] 0.9999850439 2.991219e-05 1.495609e-05
[42,] 0.9999831204 3.375926e-05 1.687963e-05
[43,] 0.9999619104 7.617918e-05 3.808959e-05
[44,] 0.9998795840 2.408319e-04 1.204160e-04
[45,] 0.9997519497 4.961006e-04 2.480503e-04
[46,] 0.9996281185 7.437629e-04 3.718815e-04
[47,] 0.9989928747 2.014251e-03 1.007125e-03
[48,] 0.9972405269 5.518946e-03 2.759473e-03
[49,] 0.9940266024 1.194680e-02 5.973398e-03
[50,] 0.9999692881 6.142383e-05 3.071191e-05
[51,] 0.9997030713 5.938573e-04 2.969287e-04
[52,] 0.9976191928 4.761614e-03 2.380807e-03
> postscript(file="/var/www/html/rcomp/tmp/1xd0b1260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2g3zl1260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3tbxb1260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4kze71260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5sc131260020129.ps",horizontal=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 = 61
Frequency = 1
1 2 3 4 5 6
-1.35256613 -1.60509388 -1.68388550 -1.30003837 -1.24751062 -1.57377450
7 8 9 10 11 12
-1.42630225 -1.30509388 -1.06267713 -0.36267713 -0.38894100 -0.23641325
13 14 15 16 17 18
-0.07883000 -0.30509388 -0.40509388 -0.84146875 -1.09399650 -1.35157976
19 20 21 22 23 24
-0.57278813 -0.42026038 -0.24652425 -0.02026038 0.02721187 0.17973962
25 26 27 28 29 30
0.25347575 0.25853125 0.08479512 -0.06773263 -0.52531588 -0.36773263
31 32 33 34 35 36
0.30600350 0.45853125 0.48479512 0.40600350 0.51105900 0.68479512
37 38 39 40 41 42
0.90600350 0.75347575 0.20094800 -0.41520488 -0.53135775 -0.43641325
43 44 45 46 47 48
0.98985062 1.46358675 1.41105900 1.04743387 0.44237837 0.43732287
49 50 51 52 53 54
0.66358675 0.84237837 0.87369775 0.46864225 0.34237837 0.24743387
55 56 57 58 59 60
0.94743387 1.09996163 1.12622550 0.71611450 0.64237837 0.87369775
61
1.07369775
> postscript(file="/var/www/html/rcomp/tmp/6a18r1260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.35256613 NA
1 -1.60509388 -1.35256613
2 -1.68388550 -1.60509388
3 -1.30003837 -1.68388550
4 -1.24751062 -1.30003837
5 -1.57377450 -1.24751062
6 -1.42630225 -1.57377450
7 -1.30509388 -1.42630225
8 -1.06267713 -1.30509388
9 -0.36267713 -1.06267713
10 -0.38894100 -0.36267713
11 -0.23641325 -0.38894100
12 -0.07883000 -0.23641325
13 -0.30509388 -0.07883000
14 -0.40509388 -0.30509388
15 -0.84146875 -0.40509388
16 -1.09399650 -0.84146875
17 -1.35157976 -1.09399650
18 -0.57278813 -1.35157976
19 -0.42026038 -0.57278813
20 -0.24652425 -0.42026038
21 -0.02026038 -0.24652425
22 0.02721187 -0.02026038
23 0.17973962 0.02721187
24 0.25347575 0.17973962
25 0.25853125 0.25347575
26 0.08479512 0.25853125
27 -0.06773263 0.08479512
28 -0.52531588 -0.06773263
29 -0.36773263 -0.52531588
30 0.30600350 -0.36773263
31 0.45853125 0.30600350
32 0.48479512 0.45853125
33 0.40600350 0.48479512
34 0.51105900 0.40600350
35 0.68479512 0.51105900
36 0.90600350 0.68479512
37 0.75347575 0.90600350
38 0.20094800 0.75347575
39 -0.41520488 0.20094800
40 -0.53135775 -0.41520488
41 -0.43641325 -0.53135775
42 0.98985062 -0.43641325
43 1.46358675 0.98985062
44 1.41105900 1.46358675
45 1.04743387 1.41105900
46 0.44237837 1.04743387
47 0.43732287 0.44237837
48 0.66358675 0.43732287
49 0.84237837 0.66358675
50 0.87369775 0.84237837
51 0.46864225 0.87369775
52 0.34237837 0.46864225
53 0.24743387 0.34237837
54 0.94743387 0.24743387
55 1.09996163 0.94743387
56 1.12622550 1.09996163
57 0.71611450 1.12622550
58 0.64237837 0.71611450
59 0.87369775 0.64237837
60 1.07369775 0.87369775
61 NA 1.07369775
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.60509388 -1.35256613
[2,] -1.68388550 -1.60509388
[3,] -1.30003837 -1.68388550
[4,] -1.24751062 -1.30003837
[5,] -1.57377450 -1.24751062
[6,] -1.42630225 -1.57377450
[7,] -1.30509388 -1.42630225
[8,] -1.06267713 -1.30509388
[9,] -0.36267713 -1.06267713
[10,] -0.38894100 -0.36267713
[11,] -0.23641325 -0.38894100
[12,] -0.07883000 -0.23641325
[13,] -0.30509388 -0.07883000
[14,] -0.40509388 -0.30509388
[15,] -0.84146875 -0.40509388
[16,] -1.09399650 -0.84146875
[17,] -1.35157976 -1.09399650
[18,] -0.57278813 -1.35157976
[19,] -0.42026038 -0.57278813
[20,] -0.24652425 -0.42026038
[21,] -0.02026038 -0.24652425
[22,] 0.02721187 -0.02026038
[23,] 0.17973962 0.02721187
[24,] 0.25347575 0.17973962
[25,] 0.25853125 0.25347575
[26,] 0.08479512 0.25853125
[27,] -0.06773263 0.08479512
[28,] -0.52531588 -0.06773263
[29,] -0.36773263 -0.52531588
[30,] 0.30600350 -0.36773263
[31,] 0.45853125 0.30600350
[32,] 0.48479512 0.45853125
[33,] 0.40600350 0.48479512
[34,] 0.51105900 0.40600350
[35,] 0.68479512 0.51105900
[36,] 0.90600350 0.68479512
[37,] 0.75347575 0.90600350
[38,] 0.20094800 0.75347575
[39,] -0.41520488 0.20094800
[40,] -0.53135775 -0.41520488
[41,] -0.43641325 -0.53135775
[42,] 0.98985062 -0.43641325
[43,] 1.46358675 0.98985062
[44,] 1.41105900 1.46358675
[45,] 1.04743387 1.41105900
[46,] 0.44237837 1.04743387
[47,] 0.43732287 0.44237837
[48,] 0.66358675 0.43732287
[49,] 0.84237837 0.66358675
[50,] 0.87369775 0.84237837
[51,] 0.46864225 0.87369775
[52,] 0.34237837 0.46864225
[53,] 0.24743387 0.34237837
[54,] 0.94743387 0.24743387
[55,] 1.09996163 0.94743387
[56,] 1.12622550 1.09996163
[57,] 0.71611450 1.12622550
[58,] 0.64237837 0.71611450
[59,] 0.87369775 0.64237837
[60,] 1.07369775 0.87369775
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.60509388 -1.35256613
2 -1.68388550 -1.60509388
3 -1.30003837 -1.68388550
4 -1.24751062 -1.30003837
5 -1.57377450 -1.24751062
6 -1.42630225 -1.57377450
7 -1.30509388 -1.42630225
8 -1.06267713 -1.30509388
9 -0.36267713 -1.06267713
10 -0.38894100 -0.36267713
11 -0.23641325 -0.38894100
12 -0.07883000 -0.23641325
13 -0.30509388 -0.07883000
14 -0.40509388 -0.30509388
15 -0.84146875 -0.40509388
16 -1.09399650 -0.84146875
17 -1.35157976 -1.09399650
18 -0.57278813 -1.35157976
19 -0.42026038 -0.57278813
20 -0.24652425 -0.42026038
21 -0.02026038 -0.24652425
22 0.02721187 -0.02026038
23 0.17973962 0.02721187
24 0.25347575 0.17973962
25 0.25853125 0.25347575
26 0.08479512 0.25853125
27 -0.06773263 0.08479512
28 -0.52531588 -0.06773263
29 -0.36773263 -0.52531588
30 0.30600350 -0.36773263
31 0.45853125 0.30600350
32 0.48479512 0.45853125
33 0.40600350 0.48479512
34 0.51105900 0.40600350
35 0.68479512 0.51105900
36 0.90600350 0.68479512
37 0.75347575 0.90600350
38 0.20094800 0.75347575
39 -0.41520488 0.20094800
40 -0.53135775 -0.41520488
41 -0.43641325 -0.53135775
42 0.98985062 -0.43641325
43 1.46358675 0.98985062
44 1.41105900 1.46358675
45 1.04743387 1.41105900
46 0.44237837 1.04743387
47 0.43732287 0.44237837
48 0.66358675 0.43732287
49 0.84237837 0.66358675
50 0.87369775 0.84237837
51 0.46864225 0.87369775
52 0.34237837 0.46864225
53 0.24743387 0.34237837
54 0.94743387 0.24743387
55 1.09996163 0.94743387
56 1.12622550 1.09996163
57 0.71611450 1.12622550
58 0.64237837 0.71611450
59 0.87369775 0.64237837
60 1.07369775 0.87369775
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7l3jg1260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8bxfi1260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9yso31260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10h1x01260020129.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/1170qi1260020129.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12o5nk1260020129.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/130r8n1260020129.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14h7qe1260020129.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15quye1260020129.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16y3it1260020129.tab")
+ }
>
> system("convert tmp/1xd0b1260020129.ps tmp/1xd0b1260020129.png")
> system("convert tmp/2g3zl1260020129.ps tmp/2g3zl1260020129.png")
> system("convert tmp/3tbxb1260020129.ps tmp/3tbxb1260020129.png")
> system("convert tmp/4kze71260020129.ps tmp/4kze71260020129.png")
> system("convert tmp/5sc131260020129.ps tmp/5sc131260020129.png")
> system("convert tmp/6a18r1260020129.ps tmp/6a18r1260020129.png")
> system("convert tmp/7l3jg1260020129.ps tmp/7l3jg1260020129.png")
> system("convert tmp/8bxfi1260020129.ps tmp/8bxfi1260020129.png")
> system("convert tmp/9yso31260020129.ps tmp/9yso31260020129.png")
> system("convert tmp/10h1x01260020129.ps tmp/10h1x01260020129.png")
>
>
> proc.time()
user system elapsed
2.410 1.533 3.680