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.
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(1846.5,1530.9,2796.3,2220.6,2895.6,2161.5,2472.2,1863.6,2584.4,1955.1,2630.4,1907.4,2663.1,1889.4,3176.2,2246.3,2856.7,2213,2551.4,1965,3088.7,2285.6,2628.3,1983.8,2226.2,1872.4,3023.6,2371.4,3077.9,2287,3084.1,2198.2,2990.3,2330.4,2949.6,2014.4,3014.7,2066.1,3517.7,2355.8,3121.2,2232.5,3067.4,2091.7,3174.6,2376.5,2676.3,1931.9,2424,2025.7,3195.1,2404.9,3146.6,2316.1,3506.7,2368.1,3528.5,2282.5,3365.1,2158.6,3153,2174.8,3843.3,2594.1,3123.2,2281.4,3361.1,2547.9,3481.9,2606.3,2970.5,2190.8,2537,2262.3,3257.6,2423.8,3301.3,2520.4,3391.6,2482.9,2933.6,2215.9,3283.2,2441.9,3139.7,2333.8,3486.4,2670.2,3202.2,2431,3294.4,2559.3,3550.3,2661.4,3279.3,2404.6,2678.6,2378.3,3451.4,2489.2,3977.1,2959,3814.8,2713.5,3310.5,2341.3,3971.8,2833.2,4051.9,2849.7,4057.6,2871.7,4391.4,3058.3,3628.9,2855.1,4092.2,3083.6,3822.5,2828.3),dim=c(2,60),dimnames=list(c('frankrijk','Nederland'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('frankrijk','Nederland'),1:60))
> 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
frankrijk Nederland
1 1846.5 1530.9
2 2796.3 2220.6
3 2895.6 2161.5
4 2472.2 1863.6
5 2584.4 1955.1
6 2630.4 1907.4
7 2663.1 1889.4
8 3176.2 2246.3
9 2856.7 2213.0
10 2551.4 1965.0
11 3088.7 2285.6
12 2628.3 1983.8
13 2226.2 1872.4
14 3023.6 2371.4
15 3077.9 2287.0
16 3084.1 2198.2
17 2990.3 2330.4
18 2949.6 2014.4
19 3014.7 2066.1
20 3517.7 2355.8
21 3121.2 2232.5
22 3067.4 2091.7
23 3174.6 2376.5
24 2676.3 1931.9
25 2424.0 2025.7
26 3195.1 2404.9
27 3146.6 2316.1
28 3506.7 2368.1
29 3528.5 2282.5
30 3365.1 2158.6
31 3153.0 2174.8
32 3843.3 2594.1
33 3123.2 2281.4
34 3361.1 2547.9
35 3481.9 2606.3
36 2970.5 2190.8
37 2537.0 2262.3
38 3257.6 2423.8
39 3301.3 2520.4
40 3391.6 2482.9
41 2933.6 2215.9
42 3283.2 2441.9
43 3139.7 2333.8
44 3486.4 2670.2
45 3202.2 2431.0
46 3294.4 2559.3
47 3550.3 2661.4
48 3279.3 2404.6
49 2678.6 2378.3
50 3451.4 2489.2
51 3977.1 2959.0
52 3814.8 2713.5
53 3310.5 2341.3
54 3971.8 2833.2
55 4051.9 2849.7
56 4057.6 2871.7
57 4391.4 3058.3
58 3628.9 2855.1
59 4092.2 3083.6
60 3822.5 2828.3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Nederland
-142.247 1.416
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-547.47 -100.18 -23.39 117.85 450.18
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -142.24733 189.24443 -0.752 0.455
Nederland 1.41627 0.07982 17.744 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 196.5 on 58 degrees of freedom
Multiple R-squared: 0.8444, Adjusted R-squared: 0.8418
F-statistic: 314.8 on 1 and 58 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.14632483 0.29264967 0.8536752
[2,] 0.14635565 0.29271130 0.8536443
[3,] 0.17003521 0.34007041 0.8299648
[4,] 0.14585747 0.29171494 0.8541425
[5,] 0.11736437 0.23472874 0.8826356
[6,] 0.07077270 0.14154541 0.9292273
[7,] 0.03782826 0.07565652 0.9621717
[8,] 0.01924242 0.03848483 0.9807576
[9,] 0.04168450 0.08336901 0.9583155
[10,] 0.04230701 0.08461402 0.9576930
[11,] 0.02454877 0.04909753 0.9754512
[12,] 0.02270301 0.04540602 0.9772970
[13,] 0.01915357 0.03830715 0.9808464
[14,] 0.04462258 0.08924517 0.9553774
[15,] 0.06911791 0.13823583 0.9308821
[16,] 0.14394909 0.28789818 0.8560509
[17,] 0.10986177 0.21972355 0.8901382
[18,] 0.13591781 0.27183562 0.8640822
[19,] 0.10222677 0.20445354 0.8977732
[20,] 0.07664060 0.15328120 0.9233594
[21,] 0.12922376 0.25844753 0.8707762
[22,] 0.09912732 0.19825463 0.9008727
[23,] 0.06902588 0.13805177 0.9309741
[24,] 0.09848875 0.19697750 0.9015112
[25,] 0.26980070 0.53960141 0.7301993
[26,] 0.59134322 0.81731355 0.4086568
[27,] 0.64501397 0.70997205 0.3549860
[28,] 0.73853702 0.52292595 0.2614630
[29,] 0.70048294 0.59903413 0.2995171
[30,] 0.67718912 0.64562176 0.3228109
[31,] 0.63116006 0.73767988 0.3688399
[32,] 0.59000110 0.81999780 0.4099989
[33,] 0.89182917 0.21634167 0.1081708
[34,] 0.85274403 0.29451194 0.1472560
[35,] 0.81867537 0.36264925 0.1813246
[36,] 0.76666619 0.46666762 0.2333338
[37,] 0.70359966 0.59280068 0.2964003
[38,] 0.63123642 0.73752715 0.3687636
[39,] 0.55970046 0.88059908 0.4402995
[40,] 0.51155724 0.97688551 0.4884428
[41,] 0.42890720 0.85781440 0.5710928
[42,] 0.38885896 0.77771792 0.6111410
[43,] 0.30808098 0.61616195 0.6919190
[44,] 0.23991995 0.47983990 0.7600800
[45,] 0.85383263 0.29233474 0.1461674
[46,] 0.78051142 0.43897717 0.2194886
[47,] 0.70196926 0.59606148 0.2980307
[48,] 0.59734420 0.80531159 0.4026558
[49,] 0.47805409 0.95610818 0.5219459
[50,] 0.36450182 0.72900365 0.6354982
[51,] 0.32347663 0.64695327 0.6765234
> postscript(file="/var/www/html/rcomp/tmp/1ltgv1227452243.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/28lxk1227452243.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/3wtza1227452243.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/4f0j11227452243.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/5zx3i1227452243.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 = 60
Frequency = 1
1 2 3 4 5 6
-179.424663 -206.427997 -23.426276 -24.918616 -42.307575 71.248637
7 8 9 10 11 12
129.441547 137.073792 -135.264324 -89.328675 -6.085728 -39.054604
13 14 15 16 17 18
-283.381816 -192.701932 -18.868510 113.096513 -167.934748 238.907449
19 20 21 22 23 24
230.786147 323.491923 101.618357 247.229564 -48.924923 82.449954
25 26 27 28 29 30
-302.696433 -68.647070 8.617953 295.071768 438.104718 450.180915
31 32 33 34 35 36
215.137296 311.594121 34.362618 -105.174077 -67.084407 9.976932
37 38 39 40 41 42
-524.786572 -32.914626 -126.026576 17.383653 -62.471515 -32.949163
43 44 45 46 47 48
-23.350076 -153.084238 -98.511790 -188.019587 -76.721037 15.977812
49 50 51 52 53 54
-547.474214 68.261135 -71.403816 113.991151 136.827879 101.463300
55 56 57 58 59 60
158.194799 132.736798 202.260297 -272.453074 -132.771404 -40.896964
> postscript(file="/var/www/html/rcomp/tmp/6ee8n1227452243.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -179.424663 NA
1 -206.427997 -179.424663
2 -23.426276 -206.427997
3 -24.918616 -23.426276
4 -42.307575 -24.918616
5 71.248637 -42.307575
6 129.441547 71.248637
7 137.073792 129.441547
8 -135.264324 137.073792
9 -89.328675 -135.264324
10 -6.085728 -89.328675
11 -39.054604 -6.085728
12 -283.381816 -39.054604
13 -192.701932 -283.381816
14 -18.868510 -192.701932
15 113.096513 -18.868510
16 -167.934748 113.096513
17 238.907449 -167.934748
18 230.786147 238.907449
19 323.491923 230.786147
20 101.618357 323.491923
21 247.229564 101.618357
22 -48.924923 247.229564
23 82.449954 -48.924923
24 -302.696433 82.449954
25 -68.647070 -302.696433
26 8.617953 -68.647070
27 295.071768 8.617953
28 438.104718 295.071768
29 450.180915 438.104718
30 215.137296 450.180915
31 311.594121 215.137296
32 34.362618 311.594121
33 -105.174077 34.362618
34 -67.084407 -105.174077
35 9.976932 -67.084407
36 -524.786572 9.976932
37 -32.914626 -524.786572
38 -126.026576 -32.914626
39 17.383653 -126.026576
40 -62.471515 17.383653
41 -32.949163 -62.471515
42 -23.350076 -32.949163
43 -153.084238 -23.350076
44 -98.511790 -153.084238
45 -188.019587 -98.511790
46 -76.721037 -188.019587
47 15.977812 -76.721037
48 -547.474214 15.977812
49 68.261135 -547.474214
50 -71.403816 68.261135
51 113.991151 -71.403816
52 136.827879 113.991151
53 101.463300 136.827879
54 158.194799 101.463300
55 132.736798 158.194799
56 202.260297 132.736798
57 -272.453074 202.260297
58 -132.771404 -272.453074
59 -40.896964 -132.771404
60 NA -40.896964
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -206.427997 -179.424663
[2,] -23.426276 -206.427997
[3,] -24.918616 -23.426276
[4,] -42.307575 -24.918616
[5,] 71.248637 -42.307575
[6,] 129.441547 71.248637
[7,] 137.073792 129.441547
[8,] -135.264324 137.073792
[9,] -89.328675 -135.264324
[10,] -6.085728 -89.328675
[11,] -39.054604 -6.085728
[12,] -283.381816 -39.054604
[13,] -192.701932 -283.381816
[14,] -18.868510 -192.701932
[15,] 113.096513 -18.868510
[16,] -167.934748 113.096513
[17,] 238.907449 -167.934748
[18,] 230.786147 238.907449
[19,] 323.491923 230.786147
[20,] 101.618357 323.491923
[21,] 247.229564 101.618357
[22,] -48.924923 247.229564
[23,] 82.449954 -48.924923
[24,] -302.696433 82.449954
[25,] -68.647070 -302.696433
[26,] 8.617953 -68.647070
[27,] 295.071768 8.617953
[28,] 438.104718 295.071768
[29,] 450.180915 438.104718
[30,] 215.137296 450.180915
[31,] 311.594121 215.137296
[32,] 34.362618 311.594121
[33,] -105.174077 34.362618
[34,] -67.084407 -105.174077
[35,] 9.976932 -67.084407
[36,] -524.786572 9.976932
[37,] -32.914626 -524.786572
[38,] -126.026576 -32.914626
[39,] 17.383653 -126.026576
[40,] -62.471515 17.383653
[41,] -32.949163 -62.471515
[42,] -23.350076 -32.949163
[43,] -153.084238 -23.350076
[44,] -98.511790 -153.084238
[45,] -188.019587 -98.511790
[46,] -76.721037 -188.019587
[47,] 15.977812 -76.721037
[48,] -547.474214 15.977812
[49,] 68.261135 -547.474214
[50,] -71.403816 68.261135
[51,] 113.991151 -71.403816
[52,] 136.827879 113.991151
[53,] 101.463300 136.827879
[54,] 158.194799 101.463300
[55,] 132.736798 158.194799
[56,] 202.260297 132.736798
[57,] -272.453074 202.260297
[58,] -132.771404 -272.453074
[59,] -40.896964 -132.771404
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -206.427997 -179.424663
2 -23.426276 -206.427997
3 -24.918616 -23.426276
4 -42.307575 -24.918616
5 71.248637 -42.307575
6 129.441547 71.248637
7 137.073792 129.441547
8 -135.264324 137.073792
9 -89.328675 -135.264324
10 -6.085728 -89.328675
11 -39.054604 -6.085728
12 -283.381816 -39.054604
13 -192.701932 -283.381816
14 -18.868510 -192.701932
15 113.096513 -18.868510
16 -167.934748 113.096513
17 238.907449 -167.934748
18 230.786147 238.907449
19 323.491923 230.786147
20 101.618357 323.491923
21 247.229564 101.618357
22 -48.924923 247.229564
23 82.449954 -48.924923
24 -302.696433 82.449954
25 -68.647070 -302.696433
26 8.617953 -68.647070
27 295.071768 8.617953
28 438.104718 295.071768
29 450.180915 438.104718
30 215.137296 450.180915
31 311.594121 215.137296
32 34.362618 311.594121
33 -105.174077 34.362618
34 -67.084407 -105.174077
35 9.976932 -67.084407
36 -524.786572 9.976932
37 -32.914626 -524.786572
38 -126.026576 -32.914626
39 17.383653 -126.026576
40 -62.471515 17.383653
41 -32.949163 -62.471515
42 -23.350076 -32.949163
43 -153.084238 -23.350076
44 -98.511790 -153.084238
45 -188.019587 -98.511790
46 -76.721037 -188.019587
47 15.977812 -76.721037
48 -547.474214 15.977812
49 68.261135 -547.474214
50 -71.403816 68.261135
51 113.991151 -71.403816
52 136.827879 113.991151
53 101.463300 136.827879
54 158.194799 101.463300
55 132.736798 158.194799
56 202.260297 132.736798
57 -272.453074 202.260297
58 -132.771404 -272.453074
59 -40.896964 -132.771404
> 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/7fdok1227452243.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/8ciuh1227452243.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/9fwmh1227452243.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/10blcg1227452243.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/11uo9n1227452244.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/12nxxj1227452244.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/13trf11227452244.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/145j4j1227452244.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/155tgz1227452244.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/1691v71227452244.tab")
+ }
>
> system("convert tmp/1ltgv1227452243.ps tmp/1ltgv1227452243.png")
> system("convert tmp/28lxk1227452243.ps tmp/28lxk1227452243.png")
> system("convert tmp/3wtza1227452243.ps tmp/3wtza1227452243.png")
> system("convert tmp/4f0j11227452243.ps tmp/4f0j11227452243.png")
> system("convert tmp/5zx3i1227452243.ps tmp/5zx3i1227452243.png")
> system("convert tmp/6ee8n1227452243.ps tmp/6ee8n1227452243.png")
> system("convert tmp/7fdok1227452243.ps tmp/7fdok1227452243.png")
> system("convert tmp/8ciuh1227452243.ps tmp/8ciuh1227452243.png")
> system("convert tmp/9fwmh1227452243.ps tmp/9fwmh1227452243.png")
> system("convert tmp/10blcg1227452243.ps tmp/10blcg1227452243.png")
>
>
> proc.time()
user system elapsed
2.480 1.581 3.086