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