Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
12.9 11 8 7 18 12 20 21 12 149 18 68 1.8 12.2 19 18 20 23 20 19 22 8 139 31 39 2.1 12.8 16 12 9 22 14 18 21 11 148 39 32 2.2 7.4 24 24 19 22 25 24 21 13 158 46 62 2.3 6.7 15 16 12 19 15 20 21 11 128 31 33 2.1 12.6 17 19 16 25 20 20 21 10 224 67 52 2.7 14.8 19 16 17 28 21 24 21 7 159 35 62 2.1 13.3 19 15 9 16 15 21 23 10 105 52 77 2.4 11.1 28 28 28 28 28 28 22 15 159 77 76 2.9 8.2 26 21 20 21 11 10 25 12 167 37 41 2.2 11.4 15 18 16 22 22 22 21 12 165 32 48 2.1 6.4 26 22 22 24 22 19 23 10 159 36 63 2.2 10.6 16 19 17 24 27 27 22 10 119 38 30 2.2 12 24 22 12 26 24 23 21 14 176 69 78 2.7 6.3 25 25 18 28 23 24 21 6 54 21 19 1.9 11.9 15 16 12 20 21 25 21 14 163 54 66 2.5 9.3 21 19 16 26 20 24 21 11 124 36 35 2.2 10 27 26 21 28 25 28 24 12 121 23 45 1.9 6.4 26 24 15 27 16 28 23 15 153 34 21 2.1 13.8 26 20 17 23 24 22 21 13 148 112 25 3.5 10.8 22 19 17 24 21 26 24 11 221 35 44 2.1 13.8 21 19 17 24 22 26 23 12 188 47 69 2.3 11.7 22 23 18 22 25 21 21 7 149 47 54 2.3 10.9 20 18 15 21 23 26 22 11 244 37 74 2.2 9.9 22 21 21 21 22 24 21 12 150 20 61 1.9 11.5 21 20 12 26 25 25 22 13 153 22 41 1.9 8.3 8 15 6 23 23 24 22 9 94 23 46 1.9 11.7 22 19 13 21 19 20 21 11 156 32 39 2.1 9 20 19 19 27 21 24 21 12 132 30 34 2 9.7 24 7 12 25 19 25 25 15 161 92 51 3.2 10.8 17 20 14 23 25 23 22 12 105 43 42 2.3 10.3 20 20 13 25 16 21 22 6 97 55 31 2.5 10.4 23 19 12 23 24 23 20 5 151 16 39 1.8 9.3 22 20 19 22 18 18 21 11 166 71 49 2.8 11.8 19 18 10 24 28 24 21 6 157 43 53 2.3 5.9 15 14 10 19 15 18 22 12 111 29 31 2 11.4 20 17 11 21 17 21 21 10 145 56 39 2.5 13 22 17 11 27 18 23 24 6 162 46 54 2.3 10.8 17 8 10 25 26 25 22 12 163 19 49 1.8 11.3 24 22 22 23 22 22 21 6 187 59 46 2.6 11.8 17 20 12 17 19 23 22 12 109 30 55 2 12.7 25 22 20 25 26 25 22 8 105 7 50 1.6 10.9 18 14 11 24 12 24 23 12 148 19 30 1.8 13.3 24 21 17 20 20 23 23 14 125 48 45 2.4 10.1 23 20 14 19 24 27 21 12 116 23 35 1.9 14.3 20 18 16 21 22 23 21 14 138 33 41 2.1 9.3 22 24 15 18 23 23 22 11 164 34 73 2.1 12.5 22 19 15 27 19 24 21 10 162 48 17 2.4 7.6 15 16 10 25 24 26 21 7 99 18 40 1.8 15.9 17 16 10 20 21 20 21 12 202 43 64 2.3 9.2 19 16 18 21 16 23 21 7 186 33 37 2.1 11.1 22 22 22 27 23 23 21 12 183 71 65 2.8 13 21 21 16 24 20 17 22 10 214 26 100 2 14.5 21 15 10 27 19 20 22 10 188 67 28 2.7 12.3 20 15 16 23 18 18 21 12 177 80 56 2.9 11.4 21 14 16 24 21 19 23 12 126 29 29 2 12.6 18 14 5 27 25 26 21 5 139 32 50 2.1 NA 22 19 18 24 15 14 21 10 78 47 3 2.3 13 16 16 10 25 17 25 21 10 162 43 59 2.3 13.2 24 26 16 24 24 18 20 11 159 29 61 2 7.7 19 18 16 23 22 26 21 12 110 32 51 2.1 4.35 20 17 15 22 14 15 22 9 48 23 12 1 12.7 6 6 4 24 5 27 22 11 50 16 45 1 18.1 15 22 9 19 25 23 22 12 150 33 37 4 17.85 18 20 18 25 21 23 20 12 154 32 37 4 17.1 21 17 12 24 9 22 22 12 194 52 68 4 19.1 23 20 16 28 15 20 21 12 158 75 72 4 16.1 20 23 17 23 23 21 21 10 159 72 143 4 13.35 20 18 14 19 21 25 21 15 67 15 9 2 18.4 18 13 13 19 9 19 21 10 147 29 55 4 14.7 25 22 20 27 24 25 21 15 39 13 17 1 10.6 16 20 16 24 16 24 21 10 100 40 37 3 12.6 20 20 15 26 20 22 21 15 111 19 27 3 16.2 14 13 10 21 15 28 22 9 138 24 37 4 13.6 22 16 16 25 18 22 24 15 101 121 58 3 14.1 20 16 15 19 21 23 22 13 101 36 21 3 14.5 17 15 16 20 21 19 20 12 114 23 19 3 16.15 22 19 19 26 21 21 21 12 165 85 78 4 14.75 22 19 9 27 20 25 24 8 114 41 35 3 14.8 20 24 19 23 24 23 25 9 111 46 48 3 12.45 17 9 7 18 15 28 22 15 75 18 27 2 12.65 22 22 23 23 24 14 21 12 82 35 43 2 17.35 17 15 14 21 18 23 21 12 121 17 30 3 8.6 22 22 10 23 24 24 22 15 32 4 25 1 18.4 21 22 16 22 24 25 23 11 150 28 69 4 16.1 25 24 12 21 15 15 24 12 117 44 72 3 17.75 19 21 7 24 20 26 22 14 165 38 13 4 15.25 24 25 20 26 26 21 25 12 154 57 61 4 17.65 17 26 9 24 26 26 22 12 126 23 43 4 16.35 22 21 12 22 23 23 21 12 149 36 51 4 17.65 17 14 10 20 13 15 21 11 145 22 67 4 13.6 26 28 19 20 16 16 21 12 120 40 36 3 14.35 20 21 11 18 22 20 22 12 109 31 44 3 14.75 19 16 15 18 21 20 22 12 132 11 45 4 18.25 21 16 14 25 11 21 21 12 172 38 34 4 9.9 24 25 11 28 23 28 22 8 169 24 36 4 16 21 21 14 23 18 19 23 8 114 37 72 3 18.25 19 22 15 20 19 21 21 12 156 37 39 4 16.85 13 9 7 22 15 22 21 12 172 22 43 4 18.95 27 24 22 23 21 17 21 11 167 43 80 4 15.6 22 22 11 20 25 26 21 12 113 31 40 3 17.1 21 10 12 24 12 22 22 10 173 31 61 4 16.1 22 22 17 18 24 17 22 11 2 -4 23 1 15.4 22 21 13 23 19 16 21 11 165 21 29 4 15.4 21 20 15 21 21 18 21 11 165 21 29 4 13.35 19 17 11 19 19 17 25 13 118 32 54 3 19.1 11 7 7 19 18 25 21 7 158 26 43 4 7.6 19 14 13 25 23 21 25 8 49 32 20 1 19.1 21 23 7 18 23 27 22 11 155 33 61 4 14.75 19 18 11 22 27 23 21 8 151 30 57 4 19.25 8 17 22 5 6 8 23 14 220 67 54 4 13.6 23 20 15 24 22 22 20 9 141 22 36 4 12.75 17 19 15 28 23 28 22 13 122 33 16 4 9.85 25 19 11 27 20 24 25 13 44 24 40 1 15.25 24 23 10 23 23 25 20 11 152 28 27 4 11.9 22 20 18 24 27 23 21 9 107 41 61 3 16.35 23 19 14 25 24 26 21 12 154 31 69 4 12.4 17 16 16 19 12 22 23 12 103 33 34 3 18.15 22 21 16 24 24 22 22 13 175 21 34 4 17.75 21 20 17 28 24 26 21 11 143 52 34 4 12.35 19 20 14 19 19 21 21 11 110 29 13 3 15.6 19 19 10 23 28 21 21 9 131 11 12 4 19.3 16 19 16 23 23 24 21 12 167 26 51 4 17.1 23 20 16 26 19 18 21 15 137 7 19 4 18.4 23 22 17 25 23 26 21 14 121 13 81 3 19.05 20 19 12 24 20 23 21 12 149 20 42 4 18.55 24 23 17 23 18 25 22 9 168 52 22 4 19.1 25 16 11 22 20 20 21 9 140 28 85 4 12.85 20 18 12 26 21 26 22 13 168 39 25 4 9.5 23 23 8 23 25 19 22 15 94 9 22 2 4.5 21 20 17 22 18 21 22 11 51 19 19 1 13.6 23 23 17 22 28 24 22 10 145 60 45 4 11.7 11 13 7 17 9 6 23 11 66 19 45 2 13.35 27 26 18 22 26 21 22 14 109 14 51 3 17.6 16 13 14 26 12 19 21 12 164 -2 73 4 14.05 18 10 13 24 12 24 21 13 119 51 24 3 16.1 23 21 19 27 20 21 20 11 126 2 61 4 13.35 24 24 15 22 25 21 20 11 132 24 23 4 11.85 20 21 15 23 24 26 21 13 142 40 14 4 11.95 20 23 8 22 23 24 21 12 83 20 54 2 13.2 14 16 11 20 22 23 21 9 166 20 36 4 7.7 23 26 17 27 28 26 24 13 93 25 26 2 14.6 16 16 12 20 15 20 22 12 117 38 30 3
Names of X columns:
TOT AMS.I1 AMS.I2 AMS.I3 AMS.E1 AMS.E2 AMS.E3 age CONFSOFTTOT LFM PRH CH PR
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