Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
11.5 8 350 165 3693 11 8 318 150 3436 10.5 8 302 140 3449 10 8 429 198 4341 8.5 8 440 215 4312 10 8 455 225 4425 10 8 383 170 3563 8 8 340 160 3609 10 8 455 225 3086 15 4 113 95 2372 15.5 6 199 97 2774 20.5 4 97 46 1835 17.5 4 110 87 2672 17.5 4 104 95 2375 12.5 4 121 113 2234 14 8 360 215 4615 15 8 307 200 4376 18.5 8 304 193 4732 14.5 4 97 88 2130 14 4 113 95 2228 15.5 6 250 100 3329 15.5 6 232 100 3288 12 8 350 165 4209 13 8 318 150 4096 12 8 400 170 4746 12 8 400 175 5140 19 4 140 72 2408 15 6 250 100 3282 14 4 122 86 2220 14 4 116 90 2123 14.5 4 88 76 2065 19 4 71 65 1773 19 4 97 60 1834 20.5 4 91 70 1955 17 4 97.5 80 2126 16.5 4 122 86 2226 12 8 350 165 4274 13.5 8 318 150 4135 13 8 351 153 4129 11 8 429 208 4633 13.5 8 350 155 4502 12.5 8 400 190 4422 13.5 3 70 97 2330 14 8 307 130 4098 16 8 302 140 4294 14.5 4 121 112 2933 18 4 121 76 2511 16 4 122 86 2395 14.5 4 120 97 2506 15 4 98 80 2164 13 8 350 175 4100 11.5 8 304 150 3672 14.5 8 302 137 4042 12.5 8 318 150 3777 12 8 400 150 4464 13 8 351 158 4363 11 8 440 215 4735 11 8 455 225 4951 16.5 6 225 105 3121 18 6 250 100 3278 16.5 6 250 88 3021 16 6 198 95 2904 14 8 400 150 4997 12.5 8 350 180 4499 15 6 232 100 2789 19.5 4 140 72 2401 16.5 4 108 94 2379 18.5 4 122 85 2310 14 6 155 107 2472 13 8 350 145 4082 9.5 8 400 230 4278 15.5 4 116 75 2158 14 4 114 91 2582 11 8 318 150 3399 14 4 121 110 2660 11 8 350 180 3664 16.5 6 198 95 3102 16 6 232 100 2901 16.5 4 122 80 2451 21 4 71 65 1836 17 6 250 100 3781 18 6 258 110 3632 14 8 302 140 4141 14.5 8 350 150 4699 16 8 302 140 4638 15.5 8 304 150 4257 15.5 4 79 67 1963 14.5 4 97 78 2300 19 4 83 61 2003 14.5 4 90 75 2125 14 4 116 75 2246 15 4 120 97 2489 16 4 79 67 2000 16 6 225 95 3264 19.5 6 250 72 3158 11.5 8 400 170 4668 14 8 350 145 4440 13.5 8 351 148 4657 21 6 231 110 3907 19 6 258 110 3730 19 6 225 95 3785 13.5 8 262 110 3221 12 8 302 129 3169 17 4 140 83 2639 16 6 232 100 2914 13.5 4 134 96 2702 16.5 4 90 71 2223 14.5 6 171 97 2984 15 4 115 95 2694 17 4 120 88 2957 13.5 4 121 115 2671 17.5 4 91 53 1795 16.9 4 116 81 2220 14.9 4 140 92 2572 15.3 4 101 83 2202 13 8 305 140 4215 13.9 8 304 120 3962 12.8 8 351 152 4215 14.5 6 250 105 3353 17.6 6 200 81 3012 22.2 4 85 52 2035 22.1 4 98 60 2164 17.7 6 225 100 3651 16.2 6 250 110 3645 17.8 6 258 95 3193 17 4 85 70 1990 16.4 4 97 75 2155 15.7 4 130 102 3150 13.2 8 318 150 3940 16.7 6 168 120 3820 12.1 8 350 180 4380 15 8 302 130 3870 14 8 318 150 3755 14.8 4 111 80 2155 18.6 4 79 58 1825 16.8 4 85 70 1945 12.5 8 305 145 3880 13.7 8 318 145 4140 16.9 6 231 105 3425 17.7 6 225 100 3630 11.1 8 400 180 4220 11.4 8 350 170 4165 14.5 8 351 149 4335 14.5 4 97 78 1940 18.2 4 97 75 2265 15.8 4 140 89 2755 15.9 4 98 83 2075 16.4 4 97 67 1985 14.5 6 146 97 2815 12.8 4 121 110 2600 21.5 4 90 48 1985 14.4 4 98 66 1800 18.6 4 85 70 2070 13.2 8 318 140 3735 12.8 8 302 139 3570 18.2 6 200 95 3155 15.8 6 200 85 2965 17.2 6 225 100 3430 17.2 6 232 90 3210 16.7 6 200 85 3070 18.7 6 225 110 3620 13.2 8 305 145 3425 13.4 6 231 165 3445 13.7 8 318 140 4080 16.5 4 98 68 2155 14.7 4 119 97 2300 14.5 4 105 75 2230 17.6 4 151 85 2855 15.9 5 131 103 2830 13.6 6 163 125 3140 15.8 6 163 133 3410 14.9 4 89 71 1990 16.6 4 98 68 2135 18.2 6 200 85 2990 17.3 4 140 88 2890 16.6 6 225 110 3360 15.4 8 305 130 3840 13.2 8 351 138 3955 15.2 8 318 135 3830 14.3 8 351 142 4054 15 8 267 125 3605 14 4 89 71 1925 15.2 4 86 65 1975 15 4 121 80 2670 24.8 4 141 71 3190 22.2 8 260 90 3420 14.9 4 105 70 2150 19.2 4 85 65 2020 16 4 151 90 2670 11.3 6 173 115 2595 13.2 4 151 90 2556 14.7 4 98 76 2144 15.5 4 98 70 2120 16.4 4 86 65 2019 18.1 4 140 88 2870 20.1 4 151 90 3003 15.8 4 97 78 2188 15.5 4 134 90 2711 15 4 119 92 2434 15.2 4 108 75 2265 14.4 4 156 105 2800 19.2 4 85 65 2110 19.9 5 121 67 2950 13.8 4 91 67 1850 15.3 4 89 62 1845 15.1 4 122 88 2500 15.7 4 135 84 2490 16.4 4 151 84 2635 12.6 6 173 110 2725 12.9 4 135 84 2385 16.4 4 86 64 1875 16.1 4 81 60 1760 19.4 4 85 65 1975 17.3 4 89 62 2050 14.9 4 105 63 2215 16.2 4 98 65 2045 14.2 4 105 74 2190 14.8 4 119 100 2615 20.4 4 141 80 3230 13.8 6 146 120 2930 15.8 6 231 110 3415 17.1 6 200 88 3060 16.6 6 225 85 3465 18.6 4 112 88 2640 18 4 112 88 2395 16 4 135 84 2525 18 4 151 90 2735 15.3 4 105 74 1980 17.6 4 91 68 1970 14.7 4 105 63 2125 14.5 4 120 88 2160 14.5 4 107 75 2205 15.7 4 91 67 1965 16.4 6 181 110 2945 17 6 262 85 3015 13.9 4 144 96 2665 17.3 4 151 90 2950 15.6 4 140 86 2790 11.6 4 135 84 2295 18.6 4 120 79 2625
Names of X columns:
acceleration cylinders enginedisplacement horesepower weight
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, 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