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(56.6,0,56,0,54.8,0,52.7,0,50.9,0,50.6,0,52.1,0,53.3,0,53.9,0,54.3,0,54.2,0,54.2,0,53.5,0,51.4,0,50.5,0,50.3,0,49.8,0,50.7,0,52.8,0,55.3,0,57.3,0,57.5,0,56.8,0,56.4,0,56.3,0,56.4,0,57,0,57.9,0,58.9,0,58.8,0,56.5,1,51.9,1,47.4,1,44.9,1,43.9,1,43.4,1,42.9,1,42.6,1,42.2,1,41.2,1,40.2,1,39.3,1,38.5,1,38.3,1,37.9,1,37.6,1,37.3,1,36,1,34.5,1,33.5,1,32.9,1,32.9,1,32.8,1,31.9,1,30.5,1,29.2,1,28.7,1,28.4,1,28,1,27.4,1,26.9,1),dim=c(2,61),dimnames=list(c('Y','X'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),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 = '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
Y X t
1 56.6 0 1
2 56.0 0 2
3 54.8 0 3
4 52.7 0 4
5 50.9 0 5
6 50.6 0 6
7 52.1 0 7
8 53.3 0 8
9 53.9 0 9
10 54.3 0 10
11 54.2 0 11
12 54.2 0 12
13 53.5 0 13
14 51.4 0 14
15 50.5 0 15
16 50.3 0 16
17 49.8 0 17
18 50.7 0 18
19 52.8 0 19
20 55.3 0 20
21 57.3 0 21
22 57.5 0 22
23 56.8 0 23
24 56.4 0 24
25 56.3 0 25
26 56.4 0 26
27 57.0 0 27
28 57.9 0 28
29 58.9 0 29
30 58.8 0 30
31 56.5 1 31
32 51.9 1 32
33 47.4 1 33
34 44.9 1 34
35 43.9 1 35
36 43.4 1 36
37 42.9 1 37
38 42.6 1 38
39 42.2 1 39
40 41.2 1 40
41 40.2 1 41
42 39.3 1 42
43 38.5 1 43
44 38.3 1 44
45 37.9 1 45
46 37.6 1 46
47 37.3 1 47
48 36.0 1 48
49 34.5 1 49
50 33.5 1 50
51 32.9 1 51
52 32.9 1 52
53 32.8 1 53
54 31.9 1 54
55 30.5 1 55
56 29.2 1 56
57 28.7 1 57
58 28.4 1 58
59 28.0 1 59
60 27.4 1 60
61 26.9 1 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X t
59.5264 -6.8269 -0.3325
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.964 -3.567 -1.337 2.669 14.107
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 59.52645 1.37404 43.322 < 2e-16 ***
X -6.82688 2.42614 -2.814 0.00667 **
t -0.33246 0.06889 -4.826 1.05e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.737 on 58 degrees of freedom
Multiple R-squared: 0.7906, Adjusted R-squared: 0.7833
F-statistic: 109.5 on 2 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.003770960 7.541920e-03 9.962290e-01
[2,] 0.013845222 2.769044e-02 9.861548e-01
[3,] 0.026198899 5.239780e-02 9.738011e-01
[4,] 0.028903627 5.780725e-02 9.710964e-01
[5,] 0.024932366 4.986473e-02 9.750676e-01
[6,] 0.016707954 3.341591e-02 9.832920e-01
[7,] 0.010108969 2.021794e-02 9.898910e-01
[8,] 0.005404604 1.080921e-02 9.945954e-01
[9,] 0.004349261 8.698521e-03 9.956507e-01
[10,] 0.005086737 1.017347e-02 9.949133e-01
[11,] 0.006840552 1.368110e-02 9.931594e-01
[12,] 0.014625540 2.925108e-02 9.853745e-01
[13,] 0.035139001 7.027800e-02 9.648610e-01
[14,] 0.107204951 2.144099e-01 8.927950e-01
[15,] 0.357239696 7.144794e-01 6.427603e-01
[16,] 0.688163865 6.236723e-01 3.118361e-01
[17,] 0.831571325 3.368573e-01 1.684287e-01
[18,] 0.882565816 2.348684e-01 1.174342e-01
[19,] 0.910361636 1.792767e-01 8.963836e-02
[20,] 0.929344680 1.413106e-01 7.065532e-02
[21,] 0.942952190 1.140956e-01 5.704781e-02
[22,] 0.948548397 1.029032e-01 5.145160e-02
[23,] 0.946641309 1.067174e-01 5.335869e-02
[24,] 0.940742134 1.185157e-01 5.925787e-02
[25,] 0.926111162 1.477777e-01 7.388884e-02
[26,] 0.999943847 1.123055e-04 5.615274e-05
[27,] 1.000000000 8.742340e-11 4.371170e-11
[28,] 1.000000000 1.285925e-12 6.429627e-13
[29,] 1.000000000 8.133609e-13 4.066805e-13
[30,] 1.000000000 5.581461e-13 2.790730e-13
[31,] 1.000000000 7.676431e-13 3.838215e-13
[32,] 1.000000000 1.667728e-12 8.338641e-13
[33,] 1.000000000 5.483217e-12 2.741609e-12
[34,] 1.000000000 1.582817e-11 7.914087e-12
[35,] 1.000000000 5.361213e-11 2.680606e-11
[36,] 1.000000000 1.652777e-10 8.263887e-11
[37,] 1.000000000 3.836948e-10 1.918474e-10
[38,] 1.000000000 6.204979e-10 3.102489e-10
[39,] 0.999999999 2.273943e-09 1.136971e-09
[40,] 0.999999995 1.041626e-08 5.208129e-09
[41,] 0.999999981 3.861074e-08 1.930537e-08
[42,] 0.999999981 3.762885e-08 1.881443e-08
[43,] 0.999999953 9.335117e-08 4.667558e-08
[44,] 0.999999730 5.391723e-07 2.695862e-07
[45,] 0.999998899 2.201310e-06 1.100655e-06
[46,] 0.999995943 8.113612e-06 4.056806e-06
[47,] 0.999971270 5.745952e-05 2.872976e-05
[48,] 0.999920403 1.591943e-04 7.959715e-05
[49,] 0.999946717 1.065668e-04 5.328342e-05
[50,] 0.999981293 3.741346e-05 1.870673e-05
> postscript(file="/var/www/html/rcomp/tmp/10aco1258648514.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/27bjz1258648514.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/3k0dp1258648514.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/44npb1258648514.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/5jwfw1258648514.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
-2.59398907 -2.86153005 -3.72907104 -5.49661202 -6.96415301 -6.93169399
7 8 9 10 11 12
-5.09923497 -3.56677596 -2.63431694 -1.90185792 -1.66939891 -1.33693989
13 14 15 16 17 18
-1.70448087 -3.47202186 -4.03956284 -3.90710383 -4.07464481 -2.84218579
19 20 21 22 23 24
-0.40972678 2.42273224 4.75519126 5.28765027 4.92010929 4.85256831
25 26 27 28 29 30
5.08502732 5.51748634 6.44994536 7.68240437 9.01486339 9.24732240
31 32 33 34 35 36
14.10666314 9.83912216 5.67158117 3.50404019 2.83649921 2.66895822
37 38 39 40 41 42
2.50141724 2.53387626 2.46633527 1.79879429 1.13125331 0.56371232
43 44 45 46 47 48
0.09617134 0.22863035 0.16108937 0.19354839 0.22600740 -0.74153358
49 50 51 52 53 54
-1.90907456 -2.57661555 -2.84415653 -2.51169751 -2.27923850 -2.84677948
55 56 57 58 59 60
-3.91432047 -4.88186145 -5.04940243 -5.01694342 -5.08448440 -5.35202538
61
-5.51956637
> postscript(file="/var/www/html/rcomp/tmp/6jqp91258648514.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 -2.59398907 NA
1 -2.86153005 -2.59398907
2 -3.72907104 -2.86153005
3 -5.49661202 -3.72907104
4 -6.96415301 -5.49661202
5 -6.93169399 -6.96415301
6 -5.09923497 -6.93169399
7 -3.56677596 -5.09923497
8 -2.63431694 -3.56677596
9 -1.90185792 -2.63431694
10 -1.66939891 -1.90185792
11 -1.33693989 -1.66939891
12 -1.70448087 -1.33693989
13 -3.47202186 -1.70448087
14 -4.03956284 -3.47202186
15 -3.90710383 -4.03956284
16 -4.07464481 -3.90710383
17 -2.84218579 -4.07464481
18 -0.40972678 -2.84218579
19 2.42273224 -0.40972678
20 4.75519126 2.42273224
21 5.28765027 4.75519126
22 4.92010929 5.28765027
23 4.85256831 4.92010929
24 5.08502732 4.85256831
25 5.51748634 5.08502732
26 6.44994536 5.51748634
27 7.68240437 6.44994536
28 9.01486339 7.68240437
29 9.24732240 9.01486339
30 14.10666314 9.24732240
31 9.83912216 14.10666314
32 5.67158117 9.83912216
33 3.50404019 5.67158117
34 2.83649921 3.50404019
35 2.66895822 2.83649921
36 2.50141724 2.66895822
37 2.53387626 2.50141724
38 2.46633527 2.53387626
39 1.79879429 2.46633527
40 1.13125331 1.79879429
41 0.56371232 1.13125331
42 0.09617134 0.56371232
43 0.22863035 0.09617134
44 0.16108937 0.22863035
45 0.19354839 0.16108937
46 0.22600740 0.19354839
47 -0.74153358 0.22600740
48 -1.90907456 -0.74153358
49 -2.57661555 -1.90907456
50 -2.84415653 -2.57661555
51 -2.51169751 -2.84415653
52 -2.27923850 -2.51169751
53 -2.84677948 -2.27923850
54 -3.91432047 -2.84677948
55 -4.88186145 -3.91432047
56 -5.04940243 -4.88186145
57 -5.01694342 -5.04940243
58 -5.08448440 -5.01694342
59 -5.35202538 -5.08448440
60 -5.51956637 -5.35202538
61 NA -5.51956637
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.86153005 -2.59398907
[2,] -3.72907104 -2.86153005
[3,] -5.49661202 -3.72907104
[4,] -6.96415301 -5.49661202
[5,] -6.93169399 -6.96415301
[6,] -5.09923497 -6.93169399
[7,] -3.56677596 -5.09923497
[8,] -2.63431694 -3.56677596
[9,] -1.90185792 -2.63431694
[10,] -1.66939891 -1.90185792
[11,] -1.33693989 -1.66939891
[12,] -1.70448087 -1.33693989
[13,] -3.47202186 -1.70448087
[14,] -4.03956284 -3.47202186
[15,] -3.90710383 -4.03956284
[16,] -4.07464481 -3.90710383
[17,] -2.84218579 -4.07464481
[18,] -0.40972678 -2.84218579
[19,] 2.42273224 -0.40972678
[20,] 4.75519126 2.42273224
[21,] 5.28765027 4.75519126
[22,] 4.92010929 5.28765027
[23,] 4.85256831 4.92010929
[24,] 5.08502732 4.85256831
[25,] 5.51748634 5.08502732
[26,] 6.44994536 5.51748634
[27,] 7.68240437 6.44994536
[28,] 9.01486339 7.68240437
[29,] 9.24732240 9.01486339
[30,] 14.10666314 9.24732240
[31,] 9.83912216 14.10666314
[32,] 5.67158117 9.83912216
[33,] 3.50404019 5.67158117
[34,] 2.83649921 3.50404019
[35,] 2.66895822 2.83649921
[36,] 2.50141724 2.66895822
[37,] 2.53387626 2.50141724
[38,] 2.46633527 2.53387626
[39,] 1.79879429 2.46633527
[40,] 1.13125331 1.79879429
[41,] 0.56371232 1.13125331
[42,] 0.09617134 0.56371232
[43,] 0.22863035 0.09617134
[44,] 0.16108937 0.22863035
[45,] 0.19354839 0.16108937
[46,] 0.22600740 0.19354839
[47,] -0.74153358 0.22600740
[48,] -1.90907456 -0.74153358
[49,] -2.57661555 -1.90907456
[50,] -2.84415653 -2.57661555
[51,] -2.51169751 -2.84415653
[52,] -2.27923850 -2.51169751
[53,] -2.84677948 -2.27923850
[54,] -3.91432047 -2.84677948
[55,] -4.88186145 -3.91432047
[56,] -5.04940243 -4.88186145
[57,] -5.01694342 -5.04940243
[58,] -5.08448440 -5.01694342
[59,] -5.35202538 -5.08448440
[60,] -5.51956637 -5.35202538
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.86153005 -2.59398907
2 -3.72907104 -2.86153005
3 -5.49661202 -3.72907104
4 -6.96415301 -5.49661202
5 -6.93169399 -6.96415301
6 -5.09923497 -6.93169399
7 -3.56677596 -5.09923497
8 -2.63431694 -3.56677596
9 -1.90185792 -2.63431694
10 -1.66939891 -1.90185792
11 -1.33693989 -1.66939891
12 -1.70448087 -1.33693989
13 -3.47202186 -1.70448087
14 -4.03956284 -3.47202186
15 -3.90710383 -4.03956284
16 -4.07464481 -3.90710383
17 -2.84218579 -4.07464481
18 -0.40972678 -2.84218579
19 2.42273224 -0.40972678
20 4.75519126 2.42273224
21 5.28765027 4.75519126
22 4.92010929 5.28765027
23 4.85256831 4.92010929
24 5.08502732 4.85256831
25 5.51748634 5.08502732
26 6.44994536 5.51748634
27 7.68240437 6.44994536
28 9.01486339 7.68240437
29 9.24732240 9.01486339
30 14.10666314 9.24732240
31 9.83912216 14.10666314
32 5.67158117 9.83912216
33 3.50404019 5.67158117
34 2.83649921 3.50404019
35 2.66895822 2.83649921
36 2.50141724 2.66895822
37 2.53387626 2.50141724
38 2.46633527 2.53387626
39 1.79879429 2.46633527
40 1.13125331 1.79879429
41 0.56371232 1.13125331
42 0.09617134 0.56371232
43 0.22863035 0.09617134
44 0.16108937 0.22863035
45 0.19354839 0.16108937
46 0.22600740 0.19354839
47 -0.74153358 0.22600740
48 -1.90907456 -0.74153358
49 -2.57661555 -1.90907456
50 -2.84415653 -2.57661555
51 -2.51169751 -2.84415653
52 -2.27923850 -2.51169751
53 -2.84677948 -2.27923850
54 -3.91432047 -2.84677948
55 -4.88186145 -3.91432047
56 -5.04940243 -4.88186145
57 -5.01694342 -5.04940243
58 -5.08448440 -5.01694342
59 -5.35202538 -5.08448440
60 -5.51956637 -5.35202538
> 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/7rx2o1258648514.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/8tbum1258648514.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/9dky71258648514.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/10oj931258648514.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/11d6pm1258648514.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/12f4571258648514.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/136js61258648514.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/142v8a1258648514.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/15fbkd1258648514.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/16kim91258648514.tab")
+ }
>
> system("convert tmp/10aco1258648514.ps tmp/10aco1258648514.png")
> system("convert tmp/27bjz1258648514.ps tmp/27bjz1258648514.png")
> system("convert tmp/3k0dp1258648514.ps tmp/3k0dp1258648514.png")
> system("convert tmp/44npb1258648514.ps tmp/44npb1258648514.png")
> system("convert tmp/5jwfw1258648514.ps tmp/5jwfw1258648514.png")
> system("convert tmp/6jqp91258648514.ps tmp/6jqp91258648514.png")
> system("convert tmp/7rx2o1258648514.ps tmp/7rx2o1258648514.png")
> system("convert tmp/8tbum1258648514.ps tmp/8tbum1258648514.png")
> system("convert tmp/9dky71258648514.ps tmp/9dky71258648514.png")
> system("convert tmp/10oj931258648514.ps tmp/10oj931258648514.png")
>
>
> proc.time()
user system elapsed
2.457 1.551 2.816