R version 2.13.0 (2011-04-13)
Copyright (C) 2011 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(1217.00
+ ,1210.00
+ ,31.00
+ ,19.00
+ ,48.00
+ ,961.00
+ ,2304.00
+ ,1202.00
+ ,1209.00
+ ,34.40
+ ,18.30
+ ,38.00
+ ,1183.36
+ ,1444.00
+ ,1180.00
+ ,1207.00
+ ,35.60
+ ,18.90
+ ,37.00
+ ,1267.36
+ ,1369.00
+ ,1167.00
+ ,1206.00
+ ,32.80
+ ,20.60
+ ,48.00
+ ,1075.84
+ ,2304.00
+ ,1186.00
+ ,1204.00
+ ,23.30
+ ,20.00
+ ,81.00
+ ,542.89
+ ,6561.00
+ ,1168.00
+ ,1201.00
+ ,20.00
+ ,11.76
+ ,58.00
+ ,400.00
+ ,3364.00
+ ,1142.00
+ ,1199.00
+ ,16.70
+ ,15.60
+ ,93.00
+ ,278.89
+ ,8649.00
+ ,1147.00
+ ,1198.00
+ ,17.80
+ ,15.60
+ ,86.00
+ ,316.84
+ ,7396.00
+ ,1183.00
+ ,1196.00
+ ,21.20
+ ,15.80
+ ,68.00
+ ,449.44
+ ,4624.00
+ ,1149.00
+ ,1195.00
+ ,23.90
+ ,17.80
+ ,68.00
+ ,571.21
+ ,4624.00
+ ,1197.00
+ ,1193.00
+ ,28.80
+ ,16.70
+ ,68.00
+ ,829.44
+ ,4624.00
+ ,1210.00
+ ,1191.00
+ ,25.60
+ ,17.20
+ ,59.00
+ ,655.36
+ ,3481.00
+ ,1206.00
+ ,1190.00
+ ,29.40
+ ,15.60
+ ,43.00
+ ,864.36
+ ,1849.00
+ ,1196.00
+ ,1188.00
+ ,22.80
+ ,14.40
+ ,59.00
+ ,519.84
+ ,3481.00
+ ,1190.00
+ ,1187.00
+ ,16.10
+ ,-0.60
+ ,31.00
+ ,259.21
+ ,961.00
+ ,1175.00
+ ,1185.00
+ ,16.10
+ ,5.60
+ ,49.00
+ ,259.21
+ ,2401.00
+ ,1186.00
+ ,1183.00
+ ,20.00
+ ,10.08
+ ,52.00
+ ,400.00
+ ,2704.00
+ ,1172.00
+ ,1182.00
+ ,20.60
+ ,16.10
+ ,75.00
+ ,424.36
+ ,5625.00
+ ,1152.00
+ ,1185.00
+ ,18.30
+ ,16.70
+ ,90.00
+ ,334.89
+ ,8100.00
+ ,1154.00
+ ,1179.00
+ ,21.60
+ ,18.30
+ ,86.00
+ ,466.56
+ ,7396.00
+ ,1168.00
+ ,1177.00
+ ,22.80
+ ,20.60
+ ,87.00
+ ,519.84
+ ,7569.00
+ ,1180.00
+ ,1175.00
+ ,22.80
+ ,11.10
+ ,47.00
+ ,519.84
+ ,2209.00
+ ,1169.00
+ ,1174.00
+ ,17.20
+ ,11.70
+ ,70.00
+ ,295.84
+ ,4900.00
+ ,1166.00
+ ,1170.00
+ ,22.20
+ ,14.40
+ ,61.00
+ ,492.84
+ ,3721.00
+ ,1177.00
+ ,1169.00
+ ,20.60
+ ,9.40
+ ,48.00
+ ,424.36
+ ,2304.00
+ ,1168.00
+ ,1167.00
+ ,18.30
+ ,12.20
+ ,67.00
+ ,334.89
+ ,4489.00
+ ,1160.00
+ ,1166.00
+ ,16.70
+ ,12.20
+ ,74.00
+ ,278.89
+ ,5476.00
+ ,1147.00
+ ,1164.00
+ ,22.80
+ ,13.30
+ ,55.00
+ ,519.84
+ ,3025.00
+ ,1161.00
+ ,1162.00
+ ,13.90
+ ,2.80
+ ,47.00
+ ,193.21
+ ,2209.00
+ ,1143.00
+ ,1161.00
+ ,10.00
+ ,3.90
+ ,65.00
+ ,100.00
+ ,4225.00
+ ,1161.00
+ ,1159.00
+ ,16.10
+ ,-2.20
+ ,28.00
+ ,259.21
+ ,784.00
+ ,1161.00
+ ,1158.00
+ ,20.60
+ ,5.00
+ ,30.00
+ ,424.36
+ ,900.00
+ ,1168.00
+ ,1156.00
+ ,19.40
+ ,13.30
+ ,67.00
+ ,376.36
+ ,4489.00
+ ,1172.00
+ ,1155.00
+ ,25.60
+ ,7.80
+ ,32.00
+ ,655.36
+ ,1024.00)
+ ,dim=c(7
+ ,34)
+ ,dimnames=list(c('15thbird'
+ ,'Sunset'
+ ,'Temp'
+ ,'Dewpoint'
+ ,'humidity'
+ ,'Temp^2'
+ ,'Hum^2')
+ ,1:34))
> y <- array(NA,dim=c(7,34),dimnames=list(c('15thbird','Sunset','Temp','Dewpoint','humidity','Temp^2','Hum^2'),1:34))
> 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
> 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
15thbird Sunset Temp Dewpoint humidity Temp^2 Hum^2
1 1217 1210 31.0 19.00 48 961.00 2304
2 1202 1209 34.4 18.30 38 1183.36 1444
3 1180 1207 35.6 18.90 37 1267.36 1369
4 1167 1206 32.8 20.60 48 1075.84 2304
5 1186 1204 23.3 20.00 81 542.89 6561
6 1168 1201 20.0 11.76 58 400.00 3364
7 1142 1199 16.7 15.60 93 278.89 8649
8 1147 1198 17.8 15.60 86 316.84 7396
9 1183 1196 21.2 15.80 68 449.44 4624
10 1149 1195 23.9 17.80 68 571.21 4624
11 1197 1193 28.8 16.70 68 829.44 4624
12 1210 1191 25.6 17.20 59 655.36 3481
13 1206 1190 29.4 15.60 43 864.36 1849
14 1196 1188 22.8 14.40 59 519.84 3481
15 1190 1187 16.1 -0.60 31 259.21 961
16 1175 1185 16.1 5.60 49 259.21 2401
17 1186 1183 20.0 10.08 52 400.00 2704
18 1172 1182 20.6 16.10 75 424.36 5625
19 1152 1185 18.3 16.70 90 334.89 8100
20 1154 1179 21.6 18.30 86 466.56 7396
21 1168 1177 22.8 20.60 87 519.84 7569
22 1180 1175 22.8 11.10 47 519.84 2209
23 1169 1174 17.2 11.70 70 295.84 4900
24 1166 1170 22.2 14.40 61 492.84 3721
25 1177 1169 20.6 9.40 48 424.36 2304
26 1168 1167 18.3 12.20 67 334.89 4489
27 1160 1166 16.7 12.20 74 278.89 5476
28 1147 1164 22.8 13.30 55 519.84 3025
29 1161 1162 13.9 2.80 47 193.21 2209
30 1143 1161 10.0 3.90 65 100.00 4225
31 1161 1159 16.1 -2.20 28 259.21 784
32 1161 1158 20.6 5.00 30 424.36 900
33 1168 1156 19.4 13.30 67 376.36 4489
34 1172 1155 25.6 7.80 32 655.36 1024
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Sunset Temp Dewpoint humidity `Temp^2`
421.47980 0.49644 8.64554 -2.94717 2.38431 -0.11578
`Hum^2`
-0.01791
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-33.088 -4.814 1.590 7.638 24.164
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 421.479803 263.789740 1.598 0.1217
Sunset 0.496444 0.205761 2.413 0.0229 *
Temp 8.645536 3.909339 2.212 0.0357 *
Dewpoint -2.947167 2.578644 -1.143 0.2631
humidity 2.384312 1.427296 1.671 0.1064
`Temp^2` -0.115776 0.061680 -1.877 0.0714 .
`Hum^2` -0.017909 0.008301 -2.157 0.0400 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 14.23 on 27 degrees of freedom
Multiple R-squared: 0.5655, Adjusted R-squared: 0.4689
F-statistic: 5.857 on 6 and 27 DF, p-value: 0.0005179
> 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.8812811 0.23743775 0.118718873
[2,] 0.9758152 0.04836965 0.024184823
[3,] 0.9910968 0.01780633 0.008903166
[4,] 0.9907749 0.01845022 0.009225112
[5,] 0.9893361 0.02132778 0.010663891
[6,] 0.9832819 0.03343628 0.016718142
[7,] 0.9792905 0.04141894 0.020709471
[8,] 0.9633935 0.07321305 0.036606524
[9,] 0.9314817 0.13703654 0.068518272
[10,] 0.8873494 0.22530123 0.112650615
[11,] 0.8995066 0.20098689 0.100493445
[12,] 0.8174313 0.36513746 0.182568728
[13,] 0.7763478 0.44730439 0.223652196
[14,] 0.6675596 0.66488075 0.332440377
[15,] 0.5051384 0.98972318 0.494861591
> postscript(file="/var/wessaorg/rcomp/tmp/1o4bp1331047918.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/wessaorg/rcomp/tmp/2asfb1331047918.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/wessaorg/rcomp/tmp/3mzh31331047918.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/wessaorg/rcomp/tmp/409aj1331047918.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/wessaorg/rcomp/tmp/5kb2c1331047918.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 = 34
Frequency = 1
1 2 3 4 5 6
20.8842398 9.1079260 -9.7392567 -24.6808141 11.5308679 -19.6938546
7 8 9 10 11 12
-7.6760336 -13.0460214 3.7666740 -33.0875013 0.1971084 24.1636865
13 14 15 16 17 18
16.2099265 11.9185414 11.5875647 -1.2755008 4.7766974 4.1216139
19 20 21 22 23 24
2.4874282 -4.1753582 14.1038705 -1.5220845 5.5783704 -7.5545142
25 26 27 28 29 30
0.7293786 4.3302666 5.1623167 -27.0380387 0.5996828 2.4514602
31 32 33 34
-4.2444741 -5.0041590 8.3241533 -3.2941628
> postscript(file="/var/wessaorg/rcomp/tmp/6okw21331047918.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 = 34
Frequency = 1
lag(myerror, k = 1) myerror
0 20.8842398 NA
1 9.1079260 20.8842398
2 -9.7392567 9.1079260
3 -24.6808141 -9.7392567
4 11.5308679 -24.6808141
5 -19.6938546 11.5308679
6 -7.6760336 -19.6938546
7 -13.0460214 -7.6760336
8 3.7666740 -13.0460214
9 -33.0875013 3.7666740
10 0.1971084 -33.0875013
11 24.1636865 0.1971084
12 16.2099265 24.1636865
13 11.9185414 16.2099265
14 11.5875647 11.9185414
15 -1.2755008 11.5875647
16 4.7766974 -1.2755008
17 4.1216139 4.7766974
18 2.4874282 4.1216139
19 -4.1753582 2.4874282
20 14.1038705 -4.1753582
21 -1.5220845 14.1038705
22 5.5783704 -1.5220845
23 -7.5545142 5.5783704
24 0.7293786 -7.5545142
25 4.3302666 0.7293786
26 5.1623167 4.3302666
27 -27.0380387 5.1623167
28 0.5996828 -27.0380387
29 2.4514602 0.5996828
30 -4.2444741 2.4514602
31 -5.0041590 -4.2444741
32 8.3241533 -5.0041590
33 -3.2941628 8.3241533
34 NA -3.2941628
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 9.1079260 20.8842398
[2,] -9.7392567 9.1079260
[3,] -24.6808141 -9.7392567
[4,] 11.5308679 -24.6808141
[5,] -19.6938546 11.5308679
[6,] -7.6760336 -19.6938546
[7,] -13.0460214 -7.6760336
[8,] 3.7666740 -13.0460214
[9,] -33.0875013 3.7666740
[10,] 0.1971084 -33.0875013
[11,] 24.1636865 0.1971084
[12,] 16.2099265 24.1636865
[13,] 11.9185414 16.2099265
[14,] 11.5875647 11.9185414
[15,] -1.2755008 11.5875647
[16,] 4.7766974 -1.2755008
[17,] 4.1216139 4.7766974
[18,] 2.4874282 4.1216139
[19,] -4.1753582 2.4874282
[20,] 14.1038705 -4.1753582
[21,] -1.5220845 14.1038705
[22,] 5.5783704 -1.5220845
[23,] -7.5545142 5.5783704
[24,] 0.7293786 -7.5545142
[25,] 4.3302666 0.7293786
[26,] 5.1623167 4.3302666
[27,] -27.0380387 5.1623167
[28,] 0.5996828 -27.0380387
[29,] 2.4514602 0.5996828
[30,] -4.2444741 2.4514602
[31,] -5.0041590 -4.2444741
[32,] 8.3241533 -5.0041590
[33,] -3.2941628 8.3241533
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 9.1079260 20.8842398
2 -9.7392567 9.1079260
3 -24.6808141 -9.7392567
4 11.5308679 -24.6808141
5 -19.6938546 11.5308679
6 -7.6760336 -19.6938546
7 -13.0460214 -7.6760336
8 3.7666740 -13.0460214
9 -33.0875013 3.7666740
10 0.1971084 -33.0875013
11 24.1636865 0.1971084
12 16.2099265 24.1636865
13 11.9185414 16.2099265
14 11.5875647 11.9185414
15 -1.2755008 11.5875647
16 4.7766974 -1.2755008
17 4.1216139 4.7766974
18 2.4874282 4.1216139
19 -4.1753582 2.4874282
20 14.1038705 -4.1753582
21 -1.5220845 14.1038705
22 5.5783704 -1.5220845
23 -7.5545142 5.5783704
24 0.7293786 -7.5545142
25 4.3302666 0.7293786
26 5.1623167 4.3302666
27 -27.0380387 5.1623167
28 0.5996828 -27.0380387
29 2.4514602 0.5996828
30 -4.2444741 2.4514602
31 -5.0041590 -4.2444741
32 8.3241533 -5.0041590
33 -3.2941628 8.3241533
> 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/wessaorg/rcomp/tmp/7n4541331047918.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/wessaorg/rcomp/tmp/8on8d1331047918.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/wessaorg/rcomp/tmp/9sk221331047918.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/wessaorg/rcomp/tmp/10ciez1331047918.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11hv3i1331047918.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/wessaorg/rcomp/tmp/125d1p1331047918.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/wessaorg/rcomp/tmp/13p41e1331047919.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/wessaorg/rcomp/tmp/14oygb1331047919.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/wessaorg/rcomp/tmp/153mgs1331047919.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/wessaorg/rcomp/tmp/169p511331047919.tab")
+ }
>
> try(system("convert tmp/1o4bp1331047918.ps tmp/1o4bp1331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/2asfb1331047918.ps tmp/2asfb1331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/3mzh31331047918.ps tmp/3mzh31331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/409aj1331047918.ps tmp/409aj1331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/5kb2c1331047918.ps tmp/5kb2c1331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/6okw21331047918.ps tmp/6okw21331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/7n4541331047918.ps tmp/7n4541331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/8on8d1331047918.ps tmp/8on8d1331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/9sk221331047918.ps tmp/9sk221331047918.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ciez1331047918.ps tmp/10ciez1331047918.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.163 0.748 3.926