Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
96 13 12 4 0 70 8 8 4 1 88 14 11 5 0 114 16 13 4 1 69 14 11 4 1 176 13 10 9 1 114 15 7 8 0 121 13 10 11 1 110 20 15 4 1 158 17 12 4 1 116 15 12 6 1 181 16 10 4 1 77 12 10 8 1 141 17 14 4 0 35 11 6 4 0 80 16 12 11 0 152 16 14 4 1 97 15 11 4 0 99 13 8 6 1 84 14 12 6 0 68 19 15 4 1 101 16 13 8 1 107 17 11 5 0 88 10 12 4 1 112 15 7 9 1 171 14 11 4 1 137 14 7 7 1 77 16 12 10 0 66 15 12 4 1 93 17 13 4 0 105 14 9 7 0 131 16 11 12 0 102 15 12 7 1 161 16 15 5 1 120 16 12 8 1 127 10 6 5 1 77 8 5 4 0 108 17 13 9 1 85 14 11 7 1 168 10 6 4 0 48 14 12 4 1 152 12 10 4 1 75 16 6 4 1 107 16 12 4 1 62 16 11 7 1 121 8 6 4 0 124 16 12 7 1 72 15 12 4 1 40 8 8 4 0 58 13 10 4 1 97 14 11 4 1 88 13 7 8 1 126 16 12 4 1 104 19 13 4 1 148 19 14 4 1 146 14 12 4 1 80 15 6 7 0 97 13 14 12 1 25 10 10 4 0 99 16 12 4 1 118 15 11 4 1 58 11 10 5 0 63 9 7 15 0 139 16 12 5 1 50 12 7 10 0 60 12 12 9 1 152 14 12 8 0 142 14 10 4 1 94 13 10 5 1 66 15 12 4 0 127 17 12 9 0 67 14 12 4 0 90 11 8 10 0 75 9 10 4 1 128 7 5 4 0 146 13 10 7 0 69 15 10 5 1 186 12 12 4 0 81 15 11 4 0 85 14 9 4 1 54 16 12 4 0 46 14 11 4 0 106 13 10 4 0 34 16 12 6 1 60 13 10 10 0 95 16 9 7 1 57 16 11 4 1 62 16 12 4 0 36 10 7 7 0 56 12 11 4 0 54 12 12 8 1 64 12 6 11 1 76 12 9 6 1 98 19 15 14 0 88 14 10 5 1 35 13 11 4 0 102 16 12 8 1 61 15 12 9 1 80 12 12 4 1 49 8 11 4 1 78 10 9 5 1 90 16 11 4 0 45 16 12 5 1 55 10 12 4 1 96 18 14 4 1 43 12 8 7 0 52 16 10 10 0 60 10 9 4 0 54 14 10 5 0 51 12 9 4 0 51 11 10 4 0 38 15 12 4 1 41 7 11 6 1 146 16 9 4 1 182 16 11 8 1 192 16 12 5 1 263 16 12 4 0 35 12 7 17 1 439 15 12 4 1 214 14 12 4 0 341 15 12 8 1 58 16 10 4 0 292 13 15 7 0 85 10 10 4 1 200 17 15 4 1 158 15 10 5 1 199 18 15 7 1 297 16 9 4 1 227 20 15 4 1 108 16 12 7 1 86 17 13 11 1 302 16 12 7 0 148 15 12 4 1 178 13 8 4 1 120 16 9 4 1 207 16 15 4 1 157 16 12 4 1 128 17 12 4 1 296 20 15 6 0 323 14 11 8 1 79 17 12 23 1 70 6 6 4 1 146 16 14 8 1 246 15 12 6 1 145 16 12 4 0 199 16 12 7 0 127 14 11 4 1 91 16 12 4 0 299 16 12 4 0 228 16 12 10 1 190 14 12 6 0 180 14 8 5 1 212 16 8 5 1 269 16 12 4 0 130 15 12 4 1 179 16 11 5 1 243 16 10 5 1 190 18 11 5 0 299 15 12 5 0 121 16 13 4 0 137 16 12 6 0 305 16 12 4 1 157 17 10 4 0 96 14 10 4 1 183 18 11 9 0 52 9 8 18 1 238 15 12 6 0 40 14 9 5 1 226 15 12 4 0 190 13 9 11 0 214 16 11 4 1 145 20 15 10 0 119 14 8 6 1 222 12 8 8 1 222 15 11 8 1 159 15 11 6 1 165 15 11 8 1 249 16 13 4 0 125 11 7 4 1 122 16 12 9 0 186 7 8 9 0 148 11 8 5 0 274 9 4 4 1 172 15 11 4 0 84 16 10 15 1 168 14 7 10 0 102 15 12 9 0 106 13 11 7 0 2 13 9 9 0 139 12 10 6 1 95 16 8 4 1 130 14 8 7 1 72 16 11 4 1 141 14 12 7 0 113 15 10 4 0 206 10 10 15 1 268 16 12 4 0 175 14 8 9 0 77 16 11 4 0 125 12 8 4 0 255 16 10 28 1 111 16 14 4 1 132 15 9 4 0 211 14 9 4 0 92 16 10 5 1 76 11 13 4 0 171 15 12 4 1 83 18 13 12 1 119 13 8 5 1 186 7 3 6 1 50 7 8 6 1 117 17 12 5 1 219 18 11 4 0 246 15 9 4 0 279 8 12 4 0 148 13 12 10 1 137 13 12 7 1 130 15 10 4 0 98 18 13 7 1 226 16 9 4 0 234 14 12 4 0 138 15 11 12 0 85 19 14 5 1 66 16 11 8 1 236 12 9 6 0 106 16 12 17 0 135 11 8 4 0 122 16 15 5 1 218 15 12 4 1 199 19 14 5 0 112 15 12 5 0 278 14 9 6 0 94 14 9 4 1 113 17 13 4 1 84 16 13 4 1 86 20 15 6 1 62 16 11 8 0 222 9 7 10 1 167 13 10 4 1 82 15 11 5 1 207 19 14 4 0 184 16 14 4 0 83 17 13 4 1 183 16 12 16 0 85 9 8 4 1 225 11 13 4 1 237 14 9 4 0 102 19 12 14 1 221 13 13 5 0 128 14 11 5 1 91 15 11 5 1 198 15 13 5 0 204 14 12 7 1 158 16 12 19 0 138 17 10 16 1 226 12 9 4 0 44 15 10 4 1 196 17 13 7 0 83 15 13 9 0 79 10 9 5 1 52 16 11 14 1 105 15 12 4 0 116 11 8 16 1 83 16 12 10 1 196 16 12 5 0 153 16 12 6 1 157 14 9 4 0 75 14 12 4 0 106 16 12 4 1 58 16 11 5 1 75 18 12 4 0 74 14 6 4 1 185 20 7 5 0 265 15 10 4 0 131 16 12 4 1 139 16 10 5 0 196 16 12 8 0 78 12 9 15 1
Names of X columns:
BB CONFSTATTOT CONFSOFTTOT AMS.A gender
Sample Range:
(leave blank to include all observations)
From:
To:
Column Number of Endogenous Series
(?)
Fixed Seasonal Effects
Do not include Seasonal Dummies
Do not include Seasonal Dummies
Include Seasonal Dummies
Type of Equation
No Linear Trend
No Linear Trend
Linear Trend
First Differences
Seasonal Differences (s)
First and Seasonal Differences (s)
Degree of Predetermination (lagged endogenous variables)
Degree of Seasonal Predetermination
Seasonality
12
1
2
3
4
5
6
7
8
9
10
11
12
Chart options
R Code
library(lattice) library(lmtest) 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 k <- length(x[1,]) df <- as.data.frame(x) (mylm <- lm(df)) (mysum <- summary(mylm)) 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 } bitmap(file='test0.png') 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() bitmap(file='test1.png') plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') grid() dev.off() bitmap(file='test2.png') hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') grid() dev.off() bitmap(file='test3.png') densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') dev.off() bitmap(file='test4.png') qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') qqline(mysum$resid) grid() dev.off() (myerror <- as.ts(mysum$resid)) bitmap(file='test5.png') dum <- cbind(lag(myerror,k=1),myerror) dum dum1 <- dum[2:length(myerror),] dum1 z <- as.data.frame(dum1) z 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() bitmap(file='test6.png') acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') grid() dev.off() bitmap(file='test7.png') pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') grid() dev.off() bitmap(file='test8.png') opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) plot(mylm, las = 1, sub='Residual Diagnostics') par(opar) dev.off() if (n > n25) { bitmap(file='test9.png') plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') grid() dev.off() } load(file='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, signif(mysum$coefficients[i,1],6), 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='mytable1.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<br />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,signif(mysum$coefficients[i,1],6)) a<-table.element(a, signif(mysum$coefficients[i,2],6)) a<-table.element(a, signif(mysum$coefficients[i,3],4)) a<-table.element(a, signif(mysum$coefficients[i,4],6)) a<-table.element(a, signif(mysum$coefficients[i,4]/2,6)) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable2.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, signif(sqrt(mysum$r.squared),6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'R-squared',1,TRUE) a<-table.element(a, signif(mysum$r.squared,6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Adjusted R-squared',1,TRUE) a<-table.element(a, signif(mysum$adj.r.squared,6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (value)',1,TRUE) a<-table.element(a, signif(mysum$fstatistic[1],6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) a<-table.element(a, signif(mysum$fstatistic[2],6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) a<-table.element(a, signif(mysum$fstatistic[3],6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'p-value',1,TRUE) a<-table.element(a, signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6)) 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, signif(mysum$sigma,6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Sum Squared Residuals',1,TRUE) a<-table.element(a, signif(sum(myerror*myerror),6)) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable3.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<br />Forecast', 1, TRUE) a<-table.element(a, 'Residuals<br />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,signif(x[i],6)) a<-table.element(a,signif(x[i]-mysum$resid[i],6)) a<-table.element(a,signif(mysum$resid[i],6)) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable4.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,signif(gqarr[mypoint-kp3+1,1],6)) a<-table.element(a,signif(gqarr[mypoint-kp3+1,2],6)) a<-table.element(a,signif(gqarr[mypoint-kp3+1,3],6)) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable5.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,signif(numsignificant1,6)) a<-table.element(a,signif(numsignificant1/numgqtests,6)) 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,signif(numsignificant5,6)) a<-table.element(a,signif(numsignificant5/numgqtests,6)) 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,signif(numsignificant10,6)) a<-table.element(a,signif(numsignificant10/numgqtests,6)) 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='mytable6.tab') }
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation