R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(141,9.3,16,6,7,136,14.2,20,20,0,246,17.3,7,12,0,309,23,8,15,0,95,16.3,21,25,0,161,18.4,7,4,0,108,14.2,17,6,0,79,9.1,20,2,0,40,5.9,18,1,1,35,7.2,26,4,2,49,6.8,18,4,2,145,8,20,8,2,284,14.3,0,3,0,164,14.6,22,14,0,130,17.5,19,17,0,178,17.2,18,14,0,150,17.2,13,10,0,104,14.1,16,7,0,111,10.4,11,4,0,51,6.8,22,1,1,70,4.1,19,6,0,42,6.5,23,2,1,126,6.1,11,2,0,68,6.3,24,8,7,135,9.3,14,10,0,231,16.4,11,13,0,185,16.1,17,10,0,181,18,20,14,0,138,17.6,19,13,0,158,14,12,6,0,122,10.5,19,6,2,40,6.9,26,9,3,62,2.8,13,2,5,89,0.7,12,4,5,33,3.6,20,3,7,150,6.7,15,4,2,196,12.5,15,10,0,196,14.4,17,15,0,225,16.5,11,14,0,213,18.7,20,18,0,258,19.4,9,10,0,156,15.8,10,5,0,90,11.3,17,5,0,48,9.7,25,7,0,46,2.9,19,2,7,49,0.1,18,0,14,29,2.5,24,4,10,118,6.7,13,7,2,223,10.3,6,8,0,172,11.2,14,6,0,259,17.4,9,3,0,252,20.5,13,12,0,136,17,23,15,0,143,14.2,18,8,0,119,10.6,16,6,0,24,6.1,21,1,6),dim=c(5,56),dimnames=list(c('UrenZonneschijn','GemiddeldeTemperatuur','Neerslagdagen','Onweersdagen','Sneeuwdagen'),1:56))
> y <- array(NA,dim=c(5,56),dimnames=list(c('UrenZonneschijn','GemiddeldeTemperatuur','Neerslagdagen','Onweersdagen','Sneeuwdagen'),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 = 'Do not include Seasonal Dummies'
> par1 = '2'
> #'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
> 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
GemiddeldeTemperatuur UrenZonneschijn Neerslagdagen Onweersdagen Sneeuwdagen
1 9.3 141 16 6 7
2 14.2 136 20 20 0
3 17.3 246 7 12 0
4 23.0 309 8 15 0
5 16.3 95 21 25 0
6 18.4 161 7 4 0
7 14.2 108 17 6 0
8 9.1 79 20 2 0
9 5.9 40 18 1 1
10 7.2 35 26 4 2
11 6.8 49 18 4 2
12 8.0 145 20 8 2
13 14.3 284 0 3 0
14 14.6 164 22 14 0
15 17.5 130 19 17 0
16 17.2 178 18 14 0
17 17.2 150 13 10 0
18 14.1 104 16 7 0
19 10.4 111 11 4 0
20 6.8 51 22 1 1
21 4.1 70 19 6 0
22 6.5 42 23 2 1
23 6.1 126 11 2 0
24 6.3 68 24 8 7
25 9.3 135 14 10 0
26 16.4 231 11 13 0
27 16.1 185 17 10 0
28 18.0 181 20 14 0
29 17.6 138 19 13 0
30 14.0 158 12 6 0
31 10.5 122 19 6 2
32 6.9 40 26 9 3
33 2.8 62 13 2 5
34 0.7 89 12 4 5
35 3.6 33 20 3 7
36 6.7 150 15 4 2
37 12.5 196 15 10 0
38 14.4 196 17 15 0
39 16.5 225 11 14 0
40 18.7 213 20 18 0
41 19.4 258 9 10 0
42 15.8 156 10 5 0
43 11.3 90 17 5 0
44 9.7 48 25 7 0
45 2.9 46 19 2 7
46 0.1 49 18 0 14
47 2.5 29 24 4 10
48 6.7 118 13 7 2
49 10.3 223 6 8 0
50 11.2 172 14 6 0
51 17.4 259 9 3 0
52 20.5 252 13 12 0
53 17.0 136 23 15 0
54 14.2 143 18 8 0
55 10.6 119 16 6 0
56 6.1 24 21 1 6
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) UrenZonneschijn Neerslagdagen Onweersdagen
1.89334 0.04565 0.13933 0.26862
Sneeuwdagen
-0.57811
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.2478 -1.3684 0.2059 1.5924 7.1071
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.89334 2.66990 0.709 0.481464
UrenZonneschijn 0.04565 0.01002 4.557 3.26e-05 ***
Neerslagdagen 0.13933 0.11501 1.211 0.231313
Onweersdagen 0.26862 0.09646 2.785 0.007496 **
Sneeuwdagen -0.57811 0.14334 -4.033 0.000184 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.61 on 51 degrees of freedom
Multiple R-squared: 0.7991, Adjusted R-squared: 0.7833
F-statistic: 50.7 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.5735155 0.8529690 0.42648452
[2,] 0.6055665 0.7888669 0.39443347
[3,] 0.4963957 0.9927913 0.50360434
[4,] 0.4186710 0.8373420 0.58132900
[5,] 0.5138498 0.9723004 0.48615020
[6,] 0.7083112 0.5833775 0.29168877
[7,] 0.6301648 0.7396704 0.36983521
[8,] 0.6098263 0.7803474 0.39017372
[9,] 0.5401212 0.9197575 0.45987876
[10,] 0.5965552 0.8068896 0.40344479
[11,] 0.6169204 0.7661591 0.38307957
[12,] 0.6206551 0.7586899 0.37934493
[13,] 0.5342596 0.9314809 0.46574044
[14,] 0.8245688 0.3508624 0.17543121
[15,] 0.7724491 0.4551017 0.22755087
[16,] 0.8568569 0.2862862 0.14314309
[17,] 0.8061805 0.3876391 0.19381954
[18,] 0.8348265 0.3303470 0.16517348
[19,] 0.7838174 0.4323653 0.21618264
[20,] 0.7268695 0.5462609 0.27313045
[21,] 0.6773854 0.6452291 0.32261456
[22,] 0.7482678 0.5034644 0.25173218
[23,] 0.7201432 0.5597135 0.27985677
[24,] 0.6480986 0.7038028 0.35190140
[25,] 0.5879038 0.8241924 0.41209622
[26,] 0.5222007 0.9555986 0.47779930
[27,] 0.6377863 0.7244275 0.36221373
[28,] 0.5692766 0.8614468 0.43072339
[29,] 0.7405848 0.5188304 0.25941520
[30,] 0.7907740 0.4184520 0.20922598
[31,] 0.7864648 0.4270704 0.21353522
[32,] 0.7141420 0.5717160 0.28585800
[33,] 0.6325790 0.7348420 0.36742102
[34,] 0.5925640 0.8148720 0.40743602
[35,] 0.9230674 0.1538652 0.07693262
[36,] 0.9419805 0.1160391 0.05801954
[37,] 0.9219016 0.1561969 0.07809844
[38,] 0.8630512 0.2738976 0.13694881
[39,] 0.7954800 0.4090401 0.20452004
[40,] 0.9386223 0.1227554 0.06137768
[41,] 0.8561329 0.2877343 0.14386713
> postscript(file="/var/www/rcomp/tmp/16azh1292851429.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/rcomp/tmp/2tyrd1292851429.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/rcomp/tmp/3tyrd1292851429.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/rcomp/tmp/4tyrd1292851429.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/rcomp/tmp/5tyrd1292851429.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
1.17572542 -2.06074059 -0.02215675 1.85665778 0.42852450 7.10711708
7 8 9 10 11 12
3.39612360 0.27649883 -0.01774109 0.16816363 0.24365226 -4.29195529
13 14 15 16 17 18
-1.36404313 -1.60590090 2.45834640 0.91228747 3.96161238 3.34943313
19 20 21 22 23 24
0.83235934 -0.17720072 -5.24779421 -0.47428707 -3.61516554 -0.14360091
25 26 27 28 29 30
-3.39294993 -1.06331320 0.70653234 1.29668478 3.26761536 1.61020641
31 32 33 34 35 36
-0.06542278 -1.12507750 -1.38162208 -5.11210786 0.65457384 -4.04910844
37 38 39 40 41 42
-3.11697688 -2.83872172 -0.95802704 -0.53861820 1.78862079 4.04877719
43 44 45 46 47 48
1.58645785 0.25195515 -0.23094321 1.55542201 0.64558152 -3.11548791
49 50 51 52 53 54
-4.75838635 -2.10755563 1.62330253 2.06798775 1.66437891 1.12178088
55 56
-0.56671069 3.38523647
> postscript(file="/var/www/rcomp/tmp/64pqy1292851429.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 1.17572542 NA
1 -2.06074059 1.17572542
2 -0.02215675 -2.06074059
3 1.85665778 -0.02215675
4 0.42852450 1.85665778
5 7.10711708 0.42852450
6 3.39612360 7.10711708
7 0.27649883 3.39612360
8 -0.01774109 0.27649883
9 0.16816363 -0.01774109
10 0.24365226 0.16816363
11 -4.29195529 0.24365226
12 -1.36404313 -4.29195529
13 -1.60590090 -1.36404313
14 2.45834640 -1.60590090
15 0.91228747 2.45834640
16 3.96161238 0.91228747
17 3.34943313 3.96161238
18 0.83235934 3.34943313
19 -0.17720072 0.83235934
20 -5.24779421 -0.17720072
21 -0.47428707 -5.24779421
22 -3.61516554 -0.47428707
23 -0.14360091 -3.61516554
24 -3.39294993 -0.14360091
25 -1.06331320 -3.39294993
26 0.70653234 -1.06331320
27 1.29668478 0.70653234
28 3.26761536 1.29668478
29 1.61020641 3.26761536
30 -0.06542278 1.61020641
31 -1.12507750 -0.06542278
32 -1.38162208 -1.12507750
33 -5.11210786 -1.38162208
34 0.65457384 -5.11210786
35 -4.04910844 0.65457384
36 -3.11697688 -4.04910844
37 -2.83872172 -3.11697688
38 -0.95802704 -2.83872172
39 -0.53861820 -0.95802704
40 1.78862079 -0.53861820
41 4.04877719 1.78862079
42 1.58645785 4.04877719
43 0.25195515 1.58645785
44 -0.23094321 0.25195515
45 1.55542201 -0.23094321
46 0.64558152 1.55542201
47 -3.11548791 0.64558152
48 -4.75838635 -3.11548791
49 -2.10755563 -4.75838635
50 1.62330253 -2.10755563
51 2.06798775 1.62330253
52 1.66437891 2.06798775
53 1.12178088 1.66437891
54 -0.56671069 1.12178088
55 3.38523647 -0.56671069
56 NA 3.38523647
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.06074059 1.17572542
[2,] -0.02215675 -2.06074059
[3,] 1.85665778 -0.02215675
[4,] 0.42852450 1.85665778
[5,] 7.10711708 0.42852450
[6,] 3.39612360 7.10711708
[7,] 0.27649883 3.39612360
[8,] -0.01774109 0.27649883
[9,] 0.16816363 -0.01774109
[10,] 0.24365226 0.16816363
[11,] -4.29195529 0.24365226
[12,] -1.36404313 -4.29195529
[13,] -1.60590090 -1.36404313
[14,] 2.45834640 -1.60590090
[15,] 0.91228747 2.45834640
[16,] 3.96161238 0.91228747
[17,] 3.34943313 3.96161238
[18,] 0.83235934 3.34943313
[19,] -0.17720072 0.83235934
[20,] -5.24779421 -0.17720072
[21,] -0.47428707 -5.24779421
[22,] -3.61516554 -0.47428707
[23,] -0.14360091 -3.61516554
[24,] -3.39294993 -0.14360091
[25,] -1.06331320 -3.39294993
[26,] 0.70653234 -1.06331320
[27,] 1.29668478 0.70653234
[28,] 3.26761536 1.29668478
[29,] 1.61020641 3.26761536
[30,] -0.06542278 1.61020641
[31,] -1.12507750 -0.06542278
[32,] -1.38162208 -1.12507750
[33,] -5.11210786 -1.38162208
[34,] 0.65457384 -5.11210786
[35,] -4.04910844 0.65457384
[36,] -3.11697688 -4.04910844
[37,] -2.83872172 -3.11697688
[38,] -0.95802704 -2.83872172
[39,] -0.53861820 -0.95802704
[40,] 1.78862079 -0.53861820
[41,] 4.04877719 1.78862079
[42,] 1.58645785 4.04877719
[43,] 0.25195515 1.58645785
[44,] -0.23094321 0.25195515
[45,] 1.55542201 -0.23094321
[46,] 0.64558152 1.55542201
[47,] -3.11548791 0.64558152
[48,] -4.75838635 -3.11548791
[49,] -2.10755563 -4.75838635
[50,] 1.62330253 -2.10755563
[51,] 2.06798775 1.62330253
[52,] 1.66437891 2.06798775
[53,] 1.12178088 1.66437891
[54,] -0.56671069 1.12178088
[55,] 3.38523647 -0.56671069
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.06074059 1.17572542
2 -0.02215675 -2.06074059
3 1.85665778 -0.02215675
4 0.42852450 1.85665778
5 7.10711708 0.42852450
6 3.39612360 7.10711708
7 0.27649883 3.39612360
8 -0.01774109 0.27649883
9 0.16816363 -0.01774109
10 0.24365226 0.16816363
11 -4.29195529 0.24365226
12 -1.36404313 -4.29195529
13 -1.60590090 -1.36404313
14 2.45834640 -1.60590090
15 0.91228747 2.45834640
16 3.96161238 0.91228747
17 3.34943313 3.96161238
18 0.83235934 3.34943313
19 -0.17720072 0.83235934
20 -5.24779421 -0.17720072
21 -0.47428707 -5.24779421
22 -3.61516554 -0.47428707
23 -0.14360091 -3.61516554
24 -3.39294993 -0.14360091
25 -1.06331320 -3.39294993
26 0.70653234 -1.06331320
27 1.29668478 0.70653234
28 3.26761536 1.29668478
29 1.61020641 3.26761536
30 -0.06542278 1.61020641
31 -1.12507750 -0.06542278
32 -1.38162208 -1.12507750
33 -5.11210786 -1.38162208
34 0.65457384 -5.11210786
35 -4.04910844 0.65457384
36 -3.11697688 -4.04910844
37 -2.83872172 -3.11697688
38 -0.95802704 -2.83872172
39 -0.53861820 -0.95802704
40 1.78862079 -0.53861820
41 4.04877719 1.78862079
42 1.58645785 4.04877719
43 0.25195515 1.58645785
44 -0.23094321 0.25195515
45 1.55542201 -0.23094321
46 0.64558152 1.55542201
47 -3.11548791 0.64558152
48 -4.75838635 -3.11548791
49 -2.10755563 -4.75838635
50 1.62330253 -2.10755563
51 2.06798775 1.62330253
52 1.66437891 2.06798775
53 1.12178088 1.66437891
54 -0.56671069 1.12178088
55 3.38523647 -0.56671069
> 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/rcomp/tmp/7fg811292851429.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/rcomp/tmp/8fg811292851429.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/rcomp/tmp/9fg811292851429.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/rcomp/tmp/10pqp41292851429.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/11tq6s1292851429.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/rcomp/tmp/12e94f1292851429.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/rcomp/tmp/13sik61292851429.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/rcomp/tmp/14ej0u1292851429.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/rcomp/tmp/15z1z01292851429.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/rcomp/tmp/16lkfo1292851429.tab")
+ }
>
> try(system("convert tmp/16azh1292851429.ps tmp/16azh1292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/2tyrd1292851429.ps tmp/2tyrd1292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/3tyrd1292851429.ps tmp/3tyrd1292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/4tyrd1292851429.ps tmp/4tyrd1292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/5tyrd1292851429.ps tmp/5tyrd1292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/64pqy1292851429.ps tmp/64pqy1292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/7fg811292851429.ps tmp/7fg811292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/8fg811292851429.ps tmp/8fg811292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/9fg811292851429.ps tmp/9fg811292851429.png",intern=TRUE))
character(0)
> try(system("convert tmp/10pqp41292851429.ps tmp/10pqp41292851429.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.140 1.590 4.715