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.
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(1515,0,1510,0,1225,0,1577,0,1417,0,1224,0,1693,0,1633,0,1639,0,1914,0,1586,0,1552,0,2081,1,1500,0,1437,0,1470,0,1849,0,1387,0,1592,0,1589,0,1798,0,1935,0,1887,0,2027,1,2080,1,1556,0,1682,0,1785,0,1869,0,1781,0,2082,1,2570,1,1862,0,1936,0,1504,0,1765,0,1607,0,1577,0,1493,0,1615,0,1700,0,1335,0,1523,0,1623,0,1540,0,1637,0,1524,0,1419,0,1821,0,1593,0,1357,0,1263,0,1750,0,1405,0,1393,0,1639,0,1679,0,1551,0,1744,0,1429,0,1784,0),dim=c(2,61),dimnames=list(c('Gebouwen','Dummy'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Gebouwen','Dummy'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly 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
Gebouwen Dummy M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 1515 0 1 0 0 0 0 0 0 0 0 0 0 1
2 1510 0 0 1 0 0 0 0 0 0 0 0 0 2
3 1225 0 0 0 1 0 0 0 0 0 0 0 0 3
4 1577 0 0 0 0 1 0 0 0 0 0 0 0 4
5 1417 0 0 0 0 0 1 0 0 0 0 0 0 5
6 1224 0 0 0 0 0 0 1 0 0 0 0 0 6
7 1693 0 0 0 0 0 0 0 1 0 0 0 0 7
8 1633 0 0 0 0 0 0 0 0 1 0 0 0 8
9 1639 0 0 0 0 0 0 0 0 0 1 0 0 9
10 1914 0 0 0 0 0 0 0 0 0 0 1 0 10
11 1586 0 0 0 0 0 0 0 0 0 0 0 1 11
12 1552 0 0 0 0 0 0 0 0 0 0 0 0 12
13 2081 1 1 0 0 0 0 0 0 0 0 0 0 13
14 1500 0 0 1 0 0 0 0 0 0 0 0 0 14
15 1437 0 0 0 1 0 0 0 0 0 0 0 0 15
16 1470 0 0 0 0 1 0 0 0 0 0 0 0 16
17 1849 0 0 0 0 0 1 0 0 0 0 0 0 17
18 1387 0 0 0 0 0 0 1 0 0 0 0 0 18
19 1592 0 0 0 0 0 0 0 1 0 0 0 0 19
20 1589 0 0 0 0 0 0 0 0 1 0 0 0 20
21 1798 0 0 0 0 0 0 0 0 0 1 0 0 21
22 1935 0 0 0 0 0 0 0 0 0 0 1 0 22
23 1887 0 0 0 0 0 0 0 0 0 0 0 1 23
24 2027 1 0 0 0 0 0 0 0 0 0 0 0 24
25 2080 1 1 0 0 0 0 0 0 0 0 0 0 25
26 1556 0 0 1 0 0 0 0 0 0 0 0 0 26
27 1682 0 0 0 1 0 0 0 0 0 0 0 0 27
28 1785 0 0 0 0 1 0 0 0 0 0 0 0 28
29 1869 0 0 0 0 0 1 0 0 0 0 0 0 29
30 1781 0 0 0 0 0 0 1 0 0 0 0 0 30
31 2082 1 0 0 0 0 0 0 1 0 0 0 0 31
32 2570 1 0 0 0 0 0 0 0 1 0 0 0 32
33 1862 0 0 0 0 0 0 0 0 0 1 0 0 33
34 1936 0 0 0 0 0 0 0 0 0 0 1 0 34
35 1504 0 0 0 0 0 0 0 0 0 0 0 1 35
36 1765 0 0 0 0 0 0 0 0 0 0 0 0 36
37 1607 0 1 0 0 0 0 0 0 0 0 0 0 37
38 1577 0 0 1 0 0 0 0 0 0 0 0 0 38
39 1493 0 0 0 1 0 0 0 0 0 0 0 0 39
40 1615 0 0 0 0 1 0 0 0 0 0 0 0 40
41 1700 0 0 0 0 0 1 0 0 0 0 0 0 41
42 1335 0 0 0 0 0 0 1 0 0 0 0 0 42
43 1523 0 0 0 0 0 0 0 1 0 0 0 0 43
44 1623 0 0 0 0 0 0 0 0 1 0 0 0 44
45 1540 0 0 0 0 0 0 0 0 0 1 0 0 45
46 1637 0 0 0 0 0 0 0 0 0 0 1 0 46
47 1524 0 0 0 0 0 0 0 0 0 0 0 1 47
48 1419 0 0 0 0 0 0 0 0 0 0 0 0 48
49 1821 0 1 0 0 0 0 0 0 0 0 0 0 49
50 1593 0 0 1 0 0 0 0 0 0 0 0 0 50
51 1357 0 0 0 1 0 0 0 0 0 0 0 0 51
52 1263 0 0 0 0 1 0 0 0 0 0 0 0 52
53 1750 0 0 0 0 0 1 0 0 0 0 0 0 53
54 1405 0 0 0 0 0 0 1 0 0 0 0 0 54
55 1393 0 0 0 0 0 0 0 1 0 0 0 0 55
56 1639 0 0 0 0 0 0 0 0 1 0 0 0 56
57 1679 0 0 0 0 0 0 0 0 0 1 0 0 57
58 1551 0 0 0 0 0 0 0 0 0 0 1 0 58
59 1744 0 0 0 0 0 0 0 0 0 0 0 1 59
60 1429 0 0 0 0 0 0 0 0 0 0 0 0 60
61 1784 0 1 0 0 0 0 0 0 0 0 0 0 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy M1 M2 M3 M4
1527.70086 563.27944 100.89097 20.91235 -87.43330 15.82106
M5 M6 M7 M8 M9 M10
190.87541 -99.67024 17.92823 172.18258 177.69283 268.74718
M11 t
123.20153 -0.05435
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-301.30 -95.44 -20.29 96.30 354.60
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1527.70086 87.53848 17.452 < 2e-16 ***
Dummy 563.27944 84.85241 6.638 2.89e-08 ***
M1 100.89097 99.07236 1.018 0.3137
M2 20.91235 105.06891 0.199 0.8431
M3 -87.43330 104.90955 -0.833 0.4088
M4 15.82106 104.76391 0.151 0.8806
M5 190.87541 104.63207 1.824 0.0745 .
M6 -99.67024 104.51407 -0.954 0.3451
M7 17.92823 102.88443 0.174 0.8624
M8 172.18258 102.82038 1.675 0.1007
M9 177.69283 104.24356 1.705 0.0949 .
M10 268.74718 104.18135 2.580 0.0131 *
M11 123.20153 104.13316 1.183 0.2427
t -0.05435 1.20997 -0.045 0.9644
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 162.4 on 47 degrees of freedom
Multiple R-squared: 0.6401, Adjusted R-squared: 0.5406
F-statistic: 6.431 on 13 and 47 DF, p-value: 8.858e-07
> 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.6522108 0.6955785 0.34778924
[2,] 0.5137785 0.9724430 0.48622148
[3,] 0.4862591 0.9725182 0.51374090
[4,] 0.4688512 0.9377024 0.53114878
[5,] 0.3582352 0.7164704 0.64176482
[6,] 0.2574318 0.5148636 0.74256818
[7,] 0.2538377 0.5076753 0.74616233
[8,] 0.1864432 0.3728864 0.81355681
[9,] 0.2202096 0.4404193 0.77979037
[10,] 0.1778131 0.3556261 0.82218694
[11,] 0.1997760 0.3995521 0.80022395
[12,] 0.1821400 0.3642800 0.81785998
[13,] 0.1264726 0.2529451 0.87352744
[14,] 0.2698184 0.5396369 0.73018155
[15,] 0.2670700 0.5341400 0.73293001
[16,] 0.4133597 0.8267195 0.58664027
[17,] 0.3791468 0.7582936 0.62085320
[18,] 0.5104859 0.9790281 0.48951406
[19,] 0.6578058 0.6843884 0.34219419
[20,] 0.8059024 0.3881953 0.19409764
[21,] 0.8397220 0.3205561 0.16027804
[22,] 0.7728006 0.4543987 0.22719936
[23,] 0.7193085 0.5613830 0.28069150
[24,] 0.9380917 0.1238166 0.06190832
[25,] 0.8895341 0.2209318 0.11046590
[26,] 0.8329281 0.3341437 0.16707187
[27,] 0.8283527 0.3432945 0.17164726
[28,] 0.7009151 0.5981698 0.29908489
> postscript(file="/var/www/html/rcomp/tmp/1if921227463851.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/2hsy91227463851.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/3v4wy1227463851.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/46wia1227463851.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/5z6nu1227463851.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
-113.537473 -38.504497 -215.104497 33.695503 -301.304497 -203.704497
7 8 9 10 11 12
147.751392 -66.448608 -65.904497 118.095503 -64.304497 24.951392
13 14 15 16 17 18
-110.164668 -47.852248 -2.452248 -72.652248 131.347752 -40.052248
19 20 21 22 23 24
47.403640 -109.796360 93.747752 139.747752 237.347752 -62.675803
25 26 27 28 29 30
-110.512420 8.800000 243.200000 243.000000 152.000000 354.600000
31 32 33 34 35 36
-25.223555 308.576445 158.400000 141.400000 -145.000000 239.255889
37 38 39 40 41 42
-19.580728 30.452248 54.852248 73.652248 -16.347752 -90.747752
43 44 45 46 47 48
-20.291863 -74.491863 -162.947752 -156.947752 -124.347752 -106.091863
49 50 51 52 53 54
195.071520 47.104497 -80.495503 -277.695503 34.304497 -20.095503
55 56 57 58 59 60
-149.639615 -57.839615 -23.295503 -242.295503 96.304497 -95.439615
61
158.723769
> postscript(file="/var/www/html/rcomp/tmp/6lqjv1227463851.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 -113.537473 NA
1 -38.504497 -113.537473
2 -215.104497 -38.504497
3 33.695503 -215.104497
4 -301.304497 33.695503
5 -203.704497 -301.304497
6 147.751392 -203.704497
7 -66.448608 147.751392
8 -65.904497 -66.448608
9 118.095503 -65.904497
10 -64.304497 118.095503
11 24.951392 -64.304497
12 -110.164668 24.951392
13 -47.852248 -110.164668
14 -2.452248 -47.852248
15 -72.652248 -2.452248
16 131.347752 -72.652248
17 -40.052248 131.347752
18 47.403640 -40.052248
19 -109.796360 47.403640
20 93.747752 -109.796360
21 139.747752 93.747752
22 237.347752 139.747752
23 -62.675803 237.347752
24 -110.512420 -62.675803
25 8.800000 -110.512420
26 243.200000 8.800000
27 243.000000 243.200000
28 152.000000 243.000000
29 354.600000 152.000000
30 -25.223555 354.600000
31 308.576445 -25.223555
32 158.400000 308.576445
33 141.400000 158.400000
34 -145.000000 141.400000
35 239.255889 -145.000000
36 -19.580728 239.255889
37 30.452248 -19.580728
38 54.852248 30.452248
39 73.652248 54.852248
40 -16.347752 73.652248
41 -90.747752 -16.347752
42 -20.291863 -90.747752
43 -74.491863 -20.291863
44 -162.947752 -74.491863
45 -156.947752 -162.947752
46 -124.347752 -156.947752
47 -106.091863 -124.347752
48 195.071520 -106.091863
49 47.104497 195.071520
50 -80.495503 47.104497
51 -277.695503 -80.495503
52 34.304497 -277.695503
53 -20.095503 34.304497
54 -149.639615 -20.095503
55 -57.839615 -149.639615
56 -23.295503 -57.839615
57 -242.295503 -23.295503
58 96.304497 -242.295503
59 -95.439615 96.304497
60 158.723769 -95.439615
61 NA 158.723769
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -38.504497 -113.537473
[2,] -215.104497 -38.504497
[3,] 33.695503 -215.104497
[4,] -301.304497 33.695503
[5,] -203.704497 -301.304497
[6,] 147.751392 -203.704497
[7,] -66.448608 147.751392
[8,] -65.904497 -66.448608
[9,] 118.095503 -65.904497
[10,] -64.304497 118.095503
[11,] 24.951392 -64.304497
[12,] -110.164668 24.951392
[13,] -47.852248 -110.164668
[14,] -2.452248 -47.852248
[15,] -72.652248 -2.452248
[16,] 131.347752 -72.652248
[17,] -40.052248 131.347752
[18,] 47.403640 -40.052248
[19,] -109.796360 47.403640
[20,] 93.747752 -109.796360
[21,] 139.747752 93.747752
[22,] 237.347752 139.747752
[23,] -62.675803 237.347752
[24,] -110.512420 -62.675803
[25,] 8.800000 -110.512420
[26,] 243.200000 8.800000
[27,] 243.000000 243.200000
[28,] 152.000000 243.000000
[29,] 354.600000 152.000000
[30,] -25.223555 354.600000
[31,] 308.576445 -25.223555
[32,] 158.400000 308.576445
[33,] 141.400000 158.400000
[34,] -145.000000 141.400000
[35,] 239.255889 -145.000000
[36,] -19.580728 239.255889
[37,] 30.452248 -19.580728
[38,] 54.852248 30.452248
[39,] 73.652248 54.852248
[40,] -16.347752 73.652248
[41,] -90.747752 -16.347752
[42,] -20.291863 -90.747752
[43,] -74.491863 -20.291863
[44,] -162.947752 -74.491863
[45,] -156.947752 -162.947752
[46,] -124.347752 -156.947752
[47,] -106.091863 -124.347752
[48,] 195.071520 -106.091863
[49,] 47.104497 195.071520
[50,] -80.495503 47.104497
[51,] -277.695503 -80.495503
[52,] 34.304497 -277.695503
[53,] -20.095503 34.304497
[54,] -149.639615 -20.095503
[55,] -57.839615 -149.639615
[56,] -23.295503 -57.839615
[57,] -242.295503 -23.295503
[58,] 96.304497 -242.295503
[59,] -95.439615 96.304497
[60,] 158.723769 -95.439615
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -38.504497 -113.537473
2 -215.104497 -38.504497
3 33.695503 -215.104497
4 -301.304497 33.695503
5 -203.704497 -301.304497
6 147.751392 -203.704497
7 -66.448608 147.751392
8 -65.904497 -66.448608
9 118.095503 -65.904497
10 -64.304497 118.095503
11 24.951392 -64.304497
12 -110.164668 24.951392
13 -47.852248 -110.164668
14 -2.452248 -47.852248
15 -72.652248 -2.452248
16 131.347752 -72.652248
17 -40.052248 131.347752
18 47.403640 -40.052248
19 -109.796360 47.403640
20 93.747752 -109.796360
21 139.747752 93.747752
22 237.347752 139.747752
23 -62.675803 237.347752
24 -110.512420 -62.675803
25 8.800000 -110.512420
26 243.200000 8.800000
27 243.000000 243.200000
28 152.000000 243.000000
29 354.600000 152.000000
30 -25.223555 354.600000
31 308.576445 -25.223555
32 158.400000 308.576445
33 141.400000 158.400000
34 -145.000000 141.400000
35 239.255889 -145.000000
36 -19.580728 239.255889
37 30.452248 -19.580728
38 54.852248 30.452248
39 73.652248 54.852248
40 -16.347752 73.652248
41 -90.747752 -16.347752
42 -20.291863 -90.747752
43 -74.491863 -20.291863
44 -162.947752 -74.491863
45 -156.947752 -162.947752
46 -124.347752 -156.947752
47 -106.091863 -124.347752
48 195.071520 -106.091863
49 47.104497 195.071520
50 -80.495503 47.104497
51 -277.695503 -80.495503
52 34.304497 -277.695503
53 -20.095503 34.304497
54 -149.639615 -20.095503
55 -57.839615 -149.639615
56 -23.295503 -57.839615
57 -242.295503 -23.295503
58 96.304497 -242.295503
59 -95.439615 96.304497
60 158.723769 -95.439615
> 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/7jwai1227463851.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/87fk11227463851.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/90ct21227463851.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/10wlnh1227463851.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/118d3i1227463851.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/12cz5q1227463851.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/13a6pd1227463851.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/14xug31227463851.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/153bgx1227463851.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/16ap7r1227463851.tab")
+ }
>
> system("convert tmp/1if921227463851.ps tmp/1if921227463851.png")
> system("convert tmp/2hsy91227463851.ps tmp/2hsy91227463851.png")
> system("convert tmp/3v4wy1227463851.ps tmp/3v4wy1227463851.png")
> system("convert tmp/46wia1227463851.ps tmp/46wia1227463851.png")
> system("convert tmp/5z6nu1227463851.ps tmp/5z6nu1227463851.png")
> system("convert tmp/6lqjv1227463851.ps tmp/6lqjv1227463851.png")
> system("convert tmp/7jwai1227463851.ps tmp/7jwai1227463851.png")
> system("convert tmp/87fk11227463851.ps tmp/87fk11227463851.png")
> system("convert tmp/90ct21227463851.ps tmp/90ct21227463851.png")
> system("convert tmp/10wlnh1227463851.ps tmp/10wlnh1227463851.png")
>
>
> proc.time()
user system elapsed
2.541 1.619 3.106