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(96.8,9.3,114.1,9.3,110.3,8.7,103.9,8.2,101.6,8.3,94.6,8.5,95.9,8.6,104.7,8.5,102.8,8.2,98.1,8.1,113.9,7.9,80.9,8.6,95.7,8.7,113.2,8.7,105.9,8.5,108.8,8.4,102.3,8.5,99,8.7,100.7,8.7,115.5,8.6,100.7,8.5,109.9,8.3,114.6,8,85.4,8.2,100.5,8.1,114.8,8.1,116.5,8,112.9,7.9,102,7.9,106,8,105.3,8,118.8,7.9,106.1,8,109.3,7.7,117.2,7.2,92.5,7.5,104.2,7.3,112.5,7,122.4,7,113.3,7,100,7.2,110.7,7.3,112.8,7.1,109.8,6.8,117.3,6.4,109.1,6.1,115.9,6.5,96,7.7,99.8,7.9,116.8,7.5,115.7,6.9,99.4,6.6,94.3,6.9,91,7.7,93.2,8,103.1,8,94.1,7.7,91.8,7.3,102.7,7.4,82.6,8.1,89.1,8.3),dim=c(2,61),dimnames=list(c('tip','wrk'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('tip','wrk'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
tip wrk
1 96.8 9.3
2 114.1 9.3
3 110.3 8.7
4 103.9 8.2
5 101.6 8.3
6 94.6 8.5
7 95.9 8.6
8 104.7 8.5
9 102.8 8.2
10 98.1 8.1
11 113.9 7.9
12 80.9 8.6
13 95.7 8.7
14 113.2 8.7
15 105.9 8.5
16 108.8 8.4
17 102.3 8.5
18 99.0 8.7
19 100.7 8.7
20 115.5 8.6
21 100.7 8.5
22 109.9 8.3
23 114.6 8.0
24 85.4 8.2
25 100.5 8.1
26 114.8 8.1
27 116.5 8.0
28 112.9 7.9
29 102.0 7.9
30 106.0 8.0
31 105.3 8.0
32 118.8 7.9
33 106.1 8.0
34 109.3 7.7
35 117.2 7.2
36 92.5 7.5
37 104.2 7.3
38 112.5 7.0
39 122.4 7.0
40 113.3 7.0
41 100.0 7.2
42 110.7 7.3
43 112.8 7.1
44 109.8 6.8
45 117.3 6.4
46 109.1 6.1
47 115.9 6.5
48 96.0 7.7
49 99.8 7.9
50 116.8 7.5
51 115.7 6.9
52 99.4 6.6
53 94.3 6.9
54 91.0 7.7
55 93.2 8.0
56 103.1 8.0
57 94.1 7.7
58 91.8 7.3
59 102.7 7.4
60 82.6 8.1
61 89.1 8.3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) wrk
134.324 -3.802
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-20.9277 -5.5466 0.2930 7.1326 15.1346
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 134.324 13.454 9.984 2.73e-14 ***
wrk -3.802 1.703 -2.232 0.0294 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.293 on 59 degrees of freedom
Multiple R-squared: 0.07789, Adjusted R-squared: 0.06226
F-statistic: 4.983 on 1 and 59 DF, p-value: 0.0294
> 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.4463767 0.8927534 0.5536233
[2,] 0.4409304 0.8818608 0.5590696
[3,] 0.3690689 0.7381379 0.6309311
[4,] 0.2582198 0.5164396 0.7417802
[5,] 0.1664388 0.3328775 0.8335612
[6,] 0.1056388 0.2112777 0.8943612
[7,] 0.1835484 0.3670969 0.8164516
[8,] 0.5988736 0.8022528 0.4011264
[9,] 0.5323496 0.9353007 0.4676504
[10,] 0.5815182 0.8369636 0.4184818
[11,] 0.5055321 0.9889358 0.4944679
[12,] 0.4579951 0.9159903 0.5420049
[13,] 0.3721362 0.7442725 0.6278638
[14,] 0.3005190 0.6010379 0.6994810
[15,] 0.2315587 0.4631174 0.7684413
[16,] 0.3169582 0.6339163 0.6830418
[17,] 0.2504364 0.5008728 0.7495636
[18,] 0.2308769 0.4617538 0.7691231
[19,] 0.2577954 0.5155907 0.7422046
[20,] 0.4408280 0.8816560 0.5591720
[21,] 0.3698218 0.7396435 0.6301782
[22,] 0.4219037 0.8438073 0.5780963
[23,] 0.5038255 0.9923491 0.4961745
[24,] 0.5076628 0.9846743 0.4923372
[25,] 0.4435549 0.8871098 0.5564451
[26,] 0.3888242 0.7776484 0.6111758
[27,] 0.3358825 0.6717650 0.6641175
[28,] 0.5155298 0.9689405 0.4844702
[29,] 0.4910901 0.9821802 0.5089099
[30,] 0.4738757 0.9477514 0.5261243
[31,] 0.5016376 0.9967248 0.4983624
[32,] 0.5914819 0.8170362 0.4085181
[33,] 0.5243782 0.9512436 0.4756218
[34,] 0.4676882 0.9353765 0.5323118
[35,] 0.6098916 0.7802167 0.3901084
[36,] 0.5747110 0.8505781 0.4252890
[37,] 0.5426771 0.9146458 0.4573229
[38,] 0.5183182 0.9633635 0.4816818
[39,] 0.5021338 0.9957324 0.4978662
[40,] 0.4278517 0.8557035 0.5721483
[41,] 0.3913204 0.7826408 0.6086796
[42,] 0.3312250 0.6624499 0.6687750
[43,] 0.3015719 0.6031438 0.6984281
[44,] 0.2559147 0.5118294 0.7440853
[45,] 0.2080894 0.4161787 0.7919106
[46,] 0.5136489 0.9727023 0.4863511
[47,] 0.8044184 0.3911631 0.1955816
[48,] 0.7372766 0.5254469 0.2627234
[49,] 0.6916872 0.6166256 0.3083128
[50,] 0.6188685 0.7622631 0.3811315
[51,] 0.4882443 0.9764887 0.5117557
[52,] 0.6723572 0.6552856 0.3276428
> postscript(file="/var/www/html/rcomp/tmp/1ji001258645678.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/2pgr11258645678.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/320mj1258645678.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/4o96z1258645678.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/59nmw1258645678.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.1653880 15.1346120 9.0534344 0.7524532 -1.1673506 -7.4069581
7 8 9 10 11 12
-5.7267618 2.6930419 -0.3475468 -5.4277431 9.6118644 -20.7267618
13 14 15 16 17 18
-5.5465656 11.9534344 3.8930419 6.4128457 0.2930419 -2.2465656
19 20 21 22 23 24
-0.5465656 13.8732382 -1.3069581 7.1326494 10.6920607 -17.7475468
25 26 27 28 29 30
-3.0277431 11.2722569 12.5920607 8.6118644 -2.2881356 2.0920607
31 32 33 34 35 36
1.3920607 14.5118644 2.1920607 4.2514719 10.2504906 -13.3089206
37 38 39 40 41 42
-2.3693131 4.7900981 14.6900981 5.5900981 -6.9495094 4.1306869
43 44 45 46 47 48
5.4702944 1.3297056 7.3089206 -2.0316682 6.2891169 -9.0485281
49 50 51 52 53 54
-4.4881356 10.9910794 7.6099019 -9.8306869 -13.7900981 -14.0485281
55 56 57 58 59 60
-10.7079393 -0.8079393 -10.9485281 -14.7693131 -3.4891169 -20.9277431
61
-13.6673506
> postscript(file="/var/www/html/rcomp/tmp/64l081258645678.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.1653880 NA
1 15.1346120 -2.1653880
2 9.0534344 15.1346120
3 0.7524532 9.0534344
4 -1.1673506 0.7524532
5 -7.4069581 -1.1673506
6 -5.7267618 -7.4069581
7 2.6930419 -5.7267618
8 -0.3475468 2.6930419
9 -5.4277431 -0.3475468
10 9.6118644 -5.4277431
11 -20.7267618 9.6118644
12 -5.5465656 -20.7267618
13 11.9534344 -5.5465656
14 3.8930419 11.9534344
15 6.4128457 3.8930419
16 0.2930419 6.4128457
17 -2.2465656 0.2930419
18 -0.5465656 -2.2465656
19 13.8732382 -0.5465656
20 -1.3069581 13.8732382
21 7.1326494 -1.3069581
22 10.6920607 7.1326494
23 -17.7475468 10.6920607
24 -3.0277431 -17.7475468
25 11.2722569 -3.0277431
26 12.5920607 11.2722569
27 8.6118644 12.5920607
28 -2.2881356 8.6118644
29 2.0920607 -2.2881356
30 1.3920607 2.0920607
31 14.5118644 1.3920607
32 2.1920607 14.5118644
33 4.2514719 2.1920607
34 10.2504906 4.2514719
35 -13.3089206 10.2504906
36 -2.3693131 -13.3089206
37 4.7900981 -2.3693131
38 14.6900981 4.7900981
39 5.5900981 14.6900981
40 -6.9495094 5.5900981
41 4.1306869 -6.9495094
42 5.4702944 4.1306869
43 1.3297056 5.4702944
44 7.3089206 1.3297056
45 -2.0316682 7.3089206
46 6.2891169 -2.0316682
47 -9.0485281 6.2891169
48 -4.4881356 -9.0485281
49 10.9910794 -4.4881356
50 7.6099019 10.9910794
51 -9.8306869 7.6099019
52 -13.7900981 -9.8306869
53 -14.0485281 -13.7900981
54 -10.7079393 -14.0485281
55 -0.8079393 -10.7079393
56 -10.9485281 -0.8079393
57 -14.7693131 -10.9485281
58 -3.4891169 -14.7693131
59 -20.9277431 -3.4891169
60 -13.6673506 -20.9277431
61 NA -13.6673506
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 15.1346120 -2.1653880
[2,] 9.0534344 15.1346120
[3,] 0.7524532 9.0534344
[4,] -1.1673506 0.7524532
[5,] -7.4069581 -1.1673506
[6,] -5.7267618 -7.4069581
[7,] 2.6930419 -5.7267618
[8,] -0.3475468 2.6930419
[9,] -5.4277431 -0.3475468
[10,] 9.6118644 -5.4277431
[11,] -20.7267618 9.6118644
[12,] -5.5465656 -20.7267618
[13,] 11.9534344 -5.5465656
[14,] 3.8930419 11.9534344
[15,] 6.4128457 3.8930419
[16,] 0.2930419 6.4128457
[17,] -2.2465656 0.2930419
[18,] -0.5465656 -2.2465656
[19,] 13.8732382 -0.5465656
[20,] -1.3069581 13.8732382
[21,] 7.1326494 -1.3069581
[22,] 10.6920607 7.1326494
[23,] -17.7475468 10.6920607
[24,] -3.0277431 -17.7475468
[25,] 11.2722569 -3.0277431
[26,] 12.5920607 11.2722569
[27,] 8.6118644 12.5920607
[28,] -2.2881356 8.6118644
[29,] 2.0920607 -2.2881356
[30,] 1.3920607 2.0920607
[31,] 14.5118644 1.3920607
[32,] 2.1920607 14.5118644
[33,] 4.2514719 2.1920607
[34,] 10.2504906 4.2514719
[35,] -13.3089206 10.2504906
[36,] -2.3693131 -13.3089206
[37,] 4.7900981 -2.3693131
[38,] 14.6900981 4.7900981
[39,] 5.5900981 14.6900981
[40,] -6.9495094 5.5900981
[41,] 4.1306869 -6.9495094
[42,] 5.4702944 4.1306869
[43,] 1.3297056 5.4702944
[44,] 7.3089206 1.3297056
[45,] -2.0316682 7.3089206
[46,] 6.2891169 -2.0316682
[47,] -9.0485281 6.2891169
[48,] -4.4881356 -9.0485281
[49,] 10.9910794 -4.4881356
[50,] 7.6099019 10.9910794
[51,] -9.8306869 7.6099019
[52,] -13.7900981 -9.8306869
[53,] -14.0485281 -13.7900981
[54,] -10.7079393 -14.0485281
[55,] -0.8079393 -10.7079393
[56,] -10.9485281 -0.8079393
[57,] -14.7693131 -10.9485281
[58,] -3.4891169 -14.7693131
[59,] -20.9277431 -3.4891169
[60,] -13.6673506 -20.9277431
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 15.1346120 -2.1653880
2 9.0534344 15.1346120
3 0.7524532 9.0534344
4 -1.1673506 0.7524532
5 -7.4069581 -1.1673506
6 -5.7267618 -7.4069581
7 2.6930419 -5.7267618
8 -0.3475468 2.6930419
9 -5.4277431 -0.3475468
10 9.6118644 -5.4277431
11 -20.7267618 9.6118644
12 -5.5465656 -20.7267618
13 11.9534344 -5.5465656
14 3.8930419 11.9534344
15 6.4128457 3.8930419
16 0.2930419 6.4128457
17 -2.2465656 0.2930419
18 -0.5465656 -2.2465656
19 13.8732382 -0.5465656
20 -1.3069581 13.8732382
21 7.1326494 -1.3069581
22 10.6920607 7.1326494
23 -17.7475468 10.6920607
24 -3.0277431 -17.7475468
25 11.2722569 -3.0277431
26 12.5920607 11.2722569
27 8.6118644 12.5920607
28 -2.2881356 8.6118644
29 2.0920607 -2.2881356
30 1.3920607 2.0920607
31 14.5118644 1.3920607
32 2.1920607 14.5118644
33 4.2514719 2.1920607
34 10.2504906 4.2514719
35 -13.3089206 10.2504906
36 -2.3693131 -13.3089206
37 4.7900981 -2.3693131
38 14.6900981 4.7900981
39 5.5900981 14.6900981
40 -6.9495094 5.5900981
41 4.1306869 -6.9495094
42 5.4702944 4.1306869
43 1.3297056 5.4702944
44 7.3089206 1.3297056
45 -2.0316682 7.3089206
46 6.2891169 -2.0316682
47 -9.0485281 6.2891169
48 -4.4881356 -9.0485281
49 10.9910794 -4.4881356
50 7.6099019 10.9910794
51 -9.8306869 7.6099019
52 -13.7900981 -9.8306869
53 -14.0485281 -13.7900981
54 -10.7079393 -14.0485281
55 -0.8079393 -10.7079393
56 -10.9485281 -0.8079393
57 -14.7693131 -10.9485281
58 -3.4891169 -14.7693131
59 -20.9277431 -3.4891169
60 -13.6673506 -20.9277431
> 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/7z69q1258645678.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/8zxkq1258645678.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/9w8791258645678.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/10759r1258645678.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/11hya91258645678.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/125tfi1258645678.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/134iql1258645678.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/14hllh1258645678.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/155qmo1258645678.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/16l29g1258645678.tab")
+ }
> system("convert tmp/1ji001258645678.ps tmp/1ji001258645678.png")
> system("convert tmp/2pgr11258645678.ps tmp/2pgr11258645678.png")
> system("convert tmp/320mj1258645678.ps tmp/320mj1258645678.png")
> system("convert tmp/4o96z1258645678.ps tmp/4o96z1258645678.png")
> system("convert tmp/59nmw1258645678.ps tmp/59nmw1258645678.png")
> system("convert tmp/64l081258645678.ps tmp/64l081258645678.png")
> system("convert tmp/7z69q1258645678.ps tmp/7z69q1258645678.png")
> system("convert tmp/8zxkq1258645678.ps tmp/8zxkq1258645678.png")
> system("convert tmp/9w8791258645678.ps tmp/9w8791258645678.png")
> system("convert tmp/10759r1258645678.ps tmp/10759r1258645678.png")
>
>
> proc.time()
user system elapsed
2.498 1.584 2.950