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(81.71,84.86,87.703,85.03,90.09,85.61,100.639,85.52,83.042,86.51,89.956,86.66,89.561,87.27,105.38,87.62,86.554,88.17,93.131,87.99,92.812,88.83,102.195,88.75,88.925,88.81,94.184,89.43,94.196,89.5,108.932,89.34,91.134,89.75,97.149,90.26,96.415,90.32,112.432,90.76,92.47,91.53,98.61410515,92.35,97.80117197,93.04,111.8560178,93.35,95.63981455,93.54,104.1120262,95.07,104.0148224,95.39,118.1743476,95.43,102.033431,96.09,109.3138852,96.35,108.1523649,96.6,121.30381,96.62,103.8725146,97.6,112.7185207,97.67,109.0381253,98.23,122.4434864,98.29,106.6325686,98.89,113.8153852,99.88,111.1071252,100.42,130.039536,100.81,109.6121057,101.5,116.8592117,102.59,113.8982545,103.58,128.9375926,103.47,111.8120023,103.77,119.9689463,104.65,117.018539,105.12,132.4743387,104.97,116.3369106,105.58,124.6405636,106.17,121.025249,106.52,137.2054829,107.87,120.0187687,109.63,127.0443429,111.54,124.349043,112.47,143.6114438,111.63),dim=c(2,56),dimnames=list(c('LKI','CPI'),1:56))
> y <- array(NA,dim=c(2,56),dimnames=list(c('LKI','CPI'),1:56))
> 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 = 'Include Quarterly 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
LKI CPI Q1 Q2 Q3
1 81.71000 84.86 1 0 0
2 87.70300 85.03 0 1 0
3 90.09000 85.61 0 0 1
4 100.63900 85.52 0 0 0
5 83.04200 86.51 1 0 0
6 89.95600 86.66 0 1 0
7 89.56100 87.27 0 0 1
8 105.38000 87.62 0 0 0
9 86.55400 88.17 1 0 0
10 93.13100 87.99 0 1 0
11 92.81200 88.83 0 0 1
12 102.19500 88.75 0 0 0
13 88.92500 88.81 1 0 0
14 94.18400 89.43 0 1 0
15 94.19600 89.50 0 0 1
16 108.93200 89.34 0 0 0
17 91.13400 89.75 1 0 0
18 97.14900 90.26 0 1 0
19 96.41500 90.32 0 0 1
20 112.43200 90.76 0 0 0
21 92.47000 91.53 1 0 0
22 98.61411 92.35 0 1 0
23 97.80117 93.04 0 0 1
24 111.85602 93.35 0 0 0
25 95.63981 93.54 1 0 0
26 104.11203 95.07 0 1 0
27 104.01482 95.39 0 0 1
28 118.17435 95.43 0 0 0
29 102.03343 96.09 1 0 0
30 109.31389 96.35 0 1 0
31 108.15236 96.60 0 0 1
32 121.30381 96.62 0 0 0
33 103.87251 97.60 1 0 0
34 112.71852 97.67 0 1 0
35 109.03813 98.23 0 0 1
36 122.44349 98.29 0 0 0
37 106.63257 98.89 1 0 0
38 113.81539 99.88 0 1 0
39 111.10713 100.42 0 0 1
40 130.03954 100.81 0 0 0
41 109.61211 101.50 1 0 0
42 116.85921 102.59 0 1 0
43 113.89825 103.58 0 0 1
44 128.93759 103.47 0 0 0
45 111.81200 103.77 1 0 0
46 119.96895 104.65 0 1 0
47 117.01854 105.12 0 0 1
48 132.47434 104.97 0 0 0
49 116.33691 105.58 1 0 0
50 124.64056 106.17 0 1 0
51 121.02525 106.52 0 0 1
52 137.20548 107.87 0 0 0
53 120.01877 109.63 1 0 0
54 127.04434 111.54 0 1 0
55 124.34904 112.47 0 0 1
56 143.61144 111.63 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CPI Q1 Q2 Q3
-32.361 1.572 -18.373 -12.329 -14.553
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.49950 -1.27966 0.09944 1.15674 3.96339
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -32.3607 3.3309 -9.715 3.42e-13 ***
CPI 1.5716 0.0340 46.223 < 2e-16 ***
Q1 -18.3734 0.7424 -24.749 < 2e-16 ***
Q2 -12.3285 0.7414 -16.629 < 2e-16 ***
Q3 -14.5529 0.7411 -19.638 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.961 on 51 degrees of freedom
Multiple R-squared: 0.983, Adjusted R-squared: 0.9817
F-statistic: 738 on 4 and 51 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.30515761 0.6103152 0.6948424
[2,] 0.19171994 0.3834399 0.8082801
[3,] 0.12571789 0.2514358 0.8742821
[4,] 0.06668926 0.1333785 0.9333107
[5,] 0.31526428 0.6305286 0.6847357
[6,] 0.32706962 0.6541392 0.6729304
[7,] 0.26383883 0.5276777 0.7361612
[8,] 0.18293066 0.3658613 0.8170693
[9,] 0.28462790 0.5692558 0.7153721
[10,] 0.26438240 0.5287648 0.7356176
[11,] 0.21548722 0.4309744 0.7845128
[12,] 0.15626259 0.3125252 0.8437374
[13,] 0.20404578 0.4080916 0.7959542
[14,] 0.16858043 0.3371609 0.8314196
[15,] 0.20618636 0.4123727 0.7938136
[16,] 0.26587876 0.5317575 0.7341212
[17,] 0.43748297 0.8749659 0.5625170
[18,] 0.46517222 0.9303444 0.5348278
[19,] 0.55579563 0.8884087 0.4442044
[20,] 0.48420326 0.9684065 0.5157967
[21,] 0.52174881 0.9565024 0.4782512
[22,] 0.50803375 0.9839325 0.4919662
[23,] 0.54228933 0.9154213 0.4577107
[24,] 0.56184382 0.8763124 0.4381562
[25,] 0.52041482 0.9591704 0.4795852
[26,] 0.45426705 0.9085341 0.5457329
[27,] 0.50738349 0.9852330 0.4926165
[28,] 0.44753400 0.8950680 0.5524660
[29,] 0.48214936 0.9642987 0.5178506
[30,] 0.39421785 0.7884357 0.6057822
[31,] 0.31158927 0.6231785 0.6884107
[32,] 0.27962797 0.5592559 0.7203720
[33,] 0.33585173 0.6717035 0.6641483
[34,] 0.26016221 0.5203244 0.7398378
[35,] 0.20785601 0.4157120 0.7921440
[36,] 0.25980590 0.5196118 0.7401941
[37,] 0.38384153 0.7676831 0.6161585
[38,] 0.37011861 0.7402372 0.6298814
[39,] 0.29496637 0.5899327 0.7050336
[40,] 0.23535800 0.4707160 0.7646420
[41,] 0.43077421 0.8615484 0.5692258
> postscript(file="/var/www/html/rcomp/tmp/1qzu51293197354.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/2qzu51293197354.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/318t81293197354.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/418t81293197354.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/518t81293197354.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 = 56
Frequency = 1
1 2 3 4 5 6
-0.92514239 -1.24416036 2.45567410 -1.40678939 -2.18634606 -1.55293126
7 8 9 10 11 12
-0.68224596 0.03376957 -1.28326612 -0.46821059 0.11699784 -4.92718203
13 14 15 16 17 18
0.08188518 -1.67837016 0.44799999 0.88255120 0.81354491 -0.01783018
19 20 21 22 23 24
1.37825635 2.15082440 -0.64797178 -1.83744969 -1.51042865 -2.49570174
25 26 27 28 29 30
-0.63715080 -0.61438560 1.00987110 0.55361979 1.74878725 2.57577600
31 32 33 34 35 36
3.24573090 1.81283227 1.21469658 3.90584856 1.56972040 0.32787222
37 38 39 40 41 42
1.94733680 1.52939178 0.19683179 3.96339258 0.82489718 0.31407770
43 44 45 46 47 48
-1.97841685 -1.31910947 -0.54282582 0.18623681 -1.27845578 -0.13982126
49 50 51 52 53 54
1.13741663 2.46896345 0.52796019 0.03357103 -1.54586156 -3.56695648
55 56
-5.49949542 0.53017083
> postscript(file="/var/www/html/rcomp/tmp/6uzbt1293197354.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 = 56
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.92514239 NA
1 -1.24416036 -0.92514239
2 2.45567410 -1.24416036
3 -1.40678939 2.45567410
4 -2.18634606 -1.40678939
5 -1.55293126 -2.18634606
6 -0.68224596 -1.55293126
7 0.03376957 -0.68224596
8 -1.28326612 0.03376957
9 -0.46821059 -1.28326612
10 0.11699784 -0.46821059
11 -4.92718203 0.11699784
12 0.08188518 -4.92718203
13 -1.67837016 0.08188518
14 0.44799999 -1.67837016
15 0.88255120 0.44799999
16 0.81354491 0.88255120
17 -0.01783018 0.81354491
18 1.37825635 -0.01783018
19 2.15082440 1.37825635
20 -0.64797178 2.15082440
21 -1.83744969 -0.64797178
22 -1.51042865 -1.83744969
23 -2.49570174 -1.51042865
24 -0.63715080 -2.49570174
25 -0.61438560 -0.63715080
26 1.00987110 -0.61438560
27 0.55361979 1.00987110
28 1.74878725 0.55361979
29 2.57577600 1.74878725
30 3.24573090 2.57577600
31 1.81283227 3.24573090
32 1.21469658 1.81283227
33 3.90584856 1.21469658
34 1.56972040 3.90584856
35 0.32787222 1.56972040
36 1.94733680 0.32787222
37 1.52939178 1.94733680
38 0.19683179 1.52939178
39 3.96339258 0.19683179
40 0.82489718 3.96339258
41 0.31407770 0.82489718
42 -1.97841685 0.31407770
43 -1.31910947 -1.97841685
44 -0.54282582 -1.31910947
45 0.18623681 -0.54282582
46 -1.27845578 0.18623681
47 -0.13982126 -1.27845578
48 1.13741663 -0.13982126
49 2.46896345 1.13741663
50 0.52796019 2.46896345
51 0.03357103 0.52796019
52 -1.54586156 0.03357103
53 -3.56695648 -1.54586156
54 -5.49949542 -3.56695648
55 0.53017083 -5.49949542
56 NA 0.53017083
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.24416036 -0.92514239
[2,] 2.45567410 -1.24416036
[3,] -1.40678939 2.45567410
[4,] -2.18634606 -1.40678939
[5,] -1.55293126 -2.18634606
[6,] -0.68224596 -1.55293126
[7,] 0.03376957 -0.68224596
[8,] -1.28326612 0.03376957
[9,] -0.46821059 -1.28326612
[10,] 0.11699784 -0.46821059
[11,] -4.92718203 0.11699784
[12,] 0.08188518 -4.92718203
[13,] -1.67837016 0.08188518
[14,] 0.44799999 -1.67837016
[15,] 0.88255120 0.44799999
[16,] 0.81354491 0.88255120
[17,] -0.01783018 0.81354491
[18,] 1.37825635 -0.01783018
[19,] 2.15082440 1.37825635
[20,] -0.64797178 2.15082440
[21,] -1.83744969 -0.64797178
[22,] -1.51042865 -1.83744969
[23,] -2.49570174 -1.51042865
[24,] -0.63715080 -2.49570174
[25,] -0.61438560 -0.63715080
[26,] 1.00987110 -0.61438560
[27,] 0.55361979 1.00987110
[28,] 1.74878725 0.55361979
[29,] 2.57577600 1.74878725
[30,] 3.24573090 2.57577600
[31,] 1.81283227 3.24573090
[32,] 1.21469658 1.81283227
[33,] 3.90584856 1.21469658
[34,] 1.56972040 3.90584856
[35,] 0.32787222 1.56972040
[36,] 1.94733680 0.32787222
[37,] 1.52939178 1.94733680
[38,] 0.19683179 1.52939178
[39,] 3.96339258 0.19683179
[40,] 0.82489718 3.96339258
[41,] 0.31407770 0.82489718
[42,] -1.97841685 0.31407770
[43,] -1.31910947 -1.97841685
[44,] -0.54282582 -1.31910947
[45,] 0.18623681 -0.54282582
[46,] -1.27845578 0.18623681
[47,] -0.13982126 -1.27845578
[48,] 1.13741663 -0.13982126
[49,] 2.46896345 1.13741663
[50,] 0.52796019 2.46896345
[51,] 0.03357103 0.52796019
[52,] -1.54586156 0.03357103
[53,] -3.56695648 -1.54586156
[54,] -5.49949542 -3.56695648
[55,] 0.53017083 -5.49949542
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.24416036 -0.92514239
2 2.45567410 -1.24416036
3 -1.40678939 2.45567410
4 -2.18634606 -1.40678939
5 -1.55293126 -2.18634606
6 -0.68224596 -1.55293126
7 0.03376957 -0.68224596
8 -1.28326612 0.03376957
9 -0.46821059 -1.28326612
10 0.11699784 -0.46821059
11 -4.92718203 0.11699784
12 0.08188518 -4.92718203
13 -1.67837016 0.08188518
14 0.44799999 -1.67837016
15 0.88255120 0.44799999
16 0.81354491 0.88255120
17 -0.01783018 0.81354491
18 1.37825635 -0.01783018
19 2.15082440 1.37825635
20 -0.64797178 2.15082440
21 -1.83744969 -0.64797178
22 -1.51042865 -1.83744969
23 -2.49570174 -1.51042865
24 -0.63715080 -2.49570174
25 -0.61438560 -0.63715080
26 1.00987110 -0.61438560
27 0.55361979 1.00987110
28 1.74878725 0.55361979
29 2.57577600 1.74878725
30 3.24573090 2.57577600
31 1.81283227 3.24573090
32 1.21469658 1.81283227
33 3.90584856 1.21469658
34 1.56972040 3.90584856
35 0.32787222 1.56972040
36 1.94733680 0.32787222
37 1.52939178 1.94733680
38 0.19683179 1.52939178
39 3.96339258 0.19683179
40 0.82489718 3.96339258
41 0.31407770 0.82489718
42 -1.97841685 0.31407770
43 -1.31910947 -1.97841685
44 -0.54282582 -1.31910947
45 0.18623681 -0.54282582
46 -1.27845578 0.18623681
47 -0.13982126 -1.27845578
48 1.13741663 -0.13982126
49 2.46896345 1.13741663
50 0.52796019 2.46896345
51 0.03357103 0.52796019
52 -1.54586156 0.03357103
53 -3.56695648 -1.54586156
54 -5.49949542 -3.56695648
55 0.53017083 -5.49949542
> 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/7uzbt1293197354.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/8m9ae1293197354.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/9m9ae1293197354.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/10m9ae1293197354.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/11i07n1293197354.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/12ta781293197354.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/130b411293197354.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/14b2341293197354.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/15ek1a1293197354.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/16sczj1293197354.tab")
+ }
>
> try(system("convert tmp/1qzu51293197354.ps tmp/1qzu51293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/2qzu51293197354.ps tmp/2qzu51293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/318t81293197354.ps tmp/318t81293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/418t81293197354.ps tmp/418t81293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/518t81293197354.ps tmp/518t81293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/6uzbt1293197354.ps tmp/6uzbt1293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/7uzbt1293197354.ps tmp/7uzbt1293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/8m9ae1293197354.ps tmp/8m9ae1293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/9m9ae1293197354.ps tmp/9m9ae1293197354.png",intern=TRUE))
character(0)
> try(system("convert tmp/10m9ae1293197354.ps tmp/10m9ae1293197354.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.444 1.681 6.646