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(3,11,6,12,2,2,12,6,7,1,-7,39,4,11,-8,-1,19,6,9,-1,0,14,5,13,1,-3,15,4,12,-1,4,7,5,5,2,2,12,5,13,2,3,12,4,11,1,0,14,3,8,-1,-10,9,2,8,-2,-10,8,3,8,-2,-9,4,2,8,-1,-22,7,-1,0,-8,-16,3,0,3,-4,-18,5,-2,0,-6,-14,0,1,-1,-3,-12,-2,-4,-1,-3,-17,6,-2,-4,-7,-23,11,-2,1,-9,-28,9,-6,-1,-11,-31,17,-4,0,-13,-21,21,-2,-1,-11,-19,21,0,6,-9,-22,41,-5,0,-17,-22,57,-4,-3,-22,-25,65,-5,-3,-25,-16,68,-1,4,-20,-22,73,-2,1,-24,-21,71,-4,0,-24,-10,71,-1,-4,-22,-7,70,1,-2,-19,-5,69,1,3,-18,-4,65,-2,2,-17,7,57,1,5,-11,6,57,1,6,-11,3,57,3,6,-12,10,55,3,3,-10,0,65,1,4,-15,-2,65,1,7,-15,-1,64,0,5,-15,2,60,2,6,-13,8,43,2,1,-8,-6,47,-1,3,-13,-4,40,1,6,-9,4,31,0,0,-7,7,27,1,3,-4,3,24,1,4,-4,3,23,3,7,-2,8,17,2,6,0),dim=c(5,50),dimnames=list(c('economical','unemployement','financial','capacity','indicator'),1:50))
> y <- array(NA,dim=c(5,50),dimnames=list(c('economical','unemployement','financial','capacity','indicator'),1:50))
> 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 = '5'
> #'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
indicator economical unemployement financial capacity
1 2 3 11 6 12
2 1 2 12 6 7
3 -8 -7 39 4 11
4 -1 -1 19 6 9
5 1 0 14 5 13
6 -1 -3 15 4 12
7 2 4 7 5 5
8 2 2 12 5 13
9 1 3 12 4 11
10 -1 0 14 3 8
11 -2 -10 9 2 8
12 -2 -10 8 3 8
13 -1 -9 4 2 8
14 -8 -22 7 -1 0
15 -4 -16 3 0 3
16 -6 -18 5 -2 0
17 -3 -14 0 1 -1
18 -3 -12 -2 -4 -1
19 -7 -17 6 -2 -4
20 -9 -23 11 -2 1
21 -11 -28 9 -6 -1
22 -13 -31 17 -4 0
23 -11 -21 21 -2 -1
24 -9 -19 21 0 6
25 -17 -22 41 -5 0
26 -22 -22 57 -4 -3
27 -25 -25 65 -5 -3
28 -20 -16 68 -1 4
29 -24 -22 73 -2 1
30 -24 -21 71 -4 0
31 -22 -10 71 -1 -4
32 -19 -7 70 1 -2
33 -18 -5 69 1 3
34 -17 -4 65 -2 2
35 -11 7 57 1 5
36 -11 6 57 1 6
37 -12 3 57 3 6
38 -10 10 55 3 3
39 -15 0 65 1 4
40 -15 -2 65 1 7
41 -15 -1 64 0 5
42 -13 2 60 2 6
43 -8 8 43 2 1
44 -13 -6 47 -1 3
45 -9 -4 40 1 6
46 -7 4 31 0 0
47 -4 7 27 1 3
48 -4 3 24 1 4
49 -2 3 23 3 7
50 0 8 17 2 6
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) economical unemployement financial capacity
0.2699 0.2590 -0.2549 0.2380 0.2251
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.5847 -0.2525 0.0402 0.2067 0.5945
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.269947 0.130103 2.075 0.0437 *
economical 0.258970 0.006928 37.381 < 2e-16 ***
unemployement -0.254850 0.002067 -123.321 < 2e-16 ***
financial 0.237995 0.034249 6.949 1.21e-08 ***
capacity 0.225051 0.017251 13.046 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.3206 on 45 degrees of freedom
Multiple R-squared: 0.9984, Adjusted R-squared: 0.9983
F-statistic: 7214 on 4 and 45 DF, p-value: < 2.2e-16
> 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.6449226 0.71015483 0.355077415
[2,] 0.5450984 0.90980312 0.454901560
[3,] 0.4005639 0.80112788 0.599436059
[4,] 0.3027665 0.60553290 0.697233548
[5,] 0.3975018 0.79500359 0.602498206
[6,] 0.3107905 0.62158099 0.689209506
[7,] 0.4225437 0.84508743 0.577456287
[8,] 0.3710042 0.74200847 0.628995763
[9,] 0.4106946 0.82138914 0.589305432
[10,] 0.3829730 0.76594609 0.617026954
[11,] 0.5237718 0.95245641 0.476228204
[12,] 0.4689888 0.93797750 0.531011250
[13,] 0.4091426 0.81828522 0.590857392
[14,] 0.3220645 0.64412905 0.677935473
[15,] 0.2595119 0.51902374 0.740488130
[16,] 0.2206239 0.44124787 0.779376066
[17,] 0.2518227 0.50364539 0.748177303
[18,] 0.1865155 0.37303101 0.813484494
[19,] 0.2498770 0.49975400 0.750123001
[20,] 0.2837942 0.56758843 0.716205785
[21,] 0.4371778 0.87435565 0.562822175
[22,] 0.3799750 0.75994992 0.620025039
[23,] 0.3021129 0.60422571 0.697887146
[24,] 0.4343009 0.86860188 0.565699060
[25,] 0.7807933 0.43841338 0.219206692
[26,] 0.7335736 0.53285270 0.266426351
[27,] 0.7586711 0.48265789 0.241328947
[28,] 0.6780225 0.64395498 0.321977488
[29,] 0.5858531 0.82829374 0.414146871
[30,] 0.8876758 0.22464847 0.112324233
[31,] 0.8306931 0.33861386 0.169306929
[32,] 0.8051882 0.38962355 0.194811773
[33,] 0.6978977 0.60420465 0.302102324
[34,] 0.9096721 0.18065570 0.090327852
[35,] 0.9937607 0.01247854 0.006239268
> postscript(file="/var/www/html/freestat/rcomp/tmp/1zau21292250961.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/2zau21292250961.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/3skbn1292250961.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/4skbn1292250961.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/5skbn1292250961.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 = 50
Frequency = 1
1 2 3 4 5
-0.3720932742 0.2669844589 0.0544541047 0.3777429921 0.1823110406
6 7 8 9 10
-0.3228820138 0.1628913710 0.1546705012 -0.4162016076 -0.2164414994
11 12 13 14 15
0.3370035362 -0.1558416395 -0.1962174430 -0.5506587735 -0.0370295136
16 17 18 19 20
0.1417555005 0.3426907420 0.5050251940 0.0378415561 -0.2593444661
21 22 23 24 25
-0.0721113802 0.0425588265 0.2213201079 -0.3479705222 0.0662272495
26 27 28 29 30
-0.4190104333 -0.3653037391 0.5411755195 0.2823964369 0.2147674791
31 32 33 34 35
-0.4476825615 0.5944640020 -0.3035838235 0.3570818623 0.0804699543
36 37 38 39 40
0.1143885540 -0.5846911654 -0.2320276889 0.1571135125 -0.0001007807
41 42 43 44 45
0.1741769332 -0.3231755427 -0.0841916486 -0.1753276361 0.3716364631
46 47 48 49 50
-0.4054719179 -0.1149323808 -0.0686540359 0.5253513122 0.1644462771
> postscript(file="/var/www/html/freestat/rcomp/tmp/63bbq1292250961.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 = 50
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.3720932742 NA
1 0.2669844589 -0.3720932742
2 0.0544541047 0.2669844589
3 0.3777429921 0.0544541047
4 0.1823110406 0.3777429921
5 -0.3228820138 0.1823110406
6 0.1628913710 -0.3228820138
7 0.1546705012 0.1628913710
8 -0.4162016076 0.1546705012
9 -0.2164414994 -0.4162016076
10 0.3370035362 -0.2164414994
11 -0.1558416395 0.3370035362
12 -0.1962174430 -0.1558416395
13 -0.5506587735 -0.1962174430
14 -0.0370295136 -0.5506587735
15 0.1417555005 -0.0370295136
16 0.3426907420 0.1417555005
17 0.5050251940 0.3426907420
18 0.0378415561 0.5050251940
19 -0.2593444661 0.0378415561
20 -0.0721113802 -0.2593444661
21 0.0425588265 -0.0721113802
22 0.2213201079 0.0425588265
23 -0.3479705222 0.2213201079
24 0.0662272495 -0.3479705222
25 -0.4190104333 0.0662272495
26 -0.3653037391 -0.4190104333
27 0.5411755195 -0.3653037391
28 0.2823964369 0.5411755195
29 0.2147674791 0.2823964369
30 -0.4476825615 0.2147674791
31 0.5944640020 -0.4476825615
32 -0.3035838235 0.5944640020
33 0.3570818623 -0.3035838235
34 0.0804699543 0.3570818623
35 0.1143885540 0.0804699543
36 -0.5846911654 0.1143885540
37 -0.2320276889 -0.5846911654
38 0.1571135125 -0.2320276889
39 -0.0001007807 0.1571135125
40 0.1741769332 -0.0001007807
41 -0.3231755427 0.1741769332
42 -0.0841916486 -0.3231755427
43 -0.1753276361 -0.0841916486
44 0.3716364631 -0.1753276361
45 -0.4054719179 0.3716364631
46 -0.1149323808 -0.4054719179
47 -0.0686540359 -0.1149323808
48 0.5253513122 -0.0686540359
49 0.1644462771 0.5253513122
50 NA 0.1644462771
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.2669844589 -0.3720932742
[2,] 0.0544541047 0.2669844589
[3,] 0.3777429921 0.0544541047
[4,] 0.1823110406 0.3777429921
[5,] -0.3228820138 0.1823110406
[6,] 0.1628913710 -0.3228820138
[7,] 0.1546705012 0.1628913710
[8,] -0.4162016076 0.1546705012
[9,] -0.2164414994 -0.4162016076
[10,] 0.3370035362 -0.2164414994
[11,] -0.1558416395 0.3370035362
[12,] -0.1962174430 -0.1558416395
[13,] -0.5506587735 -0.1962174430
[14,] -0.0370295136 -0.5506587735
[15,] 0.1417555005 -0.0370295136
[16,] 0.3426907420 0.1417555005
[17,] 0.5050251940 0.3426907420
[18,] 0.0378415561 0.5050251940
[19,] -0.2593444661 0.0378415561
[20,] -0.0721113802 -0.2593444661
[21,] 0.0425588265 -0.0721113802
[22,] 0.2213201079 0.0425588265
[23,] -0.3479705222 0.2213201079
[24,] 0.0662272495 -0.3479705222
[25,] -0.4190104333 0.0662272495
[26,] -0.3653037391 -0.4190104333
[27,] 0.5411755195 -0.3653037391
[28,] 0.2823964369 0.5411755195
[29,] 0.2147674791 0.2823964369
[30,] -0.4476825615 0.2147674791
[31,] 0.5944640020 -0.4476825615
[32,] -0.3035838235 0.5944640020
[33,] 0.3570818623 -0.3035838235
[34,] 0.0804699543 0.3570818623
[35,] 0.1143885540 0.0804699543
[36,] -0.5846911654 0.1143885540
[37,] -0.2320276889 -0.5846911654
[38,] 0.1571135125 -0.2320276889
[39,] -0.0001007807 0.1571135125
[40,] 0.1741769332 -0.0001007807
[41,] -0.3231755427 0.1741769332
[42,] -0.0841916486 -0.3231755427
[43,] -0.1753276361 -0.0841916486
[44,] 0.3716364631 -0.1753276361
[45,] -0.4054719179 0.3716364631
[46,] -0.1149323808 -0.4054719179
[47,] -0.0686540359 -0.1149323808
[48,] 0.5253513122 -0.0686540359
[49,] 0.1644462771 0.5253513122
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.2669844589 -0.3720932742
2 0.0544541047 0.2669844589
3 0.3777429921 0.0544541047
4 0.1823110406 0.3777429921
5 -0.3228820138 0.1823110406
6 0.1628913710 -0.3228820138
7 0.1546705012 0.1628913710
8 -0.4162016076 0.1546705012
9 -0.2164414994 -0.4162016076
10 0.3370035362 -0.2164414994
11 -0.1558416395 0.3370035362
12 -0.1962174430 -0.1558416395
13 -0.5506587735 -0.1962174430
14 -0.0370295136 -0.5506587735
15 0.1417555005 -0.0370295136
16 0.3426907420 0.1417555005
17 0.5050251940 0.3426907420
18 0.0378415561 0.5050251940
19 -0.2593444661 0.0378415561
20 -0.0721113802 -0.2593444661
21 0.0425588265 -0.0721113802
22 0.2213201079 0.0425588265
23 -0.3479705222 0.2213201079
24 0.0662272495 -0.3479705222
25 -0.4190104333 0.0662272495
26 -0.3653037391 -0.4190104333
27 0.5411755195 -0.3653037391
28 0.2823964369 0.5411755195
29 0.2147674791 0.2823964369
30 -0.4476825615 0.2147674791
31 0.5944640020 -0.4476825615
32 -0.3035838235 0.5944640020
33 0.3570818623 -0.3035838235
34 0.0804699543 0.3570818623
35 0.1143885540 0.0804699543
36 -0.5846911654 0.1143885540
37 -0.2320276889 -0.5846911654
38 0.1571135125 -0.2320276889
39 -0.0001007807 0.1571135125
40 0.1741769332 -0.0001007807
41 -0.3231755427 0.1741769332
42 -0.0841916486 -0.3231755427
43 -0.1753276361 -0.0841916486
44 0.3716364631 -0.1753276361
45 -0.4054719179 0.3716364631
46 -0.1149323808 -0.4054719179
47 -0.0686540359 -0.1149323808
48 0.5253513122 -0.0686540359
49 0.1644462771 0.5253513122
> 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/7ekab1292250961.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/8ekab1292250961.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/9ekab1292250961.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/106bre1292250961.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/11scq21292250961.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/12dd7q1292250961.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/13rm4h1292250961.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/14dn3n1292250961.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/15gn1s1292250961.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/161oiy1292250961.tab")
+ }
>
> try(system("convert tmp/1zau21292250961.ps tmp/1zau21292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zau21292250961.ps tmp/2zau21292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/3skbn1292250961.ps tmp/3skbn1292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/4skbn1292250961.ps tmp/4skbn1292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/5skbn1292250961.ps tmp/5skbn1292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/63bbq1292250961.ps tmp/63bbq1292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ekab1292250961.ps tmp/7ekab1292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ekab1292250961.ps tmp/8ekab1292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ekab1292250961.ps tmp/9ekab1292250961.png",intern=TRUE))
character(0)
> try(system("convert tmp/106bre1292250961.ps tmp/106bre1292250961.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.867 2.626 4.250