Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
0 1149822 1 0 0 1086979 2 0 0 1276674 3 0 0 1522522 4 0 0 1742117 5 0 0 1737275 6 0 0 1979900 7 0 0 2061036 8 0 0 1867943 9 0 0 1707752 10 0 0 1298756 11 0 0 1281814 12 0 0 1281151 13 0 0 1164976 14 0 0 1454329 15 0 0 1645288 16 0 0 1817743 17 0 0 1895785 18 0 0 2236311 19 0 0 2295951 20 0 0 2087315 21 0 0 1980891 22 0 0 1465446 23 0 0 1445026 24 0 0 1488120 25 0 0 1338333 26 0 0 1715789 27 0 0 1806090 28 0 0 2083316 29 0 0 2092278 30 0 0 2430800 31 0 0 2424894 32 0 0 2299016 33 0 0 2130688 34 0 0 1652221 35 0 0 1608162 36 0 0 1647074 37 0 0 1479691 38 0 0 1884978 39 0 0 2007898 40 0 0 2208954 41 0 0 2217164 42 0 0 2534291 43 0 0 2560312 44 0 0 2429069 45 0 0 2315077 46 0 0 1799608 47 0 0 1772590 48 0 0 1744799 49 0 0 1659093 50 0 0 2099821 51 0 0 2135736 52 0 0 2427894 53 0 0 2468882 54 0 0 2703217 55 0 0 2766841 56 0 0 2655236 57 0 0 2550373 58 0 0 2052097 59 0 0 1998055 60 0 0 1920748 61 0 0 1876694 62 0 0 2380930 63 0 0 2467402 64 0 0 2770771 65 0 0 2781340 66 0 0 3143926 67 0 0 3172235 68 0 0 2952540 69 0 0 2920877 70 0 0 2384552 71 0 0 2248987 72 0 0 2208616 73 0 0 2178756 74 0 0 2632870 75 0 0 2706905 76 0 0 3029745 77 0 0 3015402 78 0 0 3391414 79 0 0 3507805 80 0 0 3177852 81 0 0 3142961 82 0 0 2545815 83 0 0 2414007 84 0 0 2372578 85 0 0 2332664 86 0 0 2825328 87 0 0 2901478 88 0 0 3263955 89 0 0 3226738 90 0 0 3610786 91 0 0 3709274 92 0 0 3467185 93 0 0 3449646 94 0 0 2802951 95 0 0 2462530 96 0 0 2490645 97 0 0 2561520 98 0 0 3067554 99 0 0 3226951 100 0 0 3546493 101 0 0 3492787 102 0 0 3952263 103 0 0 3932072 104 0 0 3720284 105 0 0 3651555 106 0 0 2914972 107 0 0 2713514 108 0 0 2703997 109 0 0 2591373 110 0 0 3163748 111 0 0 3355137 112 0 0 3613702 113 0 0 3686773 114 0 0 4098716 115 0 0 4063517 116 0 1 3551489 117 117 1 3226663 118 118 1 2656842 119 119 1 2597484 120 120 1 2572399 121 121 1 2596631 122 122 1 3165225 123 123 1 3303145 124 124 1 3698247 125 125 1 3668631 126 126 1 4130433 127 127 1 4131400 128 128 1 3864358 129 129 1 3721110 130 130 1 2892532 131 131 1 2843451 132 132 1 2747502 133 133 1 2668775 134 134 1 3018602 135 135 1 3013392 136 136 1 3393657 137 137 1 3544233 138 138 1 4075832 139 139 1 4032923 140 140 1 3734509 141 141 1 3761285 142 142 1 2970090 143 143 1 2847849 144 144 1 2741680 145 145 1 2830639 146 146 1 3257673 147 147 1 3480085 148 148 1 3843271 149 149 1 3796961 150 150 1 4337767 151 151 1 4243630 152 152 1 3927202 153 153 1 3915296 154 154 1 3087396 155 155 1 2963792 156 156 1 2955792 157 157 1 2829925 158 158 1 3281195 159 159 1 3548011 160 160 1 4059648 161 161 1 3941175 162 162 1 4528594 163 163 1 4433151 164 164 1 4145737 165 165 1 4077132 166 166 1 3198519 167 167 1 3078660 168 168 1 3028202 169 169 1 2858642 170 170 1 3398954 171 171 1 3808883 172 172 1 4175961 173 173 1 4227542 174 174 1 4744616 175 175 1 4608012 176 176 1 4295049 177 177 1 4201144 178 178 1 3353276 179 179 1 3286851 180 180 1 3169889 181 181 1 3051720 182 182 1 3695426 183 183 1 3905501 184 184 1 4296458 185 185 1 4246247 186 186 1 4921849 187 187 1 4821446 188 188 1 4425064 189 189 1 4379099 190 190 1 3472889 191 191 1 3359160 192 192 1 3200944 193 193 1 3153170 194 194 1 3741498 195 195 1 3918719 196 196 1 4403449 197 197 1 4400407 198 198 1 4847473 199 199 1 4716136 200 200 1 4297440 201 201 1 4272253 202 202 1 3271834 203 203 1 3168388 204 204 1 2911748 205 205 1 2720999 206 206 1 3199918 207 207 1 3672623 208 208 1 3892013 209 209 1 3850845 210 210 1 4532467 211 211 1 4484739 212 212 1 4014972 213 213 1 3983758 214 214 1 3158459 215 215 1 3100569 216 216 1 2935404 217 217 1 2855719 218 218 1 3465611 219 219 1 3006985 220 220 1 4095110 221 221 1 4104793 222 222 1 4730788 223 223 1 4642726 224 224 1 4246919 225 225 1 4308117 226 226
Names of X columns:
9/11 Yt t 9/11_t
Sample Range:
(leave blank to include all observations)
From:
To:
Column Number of Endogenous Series
(?)
Fixed Seasonal Effects
Include Monthly 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, mysum$coefficients[i,1], 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,mysum$coefficients[i,1]) a<-table.element(a, round(mysum$coefficients[i,2],6)) a<-table.element(a, round(mysum$coefficients[i,3],4)) a<-table.element(a, round(mysum$coefficients[i,4],6)) a<-table.element(a, round(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, sqrt(mysum$r.squared)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'R-squared',1,TRUE) a<-table.element(a, mysum$r.squared) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Adjusted R-squared',1,TRUE) a<-table.element(a, mysum$adj.r.squared) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (value)',1,TRUE) a<-table.element(a, mysum$fstatistic[1]) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) a<-table.element(a, mysum$fstatistic[2]) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) a<-table.element(a, mysum$fstatistic[3]) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'p-value',1,TRUE) a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) 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, mysum$sigma) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Sum Squared Residuals',1,TRUE) a<-table.element(a, sum(myerror*myerror)) 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,x[i]) a<-table.element(a,x[i]-mysum$resid[i]) a<-table.element(a,mysum$resid[i]) 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,gqarr[mypoint-kp3+1,1]) a<-table.element(a,gqarr[mypoint-kp3+1,2]) a<-table.element(a,gqarr[mypoint-kp3+1,3]) 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,numsignificant1) a<-table.element(a,numsignificant1/numgqtests) 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,numsignificant5) a<-table.element(a,numsignificant5/numgqtests) 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,numsignificant10) a<-table.element(a,numsignificant10/numgqtests) 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