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(9700,0,9081,0,9084,0,9743,0,8587,0,9731,0,9563,0,9998,0,9437,0,10038,0,9918,0,9252,0,9737,0,9035,0,9133,0,9487,0,8700,0,9627,0,8947,0,9283,0,8829,0,9947,0,9628,0,9318,0,9605,0,8640,0,9214,0,9567,0,8547,0,9185,0,9470,0,9123,0,9278,0,10170,0,9434,0,9655,0,9429,0,8739,0,9552,0,9687,0,9019,1,9672,1,9206,1,9069,1,9788,1,10312,1,10105,1,9863,1,9656,1,9295,1,9946,1,9701,1,9049,1,10190,1,9706,1,9765,1,9893,1,9994,1,10433,1,10073,1,10112,1,9266,1,9820,1,10097,1,9115,1,10411,1,9678,1,10408,1,10153,1,10368,1,10581,1,10597,1,10680,1,9738,1,9556,1),dim=c(2,75),dimnames=list(c('Geboortes','X'),1:75))
> y <- array(NA,dim=c(2,75),dimnames=list(c('Geboortes','X'),1:75))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Geboortes X
1 9700 0
2 9081 0
3 9084 0
4 9743 0
5 8587 0
6 9731 0
7 9563 0
8 9998 0
9 9437 0
10 10038 0
11 9918 0
12 9252 0
13 9737 0
14 9035 0
15 9133 0
16 9487 0
17 8700 0
18 9627 0
19 8947 0
20 9283 0
21 8829 0
22 9947 0
23 9628 0
24 9318 0
25 9605 0
26 8640 0
27 9214 0
28 9567 0
29 8547 0
30 9185 0
31 9470 0
32 9123 0
33 9278 0
34 10170 0
35 9434 0
36 9655 0
37 9429 0
38 8739 0
39 9552 0
40 9687 0
41 9019 1
42 9672 1
43 9206 1
44 9069 1
45 9788 1
46 10312 1
47 10105 1
48 9863 1
49 9656 1
50 9295 1
51 9946 1
52 9701 1
53 9049 1
54 10190 1
55 9706 1
56 9765 1
57 9893 1
58 9994 1
59 10433 1
60 10073 1
61 10112 1
62 9266 1
63 9820 1
64 10097 1
65 9115 1
66 10411 1
67 9678 1
68 10408 1
69 10153 1
70 10368 1
71 10581 1
72 10597 1
73 10680 1
74 9738 1
75 9556 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
9377.4 488.7
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-847.14 -249.45 51.55 298.20 813.86
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9377.45 69.91 134.143 <2e-16 ***
X 488.69 102.33 4.776 9e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 442.1 on 73 degrees of freedom
Multiple R-squared: 0.238, Adjusted R-squared: 0.2276
F-statistic: 22.81 on 1 and 73 DF, p-value: 8.995e-06
> 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.8055358 0.3889284 0.1944642
[2,] 0.7758196 0.4483608 0.2241804
[3,] 0.6829810 0.6340381 0.3170190
[4,] 0.7421088 0.5157823 0.2578912
[5,] 0.6385779 0.7228442 0.3614221
[6,] 0.6939538 0.6120924 0.3060462
[7,] 0.6804141 0.6391718 0.3195859
[8,] 0.6149914 0.7700173 0.3850086
[9,] 0.5516384 0.8967232 0.4483616
[10,] 0.5506714 0.8986572 0.4493286
[11,] 0.5076538 0.9846925 0.4923462
[12,] 0.4225865 0.8451729 0.5774135
[13,] 0.5586329 0.8827342 0.4413671
[14,] 0.4957896 0.9915792 0.5042104
[15,] 0.4983850 0.9967700 0.5016150
[16,] 0.4244106 0.8488212 0.5755894
[17,] 0.4650773 0.9301546 0.5349227
[18,] 0.5080607 0.9838785 0.4919393
[19,] 0.4545872 0.9091743 0.5454128
[20,] 0.3840467 0.7680933 0.6159533
[21,] 0.3323099 0.6646197 0.6676901
[22,] 0.4542264 0.9084528 0.5457736
[23,] 0.3932555 0.7865110 0.6067445
[24,] 0.3382987 0.6765974 0.6617013
[25,] 0.5041126 0.9917749 0.4958874
[26,] 0.4492475 0.8984951 0.5507525
[27,] 0.3843282 0.7686563 0.6156718
[28,] 0.3449588 0.6899175 0.6550412
[29,] 0.2908106 0.5816212 0.7091894
[30,] 0.4124048 0.8248095 0.5875952
[31,] 0.3482257 0.6964514 0.6517743
[32,] 0.3096354 0.6192708 0.6903646
[33,] 0.2536435 0.5072870 0.7463565
[34,] 0.3255902 0.6511804 0.6744098
[35,] 0.2731847 0.5463693 0.7268153
[36,] 0.2327327 0.4654653 0.7672673
[37,] 0.2764267 0.5528534 0.7235733
[38,] 0.2576492 0.5152985 0.7423508
[39,] 0.2772726 0.5545451 0.7227274
[40,] 0.3554055 0.7108111 0.6445945
[41,] 0.3329121 0.6658242 0.6670879
[42,] 0.4046715 0.8093431 0.5953285
[43,] 0.3841017 0.7682034 0.6158983
[44,] 0.3274991 0.6549982 0.6725009
[45,] 0.2810979 0.5621957 0.7189021
[46,] 0.3182345 0.6364690 0.6817655
[47,] 0.2685388 0.5370776 0.7314612
[48,] 0.2259400 0.4518800 0.7740600
[49,] 0.4047447 0.8094894 0.5952553
[50,] 0.3768446 0.7536892 0.6231554
[51,] 0.3335664 0.6671328 0.6664336
[52,] 0.2861971 0.5723942 0.7138029
[53,] 0.2334180 0.4668359 0.7665820
[54,] 0.1847973 0.3695945 0.8152027
[55,] 0.1956825 0.3913650 0.8043175
[56,] 0.1496959 0.2993919 0.8503041
[57,] 0.1118895 0.2237790 0.8881105
[58,] 0.1862721 0.3725442 0.8137279
[59,] 0.1459514 0.2919028 0.8540486
[60,] 0.1026615 0.2053229 0.8973385
[61,] 0.3692200 0.7384401 0.6307800
[62,] 0.3137185 0.6274370 0.6862815
[63,] 0.3490570 0.6981140 0.6509430
[64,] 0.2692481 0.5384963 0.7307519
[65,] 0.1756843 0.3513685 0.8243157
[66,] 0.1051060 0.2102119 0.8948940
> postscript(file="/var/www/html/rcomp/tmp/1f6si1291975716.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/2f6si1291975716.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/3qx931291975716.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/4qx931291975716.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/5qx931291975716.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 = 75
Frequency = 1
1 2 3 4 5 6
322.550000 -296.450000 -293.450000 365.550000 -790.450000 353.550000
7 8 9 10 11 12
185.550000 620.550000 59.550000 660.550000 540.550000 -125.450000
13 14 15 16 17 18
359.550000 -342.450000 -244.450000 109.550000 -677.450000 249.550000
19 20 21 22 23 24
-430.450000 -94.450000 -548.450000 569.550000 250.550000 -59.450000
25 26 27 28 29 30
227.550000 -737.450000 -163.450000 189.550000 -830.450000 -192.450000
31 32 33 34 35 36
92.550000 -254.450000 -99.450000 792.550000 56.550000 277.550000
37 38 39 40 41 42
51.550000 -638.450000 174.550000 309.550000 -847.142857 -194.142857
43 44 45 46 47 48
-660.142857 -797.142857 -78.142857 445.857143 238.857143 -3.142857
49 50 51 52 53 54
-210.142857 -571.142857 79.857143 -165.142857 -817.142857 323.857143
55 56 57 58 59 60
-160.142857 -101.142857 26.857143 127.857143 566.857143 206.857143
61 62 63 64 65 66
245.857143 -600.142857 -46.142857 230.857143 -751.142857 544.857143
67 68 69 70 71 72
-188.142857 541.857143 286.857143 501.857143 714.857143 730.857143
73 74 75
813.857143 -128.142857 -310.142857
> postscript(file="/var/www/html/rcomp/tmp/6j6qo1291975716.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 = 75
Frequency = 1
lag(myerror, k = 1) myerror
0 322.550000 NA
1 -296.450000 322.550000
2 -293.450000 -296.450000
3 365.550000 -293.450000
4 -790.450000 365.550000
5 353.550000 -790.450000
6 185.550000 353.550000
7 620.550000 185.550000
8 59.550000 620.550000
9 660.550000 59.550000
10 540.550000 660.550000
11 -125.450000 540.550000
12 359.550000 -125.450000
13 -342.450000 359.550000
14 -244.450000 -342.450000
15 109.550000 -244.450000
16 -677.450000 109.550000
17 249.550000 -677.450000
18 -430.450000 249.550000
19 -94.450000 -430.450000
20 -548.450000 -94.450000
21 569.550000 -548.450000
22 250.550000 569.550000
23 -59.450000 250.550000
24 227.550000 -59.450000
25 -737.450000 227.550000
26 -163.450000 -737.450000
27 189.550000 -163.450000
28 -830.450000 189.550000
29 -192.450000 -830.450000
30 92.550000 -192.450000
31 -254.450000 92.550000
32 -99.450000 -254.450000
33 792.550000 -99.450000
34 56.550000 792.550000
35 277.550000 56.550000
36 51.550000 277.550000
37 -638.450000 51.550000
38 174.550000 -638.450000
39 309.550000 174.550000
40 -847.142857 309.550000
41 -194.142857 -847.142857
42 -660.142857 -194.142857
43 -797.142857 -660.142857
44 -78.142857 -797.142857
45 445.857143 -78.142857
46 238.857143 445.857143
47 -3.142857 238.857143
48 -210.142857 -3.142857
49 -571.142857 -210.142857
50 79.857143 -571.142857
51 -165.142857 79.857143
52 -817.142857 -165.142857
53 323.857143 -817.142857
54 -160.142857 323.857143
55 -101.142857 -160.142857
56 26.857143 -101.142857
57 127.857143 26.857143
58 566.857143 127.857143
59 206.857143 566.857143
60 245.857143 206.857143
61 -600.142857 245.857143
62 -46.142857 -600.142857
63 230.857143 -46.142857
64 -751.142857 230.857143
65 544.857143 -751.142857
66 -188.142857 544.857143
67 541.857143 -188.142857
68 286.857143 541.857143
69 501.857143 286.857143
70 714.857143 501.857143
71 730.857143 714.857143
72 813.857143 730.857143
73 -128.142857 813.857143
74 -310.142857 -128.142857
75 NA -310.142857
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -296.450000 322.550000
[2,] -293.450000 -296.450000
[3,] 365.550000 -293.450000
[4,] -790.450000 365.550000
[5,] 353.550000 -790.450000
[6,] 185.550000 353.550000
[7,] 620.550000 185.550000
[8,] 59.550000 620.550000
[9,] 660.550000 59.550000
[10,] 540.550000 660.550000
[11,] -125.450000 540.550000
[12,] 359.550000 -125.450000
[13,] -342.450000 359.550000
[14,] -244.450000 -342.450000
[15,] 109.550000 -244.450000
[16,] -677.450000 109.550000
[17,] 249.550000 -677.450000
[18,] -430.450000 249.550000
[19,] -94.450000 -430.450000
[20,] -548.450000 -94.450000
[21,] 569.550000 -548.450000
[22,] 250.550000 569.550000
[23,] -59.450000 250.550000
[24,] 227.550000 -59.450000
[25,] -737.450000 227.550000
[26,] -163.450000 -737.450000
[27,] 189.550000 -163.450000
[28,] -830.450000 189.550000
[29,] -192.450000 -830.450000
[30,] 92.550000 -192.450000
[31,] -254.450000 92.550000
[32,] -99.450000 -254.450000
[33,] 792.550000 -99.450000
[34,] 56.550000 792.550000
[35,] 277.550000 56.550000
[36,] 51.550000 277.550000
[37,] -638.450000 51.550000
[38,] 174.550000 -638.450000
[39,] 309.550000 174.550000
[40,] -847.142857 309.550000
[41,] -194.142857 -847.142857
[42,] -660.142857 -194.142857
[43,] -797.142857 -660.142857
[44,] -78.142857 -797.142857
[45,] 445.857143 -78.142857
[46,] 238.857143 445.857143
[47,] -3.142857 238.857143
[48,] -210.142857 -3.142857
[49,] -571.142857 -210.142857
[50,] 79.857143 -571.142857
[51,] -165.142857 79.857143
[52,] -817.142857 -165.142857
[53,] 323.857143 -817.142857
[54,] -160.142857 323.857143
[55,] -101.142857 -160.142857
[56,] 26.857143 -101.142857
[57,] 127.857143 26.857143
[58,] 566.857143 127.857143
[59,] 206.857143 566.857143
[60,] 245.857143 206.857143
[61,] -600.142857 245.857143
[62,] -46.142857 -600.142857
[63,] 230.857143 -46.142857
[64,] -751.142857 230.857143
[65,] 544.857143 -751.142857
[66,] -188.142857 544.857143
[67,] 541.857143 -188.142857
[68,] 286.857143 541.857143
[69,] 501.857143 286.857143
[70,] 714.857143 501.857143
[71,] 730.857143 714.857143
[72,] 813.857143 730.857143
[73,] -128.142857 813.857143
[74,] -310.142857 -128.142857
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -296.450000 322.550000
2 -293.450000 -296.450000
3 365.550000 -293.450000
4 -790.450000 365.550000
5 353.550000 -790.450000
6 185.550000 353.550000
7 620.550000 185.550000
8 59.550000 620.550000
9 660.550000 59.550000
10 540.550000 660.550000
11 -125.450000 540.550000
12 359.550000 -125.450000
13 -342.450000 359.550000
14 -244.450000 -342.450000
15 109.550000 -244.450000
16 -677.450000 109.550000
17 249.550000 -677.450000
18 -430.450000 249.550000
19 -94.450000 -430.450000
20 -548.450000 -94.450000
21 569.550000 -548.450000
22 250.550000 569.550000
23 -59.450000 250.550000
24 227.550000 -59.450000
25 -737.450000 227.550000
26 -163.450000 -737.450000
27 189.550000 -163.450000
28 -830.450000 189.550000
29 -192.450000 -830.450000
30 92.550000 -192.450000
31 -254.450000 92.550000
32 -99.450000 -254.450000
33 792.550000 -99.450000
34 56.550000 792.550000
35 277.550000 56.550000
36 51.550000 277.550000
37 -638.450000 51.550000
38 174.550000 -638.450000
39 309.550000 174.550000
40 -847.142857 309.550000
41 -194.142857 -847.142857
42 -660.142857 -194.142857
43 -797.142857 -660.142857
44 -78.142857 -797.142857
45 445.857143 -78.142857
46 238.857143 445.857143
47 -3.142857 238.857143
48 -210.142857 -3.142857
49 -571.142857 -210.142857
50 79.857143 -571.142857
51 -165.142857 79.857143
52 -817.142857 -165.142857
53 323.857143 -817.142857
54 -160.142857 323.857143
55 -101.142857 -160.142857
56 26.857143 -101.142857
57 127.857143 26.857143
58 566.857143 127.857143
59 206.857143 566.857143
60 245.857143 206.857143
61 -600.142857 245.857143
62 -46.142857 -600.142857
63 230.857143 -46.142857
64 -751.142857 230.857143
65 544.857143 -751.142857
66 -188.142857 544.857143
67 541.857143 -188.142857
68 286.857143 541.857143
69 501.857143 286.857143
70 714.857143 501.857143
71 730.857143 714.857143
72 813.857143 730.857143
73 -128.142857 813.857143
74 -310.142857 -128.142857
> 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/7j6qo1291975716.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/8cyqr1291975716.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/9cyqr1291975716.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/10cyqr1291975716.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/118p601291975716.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/12ih5l1291975716.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/137ikx1291975716.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/14t0i21291975716.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/15e1h81291975716.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/16h1fw1291975716.tab")
+ }
>
> try(system("convert tmp/1f6si1291975716.ps tmp/1f6si1291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/2f6si1291975716.ps tmp/2f6si1291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/3qx931291975716.ps tmp/3qx931291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/4qx931291975716.ps tmp/4qx931291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/5qx931291975716.ps tmp/5qx931291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/6j6qo1291975716.ps tmp/6j6qo1291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/7j6qo1291975716.ps tmp/7j6qo1291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/8cyqr1291975716.ps tmp/8cyqr1291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/9cyqr1291975716.ps tmp/9cyqr1291975716.png",intern=TRUE))
character(0)
> try(system("convert tmp/10cyqr1291975716.ps tmp/10cyqr1291975716.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.626 1.599 6.067