Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
26 50 4 13 12 21 149 57 62 4 8 8 22 139 37 54 5 14 11 22 148 67 71 4 16 13 18 158 43 54 4 14 11 23 128 52 65 9 13 10 12 224 52 73 8 15 7 20 159 43 52 11 13 10 22 105 84 84 4 20 15 21 159 67 42 4 17 12 19 167 49 66 6 15 12 22 165 70 65 4 16 10 15 159 52 78 8 12 10 20 119 58 73 4 17 14 19 176 68 75 4 11 6 18 54 62 72 11 16 12 15 91 43 66 4 16 14 20 163 56 70 4 15 11 21 124 56 61 6 13 8 21 137 74 81 6 14 12 15 121 65 71 4 19 15 16 153 63 69 8 16 13 23 148 58 71 5 17 11 21 221 57 72 4 10 12 18 188 63 68 9 15 7 25 149 53 70 4 14 11 9 244 57 68 7 14 7 30 148 51 61 10 16 12 20 92 64 67 4 15 12 23 150 53 76 4 17 13 16 153 29 70 7 14 9 16 94 54 60 12 16 11 19 156 58 72 7 15 12 25 132 43 69 5 16 15 18 161 51 71 8 16 12 23 105 53 62 5 10 6 21 97 54 70 4 8 5 10 151 56 64 9 17 13 14 131 61 58 7 14 11 22 166 47 76 4 10 6 26 157 39 52 4 14 12 23 111 48 59 4 12 10 23 145 50 68 4 16 6 24 162 35 76 4 16 12 24 163 30 65 7 16 11 18 59 68 67 4 8 6 23 187 49 59 7 16 12 15 109 61 69 4 15 12 19 90 67 76 4 8 8 16 105 47 63 4 13 10 25 83 56 75 4 14 11 23 116 50 63 8 13 7 17 42 43 60 4 16 12 19 148 67 73 4 19 13 21 155 62 63 4 19 14 18 125 57 70 4 14 12 27 116 41 75 7 15 6 21 128 54 66 12 13 14 13 138 45 63 4 10 10 8 49 48 63 4 16 12 29 96 61 64 4 15 11 28 164 56 70 5 11 10 23 162 41 75 15 9 7 21 99 43 61 5 16 12 19 202 53 60 10 12 7 19 186 44 62 9 12 12 20 66 66 73 8 14 12 18 183 58 61 4 14 10 19 214 46 66 5 13 10 17 188 37 64 4 15 12 19 104 51 59 9 17 12 25 177 51 64 4 14 12 19 126 56 60 10 11 8 22 76 66 56 4 9 10 23 99 37 78 4 7 5 14 139 42 67 7 15 10 16 162 38 59 5 12 12 24 108 66 66 4 15 11 20 159 34 68 4 14 9 12 74 53 71 4 16 12 24 110 49 66 4 14 11 22 96 55 73 4 13 10 12 116 49 72 4 16 12 22 87 59 71 6 13 10 20 97 40 59 10 16 9 10 127 58 64 7 16 11 23 106 60 66 4 16 12 17 80 63 78 4 10 7 22 74 56 68 7 12 11 24 91 54 73 4 12 12 18 133 52 62 8 12 6 21 74 34 65 11 12 9 20 114 69 68 6 19 15 20 140 32 65 14 14 10 22 95 48 60 5 13 11 19 98 67 71 4 16 12 20 121 58 65 8 15 12 26 126 57 68 9 12 12 23 98 42 64 4 8 11 24 95 64 74 4 10 9 21 110 58 69 5 16 11 21 70 66 76 4 16 12 19 102 26 68 5 10 12 8 86 61 72 4 18 14 17 130 52 67 4 12 8 20 96 51 63 7 16 10 11 102 55 59 10 10 9 8 100 50 73 4 14 10 15 94 60 66 5 12 9 18 52 56 62 4 11 10 18 98 63 69 4 15 12 19 118 61 66 4 7 11 19 99 52 51 6 16 9 23 48 16 56 4 16 11 22 50 46 67 8 16 12 21 150 56 69 5 16 12 25 154 52 57 4 12 7 30 109 55 56 17 15 12 17 68 50 55 4 14 12 27 194 59 63 4 15 12 23 158 60 67 8 16 10 23 159 52 65 4 13 15 18 67 44 47 7 10 10 18 147 67 76 4 17 15 23 39 52 64 4 15 10 19 100 55 68 5 18 15 15 111 37 64 7 16 9 20 138 54 65 4 20 15 16 101 72 71 4 16 12 24 131 51 63 7 17 13 25 101 48 60 11 16 12 25 114 60 68 7 15 12 19 165 50 72 4 13 8 19 114 63 70 4 16 9 16 111 33 61 4 16 15 19 75 67 61 4 16 12 19 82 46 62 4 17 12 23 121 54 71 4 20 15 21 32 59 71 6 14 11 22 150 61 51 8 17 12 19 117 33 56 23 6 6 20 71 47 70 4 16 14 20 165 69 73 8 15 12 3 154 52 76 6 16 12 23 126 55 68 4 16 12 23 149 41 48 7 14 11 20 145 73 52 4 16 12 15 120 52 60 4 16 12 16 109 50 59 4 16 12 7 132 51 57 10 14 12 24 172 60 79 6 14 8 17 169 56 60 5 16 8 24 114 56 60 5 16 12 24 156 29 59 4 15 12 19 172 66 62 4 16 11 25 68 66 59 5 16 10 20 89 73 61 5 18 11 28 167 55 71 5 15 12 23 113 64 57 5 16 13 27 115 40 66 4 16 12 18 78 46 63 6 16 12 28 118 58 69 4 17 10 21 87 43 58 4 14 10 19 173 61 59 4 18 11 23 2 51 48 9 9 8 27 162 50 66 18 15 12 22 49 52 73 6 14 9 28 122 54 67 5 15 12 25 96 66 61 4 13 9 21 100 61 68 11 16 11 22 82 80 75 4 20 15 28 100 51 62 10 14 8 20 115 56 69 6 12 8 29 141 56 58 8 15 11 25 165 56 60 8 15 11 25 165 53 74 6 15 11 20 110 47 55 8 16 13 20 118 25 62 4 11 7 16 158 47 63 4 16 12 20 146 46 69 9 7 8 20 49 50 58 9 11 8 23 90 39 58 5 9 4 18 121 51 68 4 15 11 25 155 58 72 4 16 10 18 104 35 62 15 14 7 19 147 58 62 10 15 12 25 110 60 65 9 13 11 25 108 62 69 7 13 9 25 113 63 66 9 12 10 24 115 53 72 6 16 8 19 61 46 62 4 14 8 26 60 67 75 7 16 11 10 109 59 58 4 14 12 17 68 64 66 7 15 10 13 111 38 55 4 10 10 17 77 50 47 15 16 12 30 73 48 72 4 14 8 25 151 48 62 9 16 11 4 89 47 64 4 12 8 16 78 66 64 4 16 10 21 110 47 19 28 16 14 23 220 63 50 4 15 9 22 65 58 68 4 14 9 17 141 44 70 4 16 10 20 117 51 79 5 11 13 20 122 43 69 4 15 12 22 63 55 71 4 18 13 16 44 38 48 12 13 8 23 52 45 73 4 7 3 0 131 50 74 6 7 8 18 101 54 66 6 17 12 25 42 57 71 5 18 11 23 152 60 74 4 15 9 12 107 55 78 4 8 12 18 77 56 75 4 13 12 24 154 49 53 10 13 12 11 103 37 60 7 15 10 18 96 59 70 4 18 13 23 175 46 69 7 16 9 24 57 51 65 4 14 12 29 112 58 78 4 15 11 18 143 64 78 12 19 14 15 49 53 59 5 16 11 29 110 48 72 8 12 9 16 131 51 70 6 16 12 19 167 47 63 17 11 8 22 56 59 63 4 16 15 16 137 62 71 5 15 12 23 86 62 74 4 19 14 23 121 51 67 5 15 12 19 149 64 66 5 14 9 4 168 52 62 6 14 9 20 140 67 80 4 17 13 24 88 50 73 4 16 13 20 168 54 67 4 20 15 4 94 58 61 6 16 11 24 51 56 73 8 9 7 22 48 63 74 10 13 10 16 145 31 32 4 15 11 3 66 65 69 5 19 14 15 85 71 69 4 16 14 24 109 50 84 4 17 13 17 63 57 64 4 16 12 20 102 47 58 16 9 8 27 162 47 59 7 11 13 26 86 57 78 4 14 9 23 114 43 57 4 19 12 17 164 41 60 14 13 13 20 119 63 68 5 14 11 22 126 63 68 5 15 11 19 132 56 73 5 15 13 24 142 51 69 5 14 12 19 83 50 67 7 16 12 23 94 22 60 19 17 10 15 81 41 65 16 12 9 27 166 59 66 4 15 10 26 110 56 74 4 17 13 22 64 66 81 7 15 13 22 93 53 72 9 10 9 18 104 42 55 5 16 11 15 105 52 49 14 15 12 22 49 54 74 4 11 8 27 88 44 53 16 16 12 10 95 62 64 10 16 12 20 102 53 65 5 16 12 17 99 50 57 6 14 9 23 63 36 51 4 14 12 19 76 76 80 4 16 12 13 109 66 67 4 16 11 27 117 62 70 5 18 12 23 57 59 74 4 14 6 16 120 47 75 4 20 7 25 73 55 70 5 15 10 2 91 58 69 4 16 12 26 108 60 65 4 16 10 20 105 44 55 5 16 12 23 117 57 71 8 12 9 22 119
Names of X columns:
AMS.I AMS.E AMS.A CONFSTATTOT CONFSOFTTOT NUMERACYTOT LFM
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
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