Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
11 8 7 149 96 12.9 15 18 18 152 75 7.4 19 18 20 139 70 12.2 16 12 9 148 88 12.8 24 24 19 158 114 7.4 15 16 12 128 69 6.7 17 19 16 224 176 12.6 19 16 17 159 114 14.8 19 15 9 105 121 13.3 28 28 28 159 110 11.1 26 21 20 167 158 8.2 15 18 16 165 116 11.4 26 22 22 159 181 6.4 16 19 17 119 77 10.6 24 22 12 176 141 12 25 25 18 54 35 6.3 22 20 20 91 80 11.3 15 16 12 163 152 11.9 21 19 16 124 97 9.3 22 18 16 137 99 9.6 27 26 21 121 84 10 26 24 15 153 68 6.4 26 20 17 148 101 13.8 22 19 17 221 107 10.8 21 19 17 188 88 13.8 22 23 18 149 112 11.7 20 18 15 244 171 10.9 21 16 20 148 137 16.1 20 18 13 92 77 13.4 22 21 21 150 66 9.9 21 20 12 153 93 11.5 8 15 6 94 105 8.3 22 19 13 156 131 11.7 18 27 6 146 89 6.1 20 19 19 132 102 9 24 7 12 161 161 9.7 17 20 14 105 120 10.8 20 20 13 97 127 10.3 23 19 12 151 77 10.4 20 19 17 131 108 12.7 22 20 19 166 85 9.3 19 18 10 157 168 11.8 15 14 10 111 48 5.9 20 17 11 145 152 11.4 22 17 11 162 75 13 17 8 10 163 107 10.8 14 9 7 59 62 12.3 24 22 22 187 121 11.3 17 20 12 109 124 11.8 23 20 18 90 72 7.9 25 22 20 105 40 12.7 16 22 9 83 58 12.3 18 22 16 116 97 11.6 20 16 14 42 88 6.7 18 14 11 148 126 10.9 23 24 20 155 104 12.1 24 21 17 125 148 13.3 23 20 14 116 146 10.1 13 20 8 128 80 5.7 20 18 16 138 97 14.3 20 14 11 49 25 8 19 19 10 96 99 13.3 22 24 15 164 118 9.3 22 19 15 162 58 12.5 15 16 10 99 63 7.6 17 16 10 202 139 15.9 19 16 18 186 50 9.2 20 14 10 66 60 9.1 22 22 22 183 152 11.1 21 21 16 214 142 13 21 15 10 188 94 14.5 16 14 7 104 66 12.2 20 15 16 177 127 12.3 21 14 16 126 67 11.4 20 20 16 76 90 8.8 23 21 22 99 75 14.6 15 17 13 157 96 7.3 18 14 5 139 128 12.6 16 16 10 162 146 13 17 13 8 108 69 12.6 24 26 16 159 186 13.2 13 13 8 74 81 9.9 19 18 16 110 85 7.7 20 15 14 96 54 10.5 22 18 15 116 46 13.4 19 21 9 87 106 10.9 21 17 21 97 34 4.3 15 18 7 127 60 10.3 21 20 17 106 95 11.8 24 18 18 80 57 11.2 22 25 16 74 62 11.4 20 20 16 91 36 8.6 21 19 14 133 56 13.2 19 18 15 74 54 12.6 14 12 8 114 64 5.6 25 22 22 140 76 9.9 11 16 5 95 98 8.8 17 18 13 98 88 7.7 22 23 22 121 35 9 20 20 18 126 102 7.3 22 20 15 98 61 11.4 15 16 11 95 80 13.6 23 22 19 110 49 7.9 20 19 19 70 78 10.7 22 23 21 102 90 10.3 16 6 4 86 45 8.3 25 19 17 130 55 9.6 18 24 10 96 96 14.2 19 19 13 102 43 8.5 25 15 15 100 52 13.5 21 18 11 94 60 4.9 22 18 20 52 54 6.4 21 22 13 98 51 9.6 22 23 18 118 51 11.6 23 18 20 99 38 11.1 20 17 15 48 41 4.35 6 6 4 50 146 12.7 15 22 9 150 182 18.1 18 20 18 154 192 17.85 24 16 12 109 263 16.6 22 16 17 68 35 12.6 21 17 12 194 439 17.1 23 20 16 158 214 19.1 20 23 17 159 341 16.1 20 18 14 67 58 13.35 18 13 13 147 292 18.4 25 22 20 39 85 14.7 16 20 16 100 200 10.6 20 20 15 111 158 12.6 14 13 10 138 199 16.2 22 16 16 101 297 13.6 26 25 21 131 227 18.9 20 16 15 101 108 14.1 17 15 16 114 86 14.5 22 19 19 165 302 16.15 22 19 9 114 148 14.75 20 24 19 111 178 14.8 17 9 7 75 120 12.45 22 22 23 82 207 12.65 17 15 14 121 157 17.35 22 22 10 32 128 8.6 21 22 16 150 296 18.4 25 24 12 117 323 16.1 11 12 10 71 79 11.6 19 21 7 165 70 17.75 24 25 20 154 146 15.25 17 26 9 126 246 17.65 22 19 14 138 145 15.6 22 21 12 149 196 16.35 17 14 10 145 199 17.65 26 28 19 120 127 13.6 19 16 16 138 91 11.7 20 21 11 109 153 14.35 19 16 15 132 299 14.75 21 16 14 172 228 18.25 24 25 11 169 190 9.9 21 21 14 114 180 16 19 22 15 156 212 18.25 13 9 7 172 269 16.85 24 20 22 68 130 14.6 28 19 19 89 179 13.85 27 24 22 167 243 18.95 22 22 11 113 190 15.6 23 22 19 115 299 14.85 19 12 9 78 121 11.75 18 17 11 118 137 18.45 23 18 17 87 305 15.9 21 10 12 173 157 17.1 22 22 17 2 96 16.1 17 24 10 162 183 19.9 15 18 17 49 52 10.95 21 18 13 122 238 18.45 20 23 11 96 40 15.1 26 21 19 100 226 15 19 21 21 82 190 11.35 28 28 24 100 214 15.95 21 17 13 115 145 18.1 19 21 16 141 119 14.6 22 21 13 165 222 15.4 21 20 15 165 222 15.4 20 18 15 110 159 17.6 19 17 11 118 165 13.35 11 7 7 158 249 19.1 17 17 13 146 125 15.35 19 14 13 49 122 7.6 20 18 12 90 186 13.4 17 14 8 121 148 13.9 21 23 7 155 274 19.1 21 20 17 104 172 15.25 12 14 9 147 84 12.9 23 17 18 110 168 16.1 22 21 17 108 102 17.35 22 23 17 113 106 13.15 21 24 18 115 2 12.15 20 21 12 61 139 12.6 18 14 14 60 95 10.35 21 24 22 109 130 15.4 24 16 19 68 72 9.6 22 21 21 111 141 18.2 20 8 10 77 113 13.6 17 17 16 73 206 14.85 19 18 11 151 268 14.75 16 17 15 89 175 14.1 19 16 12 78 77 14.9 23 22 21 110 125 16.25 8 17 22 220 255 19.25 22 21 20 65 111 13.6 23 20 15 141 132 13.6 15 20 9 117 211 15.65 17 19 15 122 92 12.75 21 8 14 63 76 14.6 25 19 11 44 171 9.85 18 11 9 52 83 12.65 23 15 18 62 119 11.9 20 13 12 131 266 19.2 21 18 11 101 186 16.6 21 19 14 42 50 11.2 24 23 10 152 117 15.25 22 20 18 107 219 11.9 22 22 11 77 246 13.2 23 19 14 154 279 16.35 17 16 16 103 148 12.4 15 11 11 96 137 15.85 24 11 8 154 130 14.35 22 21 16 175 181 18.15 19 14 13 57 98 11.15 18 21 12 112 226 15.65 21 20 17 143 234 17.75 20 21 23 49 138 7.65 19 20 14 110 85 12.35 19 19 10 131 66 15.6 16 19 16 167 236 19.3 18 18 11 56 106 15.2 23 20 16 137 135 17.1 22 21 19 86 122 15.6 23 22 17 121 218 18.4 20 19 12 149 199 19.05 24 23 17 168 112 18.55 25 16 11 140 278 19.1 25 23 19 88 94 13.1 20 18 12 168 113 12.85 23 23 8 94 84 9.5 21 20 17 51 86 4.5 23 20 13 48 62 11.85 23 23 17 145 222 13.6 11 13 7 66 167 11.7 21 21 23 85 82 12.4 27 26 18 109 207 13.35 19 18 13 63 184 11.4 21 19 17 102 83 14.9 16 18 13 162 183 19.9 22 19 13 128 85 17.75 21 18 8 86 89 11.2 22 19 16 114 225 14.6 16 13 14 164 237 17.6 18 10 13 119 102 14.05 23 21 19 126 221 16.1 24 24 15 132 128 13.35 20 21 15 142 91 11.85 20 23 8 83 198 11.95 18 18 14 94 204 14.75 4 11 7 81 158 15.15 14 16 11 166 138 13.2 22 20 17 110 226 16.85 17 20 19 64 44 7.85 23 26 17 93 196 7.7 20 21 12 104 83 12.6 18 12 12 105 79 7.85 19 15 18 49 52 10.95 20 18 16 88 105 12.35 15 14 15 95 116 9.95 24 18 20 102 83 14.9 21 16 16 99 196 16.65 19 19 12 63 153 13.4 19 7 10 76 157 13.95 27 21 28 109 75 15.7 23 24 19 117 106 16.85 23 21 18 57 58 10.95 20 20 19 120 75 15.35 17 22 8 73 74 12.2 21 17 17 91 185 15.1 23 19 16 108 265 17.75 22 20 18 105 131 15.2 16 16 12 117 139 14.6 20 20 17 119 196 16.65 16 16 13 31 78 8.1
Names of X columns:
A B C D E F
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
par3 <- 'No Linear Trend' par2 <- 'Do not include Seasonal Dummies' par1 <- '6' 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
1 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation