Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
102750 0.06455399 45.498 95276 0.06363636 46.1773 112053 0.06512702 46.1937 98841 0.06490826 46.1272 123102 0.06605923 46.4199 118152 0.06900452 46.4535 101752 0.07110609 46.648 148219 0.07228381 46.5669 124966 0.07477876 46.9866 134741 0.07763158 47.2997 132168 0.08300654 47.548 100950 0.11406926 47.4375 96418 0.14399142 47.1083 86891 0.19258475 46.9634 89796 0.23179916 46.9733 119663 0.248125 46.83 130539 0.24300412 47.1848 120851 0.24102041 47.1292 145422 0.24473684 47.1505 150583 0.239 46.6882 127054 0.23063241 46.7161 137473 0.22700587 46.536 127094 0.22737864 45.0062 132080 0.2238921 43.4204 188311 0.22341651 42.8246 107487 0.22209524 41.8301 84669 0.22144213 41.3862 149184 0.22098299 41.4258 121026 0.21766917 41.3326 81073 0.21268657 41.6042 132947 0.21107011 42.0025 141294 0.20957643 42.4426 155077 0.20714286 42.9708 145154 0.20856102 43.1611 127094 0.21211573 43.2561 151414 0.2181982 43.7944 167858 0.21996403 44.4309 127070 0.22204301 44.8644 154692 0.22075134 44.916 170905 0.22139037 45.1733 127751 0.21893805 45.3729 173795 0.21778169 45.3841 190181 0.21698774 45.6491 198417 0.21655052 45.9698 183018 0.21666667 46.1015 171608 0.21502591 46.1172 188087 0.21689655 46.7939 197042 0.21632302 47.2798 208788 0.21435897 47.023 178111 0.22013536 47.7335 236455 0.22369748 48.3415 233219 0.22416667 48.7789 188106 0.22023217 49.2046 238876 0.22042834 49.5627 205148 0.21901639 49.6389 214727 0.21895425 49.6517 213428 0.21970684 49.8872 195128 0.21866883 49.9859 206047 0.22003231 50.0357 201773 0.21851852 50.1135 192772 0.21744 49.4201 198230 0.21430843 49.6618 181172 0.21246057 50.6053 189079 0.21079812 51.6639 179073 0.20713178 51.8472 197421 0.20506135 52.2056 195244 0.20395738 52.1834 219826 0.20318182 52.3807 211793 0.20105263 52.5124 203394 0.2 52.9384 209578 0.19896142 53.3363 214769 0.19881832 53.6296 226177 0.19970717 53.2837 191449 0.2015919 53.5675 200989 0.20716332 53.7364 216707 0.21133144 53.1571 192882 0.22755245 53.5566 199736 0.24011065 53.5534 202349 0.26087551 53.4808 204137 0.28590786 53.1195 215588 0.30013405 53.1786 229454 0.30757979 53.4617 175048 0.30658762 53.409 212799 0.32033898 53.4536 181727 0.33830334 53.7071 211607 0.36210393 53.7262 185853 0.38002497 53.5481 158277 0.38765432 52.4571 180695 0.38924205 51.1904 175959 0.38524788 50.5575 139550 0.39056832 50.166 155810 0.39531813 50.353 138305 0.38964286 51.1727 147014 0.39033019 51.8129 135994 0.38865497 52.7175 166455 0.39327926 53.0142 177737 0.39390805 52.7119 167021 0.40910125 52.4633 132134 0.40960452 52.7501 169834 0.41436588 52.5233 130599 0.40267261 52.8211 156836 0.40386313 53.0699 119749 0.38264192 53.4044 148996 0.37410618 53.3959 147491 0.36555794 53.0761 147216 0.36027837 52.6972 153455 0.36115261 52.0996 112004 0.36159574 51.5219 158512 0.37550371 50.4933 104139 0.3755814 51.4979 102536 0.36730159 51.1159 93017 0.34984194 50.6623 91988 0.33663883 50.3505 123616 0.33938144 50.1943 134498 0.34123077 50.0395 149812 0.33684749 49.6075 110334 0.3308478 49.4584 136639 0.33034623 49.011 102712 0.33510204 48.8232 112951 0.33237705 48.4682 107897 0.33231084 49.3992 73242 0.31787538 49.089 72800 0.3092952 49.4906 78767 0.29168357 50.0805 114791 0.28820565 50.4295 109351 0.28974874 50.7333 122520 0.28958959 51.5016 137338 0.29251497 52.0679 132061 0.29066534 52.8472 130607 0.29069307 53.2874 118570 0.28705534 53.4759 95873 0.28627838 53.7593 103116 0.27134446 54.8216 98619 0.26992187 55.0698 104178 0.27095517 55.3384 123468 0.2700291 55.6911 99651 0.26934236 55.9506 120264 0.26769527 56.1549 122795 0.26945245 56.3326 108524 0.264689 56.3847 105760 0.26085714 56.2832 117191 0.2617284 56.1943 122882 0.26163343 56.4108 93275 0.25925926 56.4759 99842 0.25952607 56.3801 83803 0.25386792 56.5796 61132 0.24483083 56.6645 118563 0.24808232 56.5122 106993 0.24967381 56.5982 118108 0.2464684 56.6317 99017 0.2403525 56.2637 99852 0.23851852 56.496 112720 0.23471837 56.7412 113636 0.23597056 56.508 118220 0.23568807 56.6984 128854 0.23824337 57.2954 123898 0.23540146 57.5555 100823 0.2116194 57.1707 115107 0.16636029 56.7784 90624 0.11767956 56.8228 132001 0.11239669 56.938 157969 0.10995434 56.7427 169333 0.10073059 57.0569 144907 0.09197812 56.9807 169346 0.10054446 57.0954 144666 0.1068903 57.3542 158829 0.11077899 57.623 127286 0.11221719 58.1006 120578 0.12464029 57.9173 129293 0.13862007 58.663 122371 0.14157003 58.7602 115176 0.14702751 59.1416 142168 0.14960212 59.517 153260 0.15251101 59.7996 173906 0.15615114 60.2152 178446 0.15795455 60.7146 155962 0.15208696 60.8781 168257 0.14926279 61.7569 149456 0.14835355 62.091 136105 0.14263432 62.394 141507 0.19360415 62.4207 152084 0.13103448 62.6908 145138 0.12223176 62.8421 146548 0.12134927 63.1885 173098 0.12502128 63.1203 165471 0.12440678 63.2843 152271 0.11831224 63.3155 163201 0.11243697 63.5859 157823 0.10918197 63.405 166167 0.09916805 63.7184 154253 0.0957606 63.8175 170299 0.10240664 64.1273 166388 0.11486375 64.3162 141051 0.12203947 64.026 160254 0.1270646 64.166 164995 0.14077985 64.222 195971 0.14515347 63.7707 182635 0.13916197 63.8022 189829 0.13609325 63.236 209476 0.12800963 63.8059 189848 0.12912 63.576 183746 0.13224522 63.5346 192682 0.13566322 63.7465 169677 0.14052339 64.1419 201823 0.14795918 63.7117 172643 0.14679687 64.3504 202931 0.13791764 64.6721 175863 0.12428239 64.5975 222061 0.1130805 64.7028 199797 0.10646651 64.9174 214638 0.10674847 64.8436 200106 0.14870821 65.043 166077 0.19314243 65.1372 160586 0.22531835 64.6442 158330 0.22055306 63.8853 141749 0.19245142 63.4658 170795 0.17072808 63.1915 153286 0.13642433 62.7585 163426 0.12407407 62.4265 172562 0.12122781 62.5503 197474 0.12219764 63.1756 189822 0.12058824 63.742 188511 0.11857562 63.8029 207437 0.12298682 63.8503 192128 0.12492711 64.4151 175716 0.13078603 64.2992 159108 0.13105951 64.2209 175801 0.12037708 63.9602 186723 0.1076756 63.596 154970 0.1040404 64.0409 172446 0.10394831 64.5973 185965 0.11111111 65.0756 195525 0.1198282 65.2831 193156 0.13031384 65.2957 212705 0.12953737 65.8801 201357 0.12796309 65.5581 189971 0.12639774 65.715 216523 0.12849083 66.2013 193233 0.12415493 66.4879 191996 0.11430585 66.5431 211974 0.10869565 66.8264 175907 0.10978337 67.1172 206109 0.11483287 67.0479 220275 0.11590278 67.2498 211342 0.11588072 67.0325 222528 0.11128809 67.1532 229523 0.10360111 67.3586 204153 0.10020718 67.2888 206735 0.09903515 67.6092 223416 0.10013727 68.1214 228292 0.09410151 68.4089 203121 0.08367627 68.7737 205957 0.07961696 69.0299 176918 0.08241309 69.0418 219839 0.0798913 69.7582 217213 0.08717775 70.125 216618 0.09525424 70.4978 248057 0.10256757 70.948 245642 0.10842318 71.0595 242485 0.10718121 71.4749 260423 0.10040161 71.7333 221030 0.09899666 72.3479 229157 0.10227121 72.8018 220858 0.09819639 73.5563 212270 0.1001996 73.6891 195944 0.10291584 73.5889 239741 0.10422721 73.6895 212013 0.11033575 73.676 240514 0.11432326 73.8858 241982 0.11003279 74.1391 245447 0.10170492 73.8447 240839 0.09954218 74.7803 244875 0.10078329 75.0755 226375 0.09921926 74.9925 231567 0.09830729 75.1822 235746 0.10306189 75.4725 238990 0.10641192 74.9823 198120 0.10393802 76.153 201663 0.11117534 76.0724 238198 0.12328855 76.7608 261641 0.12068966 77.3269 253014 0.11461391 77.9694 275225 0.11566879 77.8351 250957 0.11856325 78.3005 260375 0.1265526 78.8378 250694 0.13524953 78.7843 216953 0.13480454 79.4683 247816 0.13638083 79.9829 224135 0.13739786 80.0837 211073 0.1283208 81.0483 245623 0.11725 81.6195 250947 0.10692884 81.6408 278223 0.1065584 82.1311 254232 0.10511541 82.5332 266293 0.10224299 83.1538 280897 0.10541045 84.0293 274565 0.10378412 84.7873 280555 0.10959158 85.5125 252757 0.10681115 86.2601 250131 0.09950403 86.5262 271208 0.08855198 86.9662 230593 0.08042001 87.0687 263407 0.07324291 87.1414 289968 0.07243077 87.4497 282846 0.07248157 88.0124 271314 0.06822086 87.4571 289718 0.06605392 87.1484 300227 0.06456548 88.936 259951 0.06717604 88.778 263149 0.07109756 89.4857 267953 0.06579268 89.4358 252378 0.05723002 89.7761 280356 0.056056 90.1893 234298 0.05762918 90.6683 271574 0.06363636 90.831 262378 0.07749699 91.0632 289457 0.08784597 91.7311 278274 0.08736462 91.5818 288932 0.09664067 92.1587 283813 0.1070018 92.5363 267600 0.11727219 92.1699 267574 0.12342449 93.3786 254862 0.12507427 93.824 248974 0.13541295 94.5441 256840 0.13809242 94.5458 250914 0.14805654 94.8185 279334 0.15426402 95.1983 286549 0.14249854 95.8921 302266 0.14157434 96.0691 298205 0.15533643 96.1568 300843 0.16047454 96.0239 312955 0.15387731 95.7182 275962 0.16712723 96.1105 299561 0.1641954 95.8225 260975 0.16278001 95.8391 274836 0.15172414 95.5791 284112 0.13243861 94.9499 247331 0.13566553 94.369 298120 0.12911464 94.1259 306008 0.12244206 93.9061 306813 0.12746201 93.2803 288550 0.1297191 92.7057 301636 0.12580282 92.1721 293215 0.12473239 92.0023 270713 0.12910824 91.6795 311803 0.11187394 91.2682 281316 0.09582864 90.7894 281450 0.08749293 90.8311 295494 0.09198193 91.3471 246411 0.09325084 91.3672 267037 0.10777405 92.1054 296134 0.1253059 92.479 296505 0.13209121 92.8824 270677 0.12979433 93.7637 290855 0.13176013 93.5461 296068 0.13602656 93.5765 272653 0.14082873 93.7116 315720 0.14478764 93.4006 286298 0.13342526 93.8758 284170 0.13349917 93.4191 273338 0.15277931 93.9571 250262 0.16586565 94.2558 294768 0.16498371 94.0416 318088 0.14151251 93.3666 319111 0.13106267 93.3852 312982 0.13881328 93.5219 335511 0.14545949 93.9144 319674 0.14929577 93.7371 316796 0.14271058 94.3262 329992 0.14205405 94.4442 291352 0.14384824 95.2224 314131 0.14742268 95.1545 309876 0.15426566 95.3434 288494 0.15665951 95.9228 329991 0.16360726 95.4538 311663 0.16489362 95.8653 317854 0.17525119 96.6472 344729 0.17785978 95.8588 324108 0.17624076 96.5901 333756 0.19282322 96.6687 297013 0.19757767 96.745 313249 0.21917234 97.6604 329660 0.21565445 97.8427 320586 0.19159222 98.5495 325786 0.18495018 99.002 293425 0.19254432 99.6741 324180 0.21355406 99.5181 315528 0.23011305 99.6518 319982 0.22139918 99.8158 327865 0.22832905 100.2232 312106 0.2511259 99.8997 329039 0.26909369 100.1025 277589 0.288833 98.2644 300884 0.28217871 99.4949 314028 0.26396761 100.5129 314259 0.25299797 101.1118 303472 0.26122037 101.2313 290744 0.2710619 101.2755 313340 0.26186186 101.4651 294281 0.28114144 101.9012 325796 0.30637037 101.7589 329839 0.30616067 102.1304 322588 0.31906634 102.0989 336528 0.32432565 102.4526 316381 0.30754066 102.2753 308602 0.27487611 102.2299 299010 0.25915633 102.1419 293645 0.26679881 103.2191 320108 0.25805336 102.7129 252869 0.24918919 103.7659 324248 0.25803311 103.9538 304775 0.27711659 104.7077 320208 0.28552189 104.7507 321260 0.29246641 104.7581 310320 0.31473836 104.7111 319197 0.32809043 104.9122 297503 0.32858513 105.2764 316184 0.34700814 104.772 303411 0.37892483 105.3295 300841 0.39409524 105.3213
Names of X columns:
barrels_purchased defl_price US_IND_PROD
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
12
1
2
3
4
5
6
7
8
9
10
11
12
Chart options
R Code
library(lattice) library(lmtest) library(car) library(MASS) n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test mywarning <- '' par6 <- as.numeric(par6) if(is.na(par6)) { par6 <- 12 mywarning = 'Warning: you did not specify the seasonality. The seasonal period was set to s = 12.' } par1 <- as.numeric(par1) if(is.na(par1)) { par1 <- 1 mywarning = 'Warning: you did not specify the column number of the endogenous series! The first column was selected by default.' } if (par4=='') par4 <- 0 par4 <- as.numeric(par4) if (!is.numeric(par4)) par4 <- 0 if (par5=='') par5 <- 0 par5 <- as.numeric(par5) if (!is.numeric(par5)) par5 <- 0 x <- na.omit(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'){ (n <- n -1) x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B)',colnames(x),sep=''))) for (i in 1:n) { for (j in 1:k) { x2[i,j] <- x[i+1,j] - x[i,j] } } x <- x2 } if (par3 == 'Seasonal Differences (s)'){ (n <- n - par6) x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-Bs)',colnames(x),sep=''))) for (i in 1:n) { for (j in 1:k) { x2[i,j] <- x[i+par6,j] - x[i,j] } } x <- x2 } if (par3 == 'First and Seasonal Differences (s)'){ (n <- n -1) x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B)',colnames(x),sep=''))) for (i in 1:n) { for (j in 1:k) { x2[i,j] <- x[i+1,j] - x[i,j] } } x <- x2 (n <- n - par6) x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-Bs)',colnames(x),sep=''))) for (i in 1:n) { for (j in 1:k) { x2[i,j] <- x[i+par6,j] - x[i,j] } } x <- x2 } if(par4 > 0) { x2 <- array(0, dim=c(n-par4,par4), dimnames=list(1:(n-par4), paste(colnames(x)[par1],'(t-',1:par4,')',sep=''))) for (i in 1:(n-par4)) { for (j in 1:par4) { x2[i,j] <- x[i+par4-j,par1] } } x <- cbind(x[(par4+1):n,], x2) n <- n - par4 } if(par5 > 0) { x2 <- array(0, dim=c(n-par5*par6,par5), dimnames=list(1:(n-par5*par6), paste(colnames(x)[par1],'(t-',1:par5,'s)',sep=''))) for (i in 1:(n-par5*par6)) { for (j in 1:par5) { x2[i,j] <- x[i+par5*par6-j*par6,par1] } } x <- cbind(x[(par5*par6+1):n,], x2) n <- n - par5*par6 } if (par2 == 'Include Seasonal Dummies'){ x2 <- array(0, dim=c(n,par6-1), dimnames=list(1:n, paste('M', seq(1:(par6-1)), sep =''))) for (i in 1:(par6-1)){ x2[seq(i,n,par6),i] <- 1 } x <- cbind(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[n,])) if (par3 == 'Linear Trend'){ x <- cbind(x, c(1:n)) colnames(x)[k+1] <- 't' } print(x) (k <- length(x[n,])) head(x) 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') sresid <- studres(mylm) hist(sresid, freq=FALSE, main='Distribution of Studentized Residuals') xfit<-seq(min(sresid),max(sresid),length=40) yfit<-dnorm(xfit) lines(xfit, yfit) 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') qqPlot(mylm, main='QQ Plot') 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) print(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.row.start(a) a<-table.element(a, mywarning) 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,'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,formatC(signif(mysum$coefficients[i,1],5),format='g',flag='+')) a<-table.element(a,formatC(signif(mysum$coefficients[i,2],5),format='g',flag=' ')) a<-table.element(a,formatC(signif(mysum$coefficients[i,3],4),format='e',flag='+')) a<-table.element(a,formatC(signif(mysum$coefficients[i,4],4),format='g',flag=' ')) a<-table.element(a,formatC(signif(mysum$coefficients[i,4]/2,4),format='g',flag=' ')) 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,formatC(signif(sqrt(mysum$r.squared),6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'R-squared',1,TRUE) a<-table.element(a,formatC(signif(mysum$r.squared,6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Adjusted R-squared',1,TRUE) a<-table.element(a,formatC(signif(mysum$adj.r.squared,6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (value)',1,TRUE) a<-table.element(a,formatC(signif(mysum$fstatistic[1],6),format='g',flag=' ')) 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,formatC(signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6),format='g',flag=' ')) 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,formatC(signif(mysum$sigma,6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Sum Squared Residuals',1,TRUE) a<-table.element(a,formatC(signif(sum(myerror*myerror),6),format='g',flag=' ')) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable3.tab') myr <- as.numeric(mysum$resid) myr a <-table.start() a <- table.row.start(a) a <- table.element(a,'Menu of Residual Diagnostics',2,TRUE) a <- table.row.end(a) a <- table.row.start(a) a <- table.element(a,'Description',1,TRUE) a <- table.element(a,'Link',1,TRUE) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Histogram',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_histogram.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Central Tendency',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_centraltendency.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'QQ Plot',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_fitdistrnorm.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Kernel Density Plot',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_density.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Skewness/Kurtosis Test',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_skewness_kurtosis.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Skewness-Kurtosis Plot',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_skewness_kurtosis_plot.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Harrell-Davis Plot',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_harrell_davis.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Bootstrap Plot -- Central Tendency',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_bootstrapplot1.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Blocked Bootstrap Plot -- Central Tendency',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_bootstrapplot.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'(Partial) Autocorrelation Plot',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_autocorrelation.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Spectral Analysis',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_spectrum.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Tukey lambda PPCC Plot',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_tukeylambda.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <-table.element(a,'Box-Cox Normality Plot',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_boxcoxnorm.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a <- table.row.start(a) a <- table.element(a,'Summary Statistics',1,header=TRUE) a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_summary1.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1) a <- table.row.end(a) a<-table.end(a) table.save(a,file='mytable7.tab') if(n < 200) { 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,formatC(signif(x[i],6),format='g',flag=' ')) a<-table.element(a,formatC(signif(x[i]-mysum$resid[i],6),format='g',flag=' ')) a<-table.element(a,formatC(signif(mysum$resid[i],6),format='g',flag=' ')) 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,formatC(signif(gqarr[mypoint-kp3+1,1],6),format='g',flag=' ')) a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,2],6),format='g',flag=' ')) a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,3],6),format='g',flag=' ')) 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,formatC(signif(numsignificant1/numgqtests,6),format='g',flag=' ')) 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') } } a<-table.start() a<-table.row.start(a) a<-table.element(a,'Ramsey RESET F-Test for powers (2 and 3) of fitted values',1,TRUE) a<-table.row.end(a) a<-table.row.start(a) reset_test_fitted <- resettest(mylm,power=2:3,type='fitted') a<-table.element(a,paste('<pre>',RC.texteval('reset_test_fitted'),'</pre>',sep='')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Ramsey RESET F-Test for powers (2 and 3) of regressors',1,TRUE) a<-table.row.end(a) a<-table.row.start(a) reset_test_regressors <- resettest(mylm,power=2:3,type='regressor') a<-table.element(a,paste('<pre>',RC.texteval('reset_test_regressors'),'</pre>',sep='')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Ramsey RESET F-Test for powers (2 and 3) of principal components',1,TRUE) a<-table.row.end(a) a<-table.row.start(a) reset_test_principal_components <- resettest(mylm,power=2:3,type='princomp') a<-table.element(a,paste('<pre>',RC.texteval('reset_test_principal_components'),'</pre>',sep='')) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable8.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Variance Inflation Factors (Multicollinearity)',1,TRUE) a<-table.row.end(a) a<-table.row.start(a) vif <- vif(mylm) a<-table.element(a,paste('<pre>',RC.texteval('vif'),'</pre>',sep='')) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable9.tab')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
1 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation