R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(162556
+ ,807
+ ,213118
+ ,6282154
+ ,29790
+ ,444
+ ,81767
+ ,4321023
+ ,87550
+ ,412
+ ,153198
+ ,4111912
+ ,84738
+ ,428
+ ,-26007
+ ,223193
+ ,54660
+ ,315
+ ,126942
+ ,1491348
+ ,42634
+ ,168
+ ,157214
+ ,1629616
+ ,40949
+ ,263
+ ,129352
+ ,1398893
+ ,45187
+ ,267
+ ,234817
+ ,1926517
+ ,37704
+ ,228
+ ,60448
+ ,983660
+ ,16275
+ ,129
+ ,47818
+ ,1443586
+ ,25830
+ ,104
+ ,245546
+ ,1073089
+ ,12679
+ ,122
+ ,48020
+ ,984885
+ ,18014
+ ,393
+ ,-1710
+ ,1405225
+ ,43556
+ ,190
+ ,32648
+ ,227132
+ ,24811
+ ,280
+ ,95350
+ ,929118
+ ,6575
+ ,63
+ ,151352
+ ,1071292
+ ,7123
+ ,102
+ ,288170
+ ,638830
+ ,21950
+ ,265
+ ,114337
+ ,856956
+ ,37597
+ ,234
+ ,37884
+ ,992426
+ ,17821
+ ,277
+ ,122844
+ ,444477
+ ,12988
+ ,73
+ ,82340
+ ,857217
+ ,22330
+ ,67
+ ,79801
+ ,711969
+ ,13326
+ ,103
+ ,165548
+ ,702380
+ ,16189
+ ,290
+ ,116384
+ ,358589
+ ,7146
+ ,83
+ ,134028
+ ,297978
+ ,15824
+ ,56
+ ,63838
+ ,585715
+ ,27664
+ ,236
+ ,74996
+ ,657954
+ ,11920
+ ,73
+ ,31080
+ ,209458
+ ,8568
+ ,34
+ ,32168
+ ,786690
+ ,14416
+ ,139
+ ,49857
+ ,439798
+ ,3369
+ ,26
+ ,87161
+ ,688779
+ ,11819
+ ,70
+ ,106113
+ ,574339
+ ,6984
+ ,40
+ ,80570
+ ,741409
+ ,4519
+ ,42
+ ,102129
+ ,597793
+ ,2220
+ ,12
+ ,301670
+ ,644190
+ ,18562
+ ,211
+ ,102313
+ ,377934
+ ,10327
+ ,74
+ ,88577
+ ,640273
+ ,5336
+ ,80
+ ,112477
+ ,697458
+ ,2365
+ ,83
+ ,191778
+ ,550608
+ ,4069
+ ,131
+ ,79804
+ ,207393
+ ,8636
+ ,203
+ ,128294
+ ,301607
+ ,13718
+ ,56
+ ,96448
+ ,345783
+ ,4525
+ ,89
+ ,93811
+ ,501749
+ ,6869
+ ,88
+ ,117520
+ ,379983
+ ,4628
+ ,39
+ ,69159
+ ,387475
+ ,3689
+ ,25
+ ,101792
+ ,377305
+ ,4891
+ ,49
+ ,210568
+ ,370837
+ ,7489
+ ,149
+ ,136996
+ ,430866
+ ,4901
+ ,58
+ ,121920
+ ,469107
+ ,2284
+ ,41
+ ,76403
+ ,194493)
+ ,dim=c(4
+ ,50)
+ ,dimnames=list(c('Costs'
+ ,'Orders'
+ ,'Dividends'
+ ,'Wealth')
+ ,1:50))
> y <- array(NA,dim=c(4,50),dimnames=list(c('Costs','Orders','Dividends','Wealth'),1:50))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '4'
> #'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
Wealth Costs Orders Dividends t
1 6282154 162556 807 213118 1
2 4321023 29790 444 81767 2
3 4111912 87550 412 153198 3
4 223193 84738 428 -26007 4
5 1491348 54660 315 126942 5
6 1629616 42634 168 157214 6
7 1398893 40949 263 129352 7
8 1926517 45187 267 234817 8
9 983660 37704 228 60448 9
10 1443586 16275 129 47818 10
11 1073089 25830 104 245546 11
12 984885 12679 122 48020 12
13 1405225 18014 393 -1710 13
14 227132 43556 190 32648 14
15 929118 24811 280 95350 15
16 1071292 6575 63 151352 16
17 638830 7123 102 288170 17
18 856956 21950 265 114337 18
19 992426 37597 234 37884 19
20 444477 17821 277 122844 20
21 857217 12988 73 82340 21
22 711969 22330 67 79801 22
23 702380 13326 103 165548 23
24 358589 16189 290 116384 24
25 297978 7146 83 134028 25
26 585715 15824 56 63838 26
27 657954 27664 236 74996 27
28 209458 11920 73 31080 28
29 786690 8568 34 32168 29
30 439798 14416 139 49857 30
31 688779 3369 26 87161 31
32 574339 11819 70 106113 32
33 741409 6984 40 80570 33
34 597793 4519 42 102129 34
35 644190 2220 12 301670 35
36 377934 18562 211 102313 36
37 640273 10327 74 88577 37
38 697458 5336 80 112477 38
39 550608 2365 83 191778 39
40 207393 4069 131 79804 40
41 301607 8636 203 128294 41
42 345783 13718 56 96448 42
43 501749 4525 89 93811 43
44 379983 6869 88 117520 44
45 387475 4628 39 69159 45
46 377305 3689 25 101792 46
47 370837 4891 49 210568 47
48 430866 7489 149 136996 48
49 469107 4901 58 121920 49
50 194493 2284 41 76403 50
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Costs Orders Dividends t
23546.998 13.972 2839.807 3.450 -9004.450
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2073970 -337998 -20895 318235 2356262
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 23546.998 380044.053 0.062 0.9509
Costs 13.972 6.977 2.002 0.0513 .
Orders 2839.807 1296.710 2.190 0.0337 *
Dividends 3.450 1.428 2.417 0.0198 *
t -9004.450 8948.122 -1.006 0.3197
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 665200 on 45 degrees of freedom
Multiple R-squared: 0.6713, Adjusted R-squared: 0.6421
F-statistic: 22.98 on 4 and 45 DF, p-value: 2.156e-10
> 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.9965074 6.985272e-03 3.492636e-03
[2,] 0.9999999 1.688485e-07 8.442425e-08
[3,] 1.0000000 7.564974e-11 3.782487e-11
[4,] 1.0000000 1.576491e-10 7.882454e-11
[5,] 1.0000000 1.849871e-10 9.249356e-11
[6,] 1.0000000 2.327197e-11 1.163598e-11
[7,] 1.0000000 1.144807e-12 5.724033e-13
[8,] 1.0000000 2.449573e-12 1.224787e-12
[9,] 1.0000000 8.528134e-13 4.264067e-13
[10,] 1.0000000 1.504420e-12 7.522101e-13
[11,] 1.0000000 2.921528e-12 1.460764e-12
[12,] 1.0000000 1.330233e-12 6.651163e-13
[13,] 1.0000000 5.053682e-12 2.526841e-12
[14,] 1.0000000 2.453362e-12 1.226681e-12
[15,] 1.0000000 6.094382e-12 3.047191e-12
[16,] 1.0000000 3.230594e-11 1.615297e-11
[17,] 1.0000000 1.291325e-10 6.456624e-11
[18,] 1.0000000 6.495391e-11 3.247696e-11
[19,] 1.0000000 1.900133e-10 9.500666e-11
[20,] 1.0000000 5.316564e-10 2.658282e-10
[21,] 1.0000000 2.640928e-11 1.320464e-11
[22,] 1.0000000 6.688917e-11 3.344459e-11
[23,] 1.0000000 2.953684e-10 1.476842e-10
[24,] 1.0000000 1.681130e-09 8.405652e-10
[25,] 1.0000000 1.021232e-08 5.106158e-09
[26,] 1.0000000 4.136056e-08 2.068028e-08
[27,] 0.9999999 2.667436e-07 1.333718e-07
[28,] 0.9999994 1.252206e-06 6.261028e-07
[29,] 0.9999965 7.007416e-06 3.503708e-06
[30,] 0.9999861 2.787260e-05 1.393630e-05
[31,] 0.9999851 2.971376e-05 1.485688e-05
[32,] 0.9999314 1.372520e-04 6.862600e-05
[33,] 0.9997409 5.182896e-04 2.591448e-04
[34,] 0.9994112 1.177530e-03 5.887649e-04
[35,] 0.9957147 8.570676e-03 4.285338e-03
> postscript(file="/var/www/html/freestat/rcomp/tmp/17f6r1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/27f6r1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/3i7nb1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/4i7nb1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/5i7nb1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 50
Frequency = 1
1 2 3 4 5 6
969355.612 2356261.974 1193556.632 -2073970.430 -583413.837 44882.014
7 8 9 10 11 12
-326939.803 -224783.184 -341683.448 751366.126 -354879.183 380097.851
13 14 15 16 17 18
136905.958 -931116.572 -430159.099 398813.590 -615135.182 -458251.159
19 20 21 22 23 24
-180561.105 -858462.769 349884.120 108916.640 -163964.813 -900158.843
25 26 27 28 29 30
-298458.922 195897.441 -437949.135 -43052.441 697015.491 -81793.046
31 32 33 34 35 36
522720.588 108880.081 525836.407 345597.406 -170190.212 -533019.328
37 38 39 40 41 42
289829.757 326247.513 -52230.913 -160200.428 -492568.592 16942.158
43 44 45 46 47 48
225739.435 1261.598 355085.857 294198.820 -163539.092 -160929.056
49 50
232916.400 209201.125
> postscript(file="/var/www/html/freestat/rcomp/tmp/6tynw1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 50
Frequency = 1
lag(myerror, k = 1) myerror
0 969355.612 NA
1 2356261.974 969355.612
2 1193556.632 2356261.974
3 -2073970.430 1193556.632
4 -583413.837 -2073970.430
5 44882.014 -583413.837
6 -326939.803 44882.014
7 -224783.184 -326939.803
8 -341683.448 -224783.184
9 751366.126 -341683.448
10 -354879.183 751366.126
11 380097.851 -354879.183
12 136905.958 380097.851
13 -931116.572 136905.958
14 -430159.099 -931116.572
15 398813.590 -430159.099
16 -615135.182 398813.590
17 -458251.159 -615135.182
18 -180561.105 -458251.159
19 -858462.769 -180561.105
20 349884.120 -858462.769
21 108916.640 349884.120
22 -163964.813 108916.640
23 -900158.843 -163964.813
24 -298458.922 -900158.843
25 195897.441 -298458.922
26 -437949.135 195897.441
27 -43052.441 -437949.135
28 697015.491 -43052.441
29 -81793.046 697015.491
30 522720.588 -81793.046
31 108880.081 522720.588
32 525836.407 108880.081
33 345597.406 525836.407
34 -170190.212 345597.406
35 -533019.328 -170190.212
36 289829.757 -533019.328
37 326247.513 289829.757
38 -52230.913 326247.513
39 -160200.428 -52230.913
40 -492568.592 -160200.428
41 16942.158 -492568.592
42 225739.435 16942.158
43 1261.598 225739.435
44 355085.857 1261.598
45 294198.820 355085.857
46 -163539.092 294198.820
47 -160929.056 -163539.092
48 232916.400 -160929.056
49 209201.125 232916.400
50 NA 209201.125
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2356261.974 969355.612
[2,] 1193556.632 2356261.974
[3,] -2073970.430 1193556.632
[4,] -583413.837 -2073970.430
[5,] 44882.014 -583413.837
[6,] -326939.803 44882.014
[7,] -224783.184 -326939.803
[8,] -341683.448 -224783.184
[9,] 751366.126 -341683.448
[10,] -354879.183 751366.126
[11,] 380097.851 -354879.183
[12,] 136905.958 380097.851
[13,] -931116.572 136905.958
[14,] -430159.099 -931116.572
[15,] 398813.590 -430159.099
[16,] -615135.182 398813.590
[17,] -458251.159 -615135.182
[18,] -180561.105 -458251.159
[19,] -858462.769 -180561.105
[20,] 349884.120 -858462.769
[21,] 108916.640 349884.120
[22,] -163964.813 108916.640
[23,] -900158.843 -163964.813
[24,] -298458.922 -900158.843
[25,] 195897.441 -298458.922
[26,] -437949.135 195897.441
[27,] -43052.441 -437949.135
[28,] 697015.491 -43052.441
[29,] -81793.046 697015.491
[30,] 522720.588 -81793.046
[31,] 108880.081 522720.588
[32,] 525836.407 108880.081
[33,] 345597.406 525836.407
[34,] -170190.212 345597.406
[35,] -533019.328 -170190.212
[36,] 289829.757 -533019.328
[37,] 326247.513 289829.757
[38,] -52230.913 326247.513
[39,] -160200.428 -52230.913
[40,] -492568.592 -160200.428
[41,] 16942.158 -492568.592
[42,] 225739.435 16942.158
[43,] 1261.598 225739.435
[44,] 355085.857 1261.598
[45,] 294198.820 355085.857
[46,] -163539.092 294198.820
[47,] -160929.056 -163539.092
[48,] 232916.400 -160929.056
[49,] 209201.125 232916.400
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2356261.974 969355.612
2 1193556.632 2356261.974
3 -2073970.430 1193556.632
4 -583413.837 -2073970.430
5 44882.014 -583413.837
6 -326939.803 44882.014
7 -224783.184 -326939.803
8 -341683.448 -224783.184
9 751366.126 -341683.448
10 -354879.183 751366.126
11 380097.851 -354879.183
12 136905.958 380097.851
13 -931116.572 136905.958
14 -430159.099 -931116.572
15 398813.590 -430159.099
16 -615135.182 398813.590
17 -458251.159 -615135.182
18 -180561.105 -458251.159
19 -858462.769 -180561.105
20 349884.120 -858462.769
21 108916.640 349884.120
22 -163964.813 108916.640
23 -900158.843 -163964.813
24 -298458.922 -900158.843
25 195897.441 -298458.922
26 -437949.135 195897.441
27 -43052.441 -437949.135
28 697015.491 -43052.441
29 -81793.046 697015.491
30 522720.588 -81793.046
31 108880.081 522720.588
32 525836.407 108880.081
33 345597.406 525836.407
34 -170190.212 345597.406
35 -533019.328 -170190.212
36 289829.757 -533019.328
37 326247.513 289829.757
38 -52230.913 326247.513
39 -160200.428 -52230.913
40 -492568.592 -160200.428
41 16942.158 -492568.592
42 225739.435 16942.158
43 1261.598 225739.435
44 355085.857 1261.598
45 294198.820 355085.857
46 -163539.092 294198.820
47 -160929.056 -163539.092
48 232916.400 -160929.056
49 209201.125 232916.400
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/7374z1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/8374z1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/9374z1291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/freestat/rcomp/tmp/10ey321291225661.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/freestat/rcomp/tmp/11zh181291225661.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/freestat/rcomp/tmp/12vr3r1291225662.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/freestat/rcomp/tmp/1391ii1291225662.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/freestat/rcomp/tmp/14d1z51291225662.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/freestat/rcomp/tmp/15y2fb1291225662.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/freestat/rcomp/tmp/16cuvk1291225662.tab")
+ }
>
> try(system("convert tmp/17f6r1291225661.ps tmp/17f6r1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/27f6r1291225661.ps tmp/27f6r1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/3i7nb1291225661.ps tmp/3i7nb1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/4i7nb1291225661.ps tmp/4i7nb1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/5i7nb1291225661.ps tmp/5i7nb1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/6tynw1291225661.ps tmp/6tynw1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/7374z1291225661.ps tmp/7374z1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/8374z1291225661.ps tmp/8374z1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/9374z1291225661.ps tmp/9374z1291225661.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ey321291225661.ps tmp/10ey321291225661.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.722 2.447 4.008