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(61.2,62,65.1,63.2,66.3,61.9,62.1,66.3,72,65.3,67.6,70.5,74.2,77.8,78.5,77.8,81.4,84.5,88,93.9,98.9,96.7,98.9,102.2,105.4,105.1,116.6,112,108.8,106.9,109.5,106.7,118.9,117.5,113.7,119.6,120.6,117.5,120.3,119.8,108,98.8,94.6,84.6,84.4,79.1,73.3,74.3,67.8,64.8,66.5,57.7,53.8,51.8,50.9,49,48.1,42.6,40.9,43.3,43.7),dim=c(1,61),dimnames=list(c('2JAAR'),1:61))
> y <- array(NA,dim=c(1,61),dimnames=list(c('2JAAR'),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 = 'Linear Trend'
> par2 = 'Include Monthly 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
2JAAR M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 61.2 1 0 0 0 0 0 0 0 0 0 0 1
2 62.0 0 1 0 0 0 0 0 0 0 0 0 2
3 65.1 0 0 1 0 0 0 0 0 0 0 0 3
4 63.2 0 0 0 1 0 0 0 0 0 0 0 4
5 66.3 0 0 0 0 1 0 0 0 0 0 0 5
6 61.9 0 0 0 0 0 1 0 0 0 0 0 6
7 62.1 0 0 0 0 0 0 1 0 0 0 0 7
8 66.3 0 0 0 0 0 0 0 1 0 0 0 8
9 72.0 0 0 0 0 0 0 0 0 1 0 0 9
10 65.3 0 0 0 0 0 0 0 0 0 1 0 10
11 67.6 0 0 0 0 0 0 0 0 0 0 1 11
12 70.5 0 0 0 0 0 0 0 0 0 0 0 12
13 74.2 1 0 0 0 0 0 0 0 0 0 0 13
14 77.8 0 1 0 0 0 0 0 0 0 0 0 14
15 78.5 0 0 1 0 0 0 0 0 0 0 0 15
16 77.8 0 0 0 1 0 0 0 0 0 0 0 16
17 81.4 0 0 0 0 1 0 0 0 0 0 0 17
18 84.5 0 0 0 0 0 1 0 0 0 0 0 18
19 88.0 0 0 0 0 0 0 1 0 0 0 0 19
20 93.9 0 0 0 0 0 0 0 1 0 0 0 20
21 98.9 0 0 0 0 0 0 0 0 1 0 0 21
22 96.7 0 0 0 0 0 0 0 0 0 1 0 22
23 98.9 0 0 0 0 0 0 0 0 0 0 1 23
24 102.2 0 0 0 0 0 0 0 0 0 0 0 24
25 105.4 1 0 0 0 0 0 0 0 0 0 0 25
26 105.1 0 1 0 0 0 0 0 0 0 0 0 26
27 116.6 0 0 1 0 0 0 0 0 0 0 0 27
28 112.0 0 0 0 1 0 0 0 0 0 0 0 28
29 108.8 0 0 0 0 1 0 0 0 0 0 0 29
30 106.9 0 0 0 0 0 1 0 0 0 0 0 30
31 109.5 0 0 0 0 0 0 1 0 0 0 0 31
32 106.7 0 0 0 0 0 0 0 1 0 0 0 32
33 118.9 0 0 0 0 0 0 0 0 1 0 0 33
34 117.5 0 0 0 0 0 0 0 0 0 1 0 34
35 113.7 0 0 0 0 0 0 0 0 0 0 1 35
36 119.6 0 0 0 0 0 0 0 0 0 0 0 36
37 120.6 1 0 0 0 0 0 0 0 0 0 0 37
38 117.5 0 1 0 0 0 0 0 0 0 0 0 38
39 120.3 0 0 1 0 0 0 0 0 0 0 0 39
40 119.8 0 0 0 1 0 0 0 0 0 0 0 40
41 108.0 0 0 0 0 1 0 0 0 0 0 0 41
42 98.8 0 0 0 0 0 1 0 0 0 0 0 42
43 94.6 0 0 0 0 0 0 1 0 0 0 0 43
44 84.6 0 0 0 0 0 0 0 1 0 0 0 44
45 84.4 0 0 0 0 0 0 0 0 1 0 0 45
46 79.1 0 0 0 0 0 0 0 0 0 1 0 46
47 73.3 0 0 0 0 0 0 0 0 0 0 1 47
48 74.3 0 0 0 0 0 0 0 0 0 0 0 48
49 67.8 1 0 0 0 0 0 0 0 0 0 0 49
50 64.8 0 1 0 0 0 0 0 0 0 0 0 50
51 66.5 0 0 1 0 0 0 0 0 0 0 0 51
52 57.7 0 0 0 1 0 0 0 0 0 0 0 52
53 53.8 0 0 0 0 1 0 0 0 0 0 0 53
54 51.8 0 0 0 0 0 1 0 0 0 0 0 54
55 50.9 0 0 0 0 0 0 1 0 0 0 0 55
56 49.0 0 0 0 0 0 0 0 1 0 0 0 56
57 48.1 0 0 0 0 0 0 0 0 1 0 0 57
58 42.6 0 0 0 0 0 0 0 0 0 1 0 58
59 40.9 0 0 0 0 0 0 0 0 0 0 1 59
60 43.3 0 0 0 0 0 0 0 0 0 0 0 60
61 43.7 1 0 0 0 0 0 0 0 0 0 0 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
88.4612 -4.0635 1.6597 5.7997 2.6797 0.4198
M6 M7 M8 M9 M10 M11
-2.2802 -1.8602 -2.6001 1.9399 -2.1001 -3.2800
t
-0.1800
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-34.36 -23.02 -4.42 25.14 42.86
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 88.4612 13.8544 6.385 6.45e-08 ***
M1 -4.0635 16.1574 -0.251 0.803
M2 1.6597 16.9590 0.098 0.922
M3 5.7997 16.9373 0.342 0.734
M4 2.6797 16.9179 0.158 0.875
M5 0.4198 16.9008 0.025 0.980
M6 -2.2802 16.8859 -0.135 0.893
M7 -1.8602 16.8733 -0.110 0.913
M8 -2.6001 16.8630 -0.154 0.878
M9 1.9399 16.8550 0.115 0.909
M10 -2.1001 16.8492 -0.125 0.901
M11 -3.2800 16.8458 -0.195 0.846
t -0.1800 0.1966 -0.916 0.364
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 26.63 on 48 degrees of freedom
Multiple R-squared: 0.03392, Adjusted R-squared: -0.2076
F-statistic: 0.1404 on 12 and 48 DF, p-value: 0.9996
> 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,] 1.291833e-04 2.583666e-04 0.99987082
[2,] 7.789205e-06 1.557841e-05 0.99999221
[3,] 1.604300e-04 3.208601e-04 0.99983957
[4,] 3.693981e-04 7.387962e-04 0.99963060
[5,] 4.547884e-04 9.095767e-04 0.99954521
[6,] 3.485166e-04 6.970331e-04 0.99965148
[7,] 5.923217e-04 1.184643e-03 0.99940768
[8,] 7.212245e-04 1.442449e-03 0.99927878
[9,] 1.021914e-03 2.043828e-03 0.99897809
[10,] 9.686584e-04 1.937317e-03 0.99903134
[11,] 1.050470e-03 2.100939e-03 0.99894953
[12,] 2.241315e-03 4.482629e-03 0.99775869
[13,] 3.754380e-03 7.508761e-03 0.99624562
[14,] 5.626112e-03 1.125222e-02 0.99437389
[15,] 1.027971e-02 2.055943e-02 0.98972029
[16,] 1.761594e-02 3.523187e-02 0.98238406
[17,] 5.901493e-02 1.180299e-01 0.94098507
[18,] 4.665578e-02 9.331156e-02 0.95334422
[19,] 3.084010e-02 6.168019e-02 0.96915990
[20,] 2.368697e-02 4.737394e-02 0.97631303
[21,] 1.356779e-02 2.713558e-02 0.98643221
[22,] 9.213007e-03 1.842601e-02 0.99078699
[23,] 1.397241e-02 2.794481e-02 0.98602759
[24,] 2.772071e-02 5.544141e-02 0.97227929
[25,] 1.800510e-01 3.601021e-01 0.81994896
[26,] 6.567403e-01 6.865195e-01 0.34325974
[27,] 9.057589e-01 1.884822e-01 0.09424110
[28,] 9.774343e-01 4.513140e-02 0.02256570
[29,] 9.761146e-01 4.777089e-02 0.02388544
[30,] 9.676385e-01 6.472301e-02 0.03236151
> postscript(file="/var/www/html/rcomp/tmp/1vdgk1293384952.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/rcomp/tmp/2vdgk1293384952.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/rcomp/tmp/364y51293384952.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/rcomp/tmp/464y51293384952.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/rcomp/tmp/564y51293384952.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 = 61
Frequency = 1
1 2 3 4 5 6 7
-23.017647 -27.760784 -28.620784 -27.220784 -21.680784 -23.200784 -23.240784
8 9 10 11 12 13 14
-18.120784 -16.780784 -19.260784 -15.600784 -15.800784 -7.857255 -9.800392
15 16 17 18 19 20 21
-13.060392 -10.460392 -4.420392 1.559608 4.819608 11.639608 12.279608
22 23 24 25 26 27 28
14.299608 17.859608 18.059608 25.503137 19.660000 27.200000 25.900000
29 30 31 32 33 34 35
25.140000 26.120000 28.480000 26.600000 34.440000 37.260000 34.820000
36 37 38 39 40 41 42
37.620000 42.863529 34.220392 33.060392 35.860392 26.500392 20.180392
43 44 45 46 47 48 49
15.740392 6.660392 2.100392 1.020392 -3.419608 -5.519608 -7.776078
50 51 52 53 54 55 56
-16.319216 -18.579216 -24.079216 -25.539216 -24.659216 -25.799216 -26.779216
57 58 59 60 61
-32.039216 -33.319216 -33.659216 -34.359216 -29.715686
> postscript(file="/var/www/html/rcomp/tmp/6zdxq1293384952.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -23.017647 NA
1 -27.760784 -23.017647
2 -28.620784 -27.760784
3 -27.220784 -28.620784
4 -21.680784 -27.220784
5 -23.200784 -21.680784
6 -23.240784 -23.200784
7 -18.120784 -23.240784
8 -16.780784 -18.120784
9 -19.260784 -16.780784
10 -15.600784 -19.260784
11 -15.800784 -15.600784
12 -7.857255 -15.800784
13 -9.800392 -7.857255
14 -13.060392 -9.800392
15 -10.460392 -13.060392
16 -4.420392 -10.460392
17 1.559608 -4.420392
18 4.819608 1.559608
19 11.639608 4.819608
20 12.279608 11.639608
21 14.299608 12.279608
22 17.859608 14.299608
23 18.059608 17.859608
24 25.503137 18.059608
25 19.660000 25.503137
26 27.200000 19.660000
27 25.900000 27.200000
28 25.140000 25.900000
29 26.120000 25.140000
30 28.480000 26.120000
31 26.600000 28.480000
32 34.440000 26.600000
33 37.260000 34.440000
34 34.820000 37.260000
35 37.620000 34.820000
36 42.863529 37.620000
37 34.220392 42.863529
38 33.060392 34.220392
39 35.860392 33.060392
40 26.500392 35.860392
41 20.180392 26.500392
42 15.740392 20.180392
43 6.660392 15.740392
44 2.100392 6.660392
45 1.020392 2.100392
46 -3.419608 1.020392
47 -5.519608 -3.419608
48 -7.776078 -5.519608
49 -16.319216 -7.776078
50 -18.579216 -16.319216
51 -24.079216 -18.579216
52 -25.539216 -24.079216
53 -24.659216 -25.539216
54 -25.799216 -24.659216
55 -26.779216 -25.799216
56 -32.039216 -26.779216
57 -33.319216 -32.039216
58 -33.659216 -33.319216
59 -34.359216 -33.659216
60 -29.715686 -34.359216
61 NA -29.715686
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -27.760784 -23.017647
[2,] -28.620784 -27.760784
[3,] -27.220784 -28.620784
[4,] -21.680784 -27.220784
[5,] -23.200784 -21.680784
[6,] -23.240784 -23.200784
[7,] -18.120784 -23.240784
[8,] -16.780784 -18.120784
[9,] -19.260784 -16.780784
[10,] -15.600784 -19.260784
[11,] -15.800784 -15.600784
[12,] -7.857255 -15.800784
[13,] -9.800392 -7.857255
[14,] -13.060392 -9.800392
[15,] -10.460392 -13.060392
[16,] -4.420392 -10.460392
[17,] 1.559608 -4.420392
[18,] 4.819608 1.559608
[19,] 11.639608 4.819608
[20,] 12.279608 11.639608
[21,] 14.299608 12.279608
[22,] 17.859608 14.299608
[23,] 18.059608 17.859608
[24,] 25.503137 18.059608
[25,] 19.660000 25.503137
[26,] 27.200000 19.660000
[27,] 25.900000 27.200000
[28,] 25.140000 25.900000
[29,] 26.120000 25.140000
[30,] 28.480000 26.120000
[31,] 26.600000 28.480000
[32,] 34.440000 26.600000
[33,] 37.260000 34.440000
[34,] 34.820000 37.260000
[35,] 37.620000 34.820000
[36,] 42.863529 37.620000
[37,] 34.220392 42.863529
[38,] 33.060392 34.220392
[39,] 35.860392 33.060392
[40,] 26.500392 35.860392
[41,] 20.180392 26.500392
[42,] 15.740392 20.180392
[43,] 6.660392 15.740392
[44,] 2.100392 6.660392
[45,] 1.020392 2.100392
[46,] -3.419608 1.020392
[47,] -5.519608 -3.419608
[48,] -7.776078 -5.519608
[49,] -16.319216 -7.776078
[50,] -18.579216 -16.319216
[51,] -24.079216 -18.579216
[52,] -25.539216 -24.079216
[53,] -24.659216 -25.539216
[54,] -25.799216 -24.659216
[55,] -26.779216 -25.799216
[56,] -32.039216 -26.779216
[57,] -33.319216 -32.039216
[58,] -33.659216 -33.319216
[59,] -34.359216 -33.659216
[60,] -29.715686 -34.359216
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -27.760784 -23.017647
2 -28.620784 -27.760784
3 -27.220784 -28.620784
4 -21.680784 -27.220784
5 -23.200784 -21.680784
6 -23.240784 -23.200784
7 -18.120784 -23.240784
8 -16.780784 -18.120784
9 -19.260784 -16.780784
10 -15.600784 -19.260784
11 -15.800784 -15.600784
12 -7.857255 -15.800784
13 -9.800392 -7.857255
14 -13.060392 -9.800392
15 -10.460392 -13.060392
16 -4.420392 -10.460392
17 1.559608 -4.420392
18 4.819608 1.559608
19 11.639608 4.819608
20 12.279608 11.639608
21 14.299608 12.279608
22 17.859608 14.299608
23 18.059608 17.859608
24 25.503137 18.059608
25 19.660000 25.503137
26 27.200000 19.660000
27 25.900000 27.200000
28 25.140000 25.900000
29 26.120000 25.140000
30 28.480000 26.120000
31 26.600000 28.480000
32 34.440000 26.600000
33 37.260000 34.440000
34 34.820000 37.260000
35 37.620000 34.820000
36 42.863529 37.620000
37 34.220392 42.863529
38 33.060392 34.220392
39 35.860392 33.060392
40 26.500392 35.860392
41 20.180392 26.500392
42 15.740392 20.180392
43 6.660392 15.740392
44 2.100392 6.660392
45 1.020392 2.100392
46 -3.419608 1.020392
47 -5.519608 -3.419608
48 -7.776078 -5.519608
49 -16.319216 -7.776078
50 -18.579216 -16.319216
51 -24.079216 -18.579216
52 -25.539216 -24.079216
53 -24.659216 -25.539216
54 -25.799216 -24.659216
55 -26.779216 -25.799216
56 -32.039216 -26.779216
57 -33.319216 -32.039216
58 -33.659216 -33.319216
59 -34.359216 -33.659216
60 -29.715686 -34.359216
> 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/7zdxq1293384952.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/rcomp/tmp/89nwt1293384952.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/rcomp/tmp/99nwt1293384952.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/rcomp/tmp/109nwt1293384952.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/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/11vnvz1293384952.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/12y6tn1293384952.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/13npqz1293384952.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/14gypj1293384952.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/151yop1293384952.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/16mz5d1293384952.tab")
+ }
> try(system("convert tmp/1vdgk1293384952.ps tmp/1vdgk1293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/2vdgk1293384952.ps tmp/2vdgk1293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/364y51293384952.ps tmp/364y51293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/464y51293384952.ps tmp/464y51293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/564y51293384952.ps tmp/564y51293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/6zdxq1293384952.ps tmp/6zdxq1293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/7zdxq1293384952.ps tmp/7zdxq1293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/89nwt1293384952.ps tmp/89nwt1293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/99nwt1293384952.ps tmp/99nwt1293384952.png",intern=TRUE))
character(0)
> try(system("convert tmp/109nwt1293384952.ps tmp/109nwt1293384952.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.447 1.642 6.042