Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
102750 0.06455399 NA 95276 0.06363636 0.06455399 112053 0.06512702 0.06363636 98841 0.06490826 0.06512702 123102 0.06605923 0.06490826 118152 0.06900452 0.06605923 101752 0.07110609 0.06900452 148219 0.07228381 0.07110609 124966 0.07477876 0.07228381 134741 0.07763158 0.07477876 132168 0.08300654 0.07763158 100950 0.11406926 0.08300654 96418 0.14399142 0.11406926 86891 0.19258475 0.14399142 89796 0.23179916 0.19258475 119663 0.248125 0.23179916 130539 0.24300412 0.248125 120851 0.24102041 0.24300412 145422 0.24473684 0.24102041 150583 0.239 0.24473684 127054 0.23063241 0.239 137473 0.22700587 0.23063241 127094 0.22737864 0.22700587 132080 0.2238921 0.22737864 188311 0.22341651 0.2238921 107487 0.22209524 0.22341651 84669 0.22144213 0.22209524 149184 0.22098299 0.22144213 121026 0.21766917 0.22098299 81073 0.21268657 0.21766917 132947 0.21107011 0.21268657 141294 0.20957643 0.21107011 155077 0.20714286 0.20957643 145154 0.20856102 0.20714286 127094 0.21211573 0.20856102 151414 0.2181982 0.21211573 167858 0.21996403 0.2181982 127070 0.22204301 0.21996403 154692 0.22075134 0.22204301 170905 0.22139037 0.22075134 127751 0.21893805 0.22139037 173795 0.21778169 0.21893805 190181 0.21698774 0.21778169 198417 0.21655052 0.21698774 183018 0.21666667 0.21655052 171608 0.21502591 0.21666667 188087 0.21689655 0.21502591 197042 0.21632302 0.21689655 208788 0.21435897 0.21632302 178111 0.22013536 0.21435897 236455 0.22369748 0.22013536 233219 0.22416667 0.22369748 188106 0.22023217 0.22416667 238876 0.22042834 0.22023217 205148 0.21901639 0.22042834 214727 0.21895425 0.21901639 213428 0.21970684 0.21895425 195128 0.21866883 0.21970684 206047 0.22003231 0.21866883 201773 0.21851852 0.22003231 192772 0.21744 0.21851852 198230 0.21430843 0.21744 181172 0.21246057 0.21430843 189079 0.21079812 0.21246057 179073 0.20713178 0.21079812 197421 0.20506135 0.20713178 195244 0.20395738 0.20506135 219826 0.20318182 0.20395738 211793 0.20105263 0.20318182 203394 0.2 0.20105263 209578 0.19896142 0.2 214769 0.19881832 0.19896142 226177 0.19970717 0.19881832 191449 0.2015919 0.19970717 200989 0.20716332 0.2015919 216707 0.21133144 0.20716332 192882 0.22755245 0.21133144 199736 0.24011065 0.22755245 202349 0.26087551 0.24011065 204137 0.28590786 0.26087551 215588 0.30013405 0.28590786 229454 0.30757979 0.30013405 175048 0.30658762 0.30757979 212799 0.32033898 0.30658762 181727 0.33830334 0.32033898 211607 0.36210393 0.33830334 185853 0.38002497 0.36210393 158277 0.38765432 0.38002497 180695 0.38924205 0.38765432 175959 0.38524788 0.38924205 139550 0.39056832 0.38524788 155810 0.39531813 0.39056832 138305 0.38964286 0.39531813 147014 0.39033019 0.38964286 135994 0.38865497 0.39033019 166455 0.39327926 0.38865497 177737 0.39390805 0.39327926 167021 0.40910125 0.39390805 132134 0.40960452 0.40910125 169834 0.41436588 0.40960452 130599 0.40267261 0.41436588 156836 0.40386313 0.40267261 119749 0.38264192 0.40386313 148996 0.37410618 0.38264192 147491 0.36555794 0.37410618 147216 0.36027837 0.36555794 153455 0.36115261 0.36027837 112004 0.36159574 0.36115261 158512 0.37550371 0.36159574 104139 0.3755814 0.37550371 102536 0.36730159 0.3755814 93017 0.34984194 0.36730159 91988 0.33663883 0.34984194 123616 0.33938144 0.33663883 134498 0.34123077 0.33938144 149812 0.33684749 0.34123077 110334 0.3308478 0.33684749 136639 0.33034623 0.3308478 102712 0.33510204 0.33034623 112951 0.33237705 0.33510204 107897 0.33231084 0.33237705 73242 0.31787538 0.33231084 72800 0.3092952 0.31787538 78767 0.29168357 0.3092952 114791 0.28820565 0.29168357 109351 0.28974874 0.28820565 122520 0.28958959 0.28974874 137338 0.29251497 0.28958959 132061 0.29066534 0.29251497 130607 0.29069307 0.29066534 118570 0.28705534 0.29069307 95873 0.28627838 0.28705534 103116 0.27134446 0.28627838 98619 0.26992187 0.27134446 104178 0.27095517 0.26992187 123468 0.2700291 0.27095517 99651 0.26934236 0.2700291 120264 0.26769527 0.26934236 122795 0.26945245 0.26769527 108524 0.264689 0.26945245 105760 0.26085714 0.264689 117191 0.2617284 0.26085714 122882 0.26163343 0.2617284 93275 0.25925926 0.26163343 99842 0.25952607 0.25925926 83803 0.25386792 0.25952607 61132 0.24483083 0.25386792 118563 0.24808232 0.24483083 106993 0.24967381 0.24808232 118108 0.2464684 0.24967381 99017 0.2403525 0.2464684 99852 0.23851852 0.2403525 112720 0.23471837 0.23851852 113636 0.23597056 0.23471837 118220 0.23568807 0.23597056 128854 0.23824337 0.23568807 123898 0.23540146 0.23824337 100823 0.2116194 0.23540146 115107 0.16636029 0.2116194 90624 0.11767956 0.16636029 132001 0.11239669 0.11767956 157969 0.10995434 0.11239669 169333 0.10073059 0.10995434 144907 0.09197812 0.10073059 169346 0.10054446 0.09197812 144666 0.1068903 0.10054446 158829 0.11077899 0.1068903 127286 0.11221719 0.11077899 120578 0.12464029 0.11221719 129293 0.13862007 0.12464029 122371 0.14157003 0.13862007 115176 0.14702751 0.14157003 142168 0.14960212 0.14702751 153260 0.15251101 0.14960212 173906 0.15615114 0.15251101 178446 0.15795455 0.15615114 155962 0.15208696 0.15795455 168257 0.14926279 0.15208696 149456 0.14835355 0.14926279 136105 0.14263432 0.14835355 141507 0.19360415 0.14263432 152084 0.13103448 0.19360415 145138 0.12223176 0.13103448 146548 0.12134927 0.12223176 173098 0.12502128 0.12134927 165471 0.12440678 0.12502128 152271 0.11831224 0.12440678 163201 0.11243697 0.11831224 157823 0.10918197 0.11243697 166167 0.09916805 0.10918197 154253 0.0957606 0.09916805 170299 0.10240664 0.0957606 166388 0.11486375 0.10240664 141051 0.12203947 0.11486375 160254 0.1270646 0.12203947 164995 0.14077985 0.1270646 195971 0.14515347 0.14077985 182635 0.13916197 0.14515347 189829 0.13609325 0.13916197 209476 0.12800963 0.13609325 189848 0.12912 0.12800963 183746 0.13224522 0.12912 192682 0.13566322 0.13224522 169677 0.14052339 0.13566322 201823 0.14795918 0.14052339 172643 0.14679687 0.14795918 202931 0.13791764 0.14679687 175863 0.12428239 0.13791764 222061 0.1130805 0.12428239 199797 0.10646651 0.1130805 214638 0.10674847 0.10646651 200106 0.14870821 0.10674847 166077 0.19314243 0.14870821 160586 0.22531835 0.19314243 158330 0.22055306 0.22531835 141749 0.19245142 0.22055306 170795 0.17072808 0.19245142 153286 0.13642433 0.17072808 163426 0.12407407 0.13642433 172562 0.12122781 0.12407407 197474 0.12219764 0.12122781 189822 0.12058824 0.12219764 188511 0.11857562 0.12058824 207437 0.12298682 0.11857562 192128 0.12492711 0.12298682 175716 0.13078603 0.12492711 159108 0.13105951 0.13078603 175801 0.12037708 0.13105951 186723 0.1076756 0.12037708 154970 0.1040404 0.1076756 172446 0.10394831 0.1040404 185965 0.11111111 0.10394831 195525 0.1198282 0.11111111 193156 0.13031384 0.1198282 212705 0.12953737 0.13031384 201357 0.12796309 0.12953737 189971 0.12639774 0.12796309 216523 0.12849083 0.12639774 193233 0.12415493 0.12849083 191996 0.11430585 0.12415493 211974 0.10869565 0.11430585 175907 0.10978337 0.10869565 206109 0.11483287 0.10978337 220275 0.11590278 0.11483287 211342 0.11588072 0.11590278 222528 0.11128809 0.11588072 229523 0.10360111 0.11128809 204153 0.10020718 0.10360111 206735 0.09903515 0.10020718 223416 0.10013727 0.09903515 228292 0.09410151 0.10013727 203121 0.08367627 0.09410151 205957 0.07961696 0.08367627 176918 0.08241309 0.07961696 219839 0.0798913 0.08241309 217213 0.08717775 0.0798913 216618 0.09525424 0.08717775 248057 0.10256757 0.09525424 245642 0.10842318 0.10256757 242485 0.10718121 0.10842318 260423 0.10040161 0.10718121 221030 0.09899666 0.10040161 229157 0.10227121 0.09899666 220858 0.09819639 0.10227121 212270 0.1001996 0.09819639 195944 0.10291584 0.1001996 239741 0.10422721 0.10291584 212013 0.11033575 0.10422721 240514 0.11432326 0.11033575 241982 0.11003279 0.11432326 245447 0.10170492 0.11003279 240839 0.09954218 0.10170492 244875 0.10078329 0.09954218 226375 0.09921926 0.10078329 231567 0.09830729 0.09921926 235746 0.10306189 0.09830729 238990 0.10641192 0.10306189 198120 0.10393802 0.10641192 201663 0.11117534 0.10393802 238198 0.12328855 0.11117534 261641 0.12068966 0.12328855 253014 0.11461391 0.12068966 275225 0.11566879 0.11461391 250957 0.11856325 0.11566879 260375 0.1265526 0.11856325 250694 0.13524953 0.1265526 216953 0.13480454 0.13524953 247816 0.13638083 0.13480454 224135 0.13739786 0.13638083 211073 0.1283208 0.13739786 245623 0.11725 0.1283208 250947 0.10692884 0.11725 278223 0.1065584 0.10692884 254232 0.10511541 0.1065584 266293 0.10224299 0.10511541 280897 0.10541045 0.10224299 274565 0.10378412 0.10541045 280555 0.10959158 0.10378412 252757 0.10681115 0.10959158 250131 0.09950403 0.10681115 271208 0.08855198 0.09950403 230593 0.08042001 0.08855198 263407 0.07324291 0.08042001 289968 0.07243077 0.07324291 282846 0.07248157 0.07243077 271314 0.06822086 0.07248157 289718 0.06605392 0.06822086 300227 0.06456548 0.06605392 259951 0.06717604 0.06456548 263149 0.07109756 0.06717604 267953 0.06579268 0.07109756 252378 0.05723002 0.06579268 280356 0.056056 0.05723002 234298 0.05762918 0.056056 271574 0.06363636 0.05762918 262378 0.07749699 0.06363636 289457 0.08784597 0.07749699 278274 0.08736462 0.08784597 288932 0.09664067 0.08736462 283813 0.1070018 0.09664067 267600 0.11727219 0.1070018 267574 0.12342449 0.11727219 254862 0.12507427 0.12342449 248974 0.13541295 0.12507427 256840 0.13809242 0.13541295 250914 0.14805654 0.13809242 279334 0.15426402 0.14805654 286549 0.14249854 0.15426402 302266 0.14157434 0.14249854 298205 0.15533643 0.14157434 300843 0.16047454 0.15533643 312955 0.15387731 0.16047454 275962 0.16712723 0.15387731 299561 0.1641954 0.16712723 260975 0.16278001 0.1641954 274836 0.15172414 0.16278001 284112 0.13243861 0.15172414 247331 0.13566553 0.13243861 298120 0.12911464 0.13566553 306008 0.12244206 0.12911464 306813 0.12746201 0.12244206 288550 0.1297191 0.12746201 301636 0.12580282 0.1297191 293215 0.12473239 0.12580282 270713 0.12910824 0.12473239 311803 0.11187394 0.12910824 281316 0.09582864 0.11187394 281450 0.08749293 0.09582864 295494 0.09198193 0.08749293 246411 0.09325084 0.09198193 267037 0.10777405 0.09325084 296134 0.1253059 0.10777405 296505 0.13209121 0.1253059 270677 0.12979433 0.13209121 290855 0.13176013 0.12979433 296068 0.13602656 0.13176013 272653 0.14082873 0.13602656 315720 0.14478764 0.14082873 286298 0.13342526 0.14478764 284170 0.13349917 0.13342526 273338 0.15277931 0.13349917 250262 0.16586565 0.15277931 294768 0.16498371 0.16586565 318088 0.14151251 0.16498371 319111 0.13106267 0.14151251 312982 0.13881328 0.13106267 335511 0.14545949 0.13881328 319674 0.14929577 0.14545949 316796 0.14271058 0.14929577 329992 0.14205405 0.14271058 291352 0.14384824 0.14205405 314131 0.14742268 0.14384824 309876 0.15426566 0.14742268 288494 0.15665951 0.15426566 329991 0.16360726 0.15665951 311663 0.16489362 0.16360726 317854 0.17525119 0.16489362 344729 0.17785978 0.17525119 324108 0.17624076 0.17785978 333756 0.19282322 0.17624076 297013 0.19757767 0.19282322 313249 0.21917234 0.19757767 329660 0.21565445 0.21917234 320586 0.19159222 0.21565445 325786 0.18495018 0.19159222 293425 0.19254432 0.18495018 324180 0.21355406 0.19254432 315528 0.23011305 0.21355406 319982 0.22139918 0.23011305 327865 0.22832905 0.22139918 312106 0.2511259 0.22832905 329039 0.26909369 0.2511259 277589 0.288833 0.26909369 300884 0.28217871 0.288833 314028 0.26396761 0.28217871 314259 0.25299797 0.26396761 303472 0.26122037 0.25299797 290744 0.2710619 0.26122037 313340 0.26186186 0.2710619 294281 0.28114144 0.26186186 325796 0.30637037 0.28114144 329839 0.30616067 0.30637037 322588 0.31906634 0.30616067 336528 0.32432565 0.31906634 316381 0.30754066 0.32432565 308602 0.27487611 0.30754066 299010 0.25915633 0.27487611 293645 0.26679881 0.25915633 320108 0.25805336 0.26679881 252869 0.24918919 0.25805336 324248 0.25803311 0.24918919 304775 0.27711659 0.25803311 320208 0.28552189 0.27711659 321260 0.29246641 0.28552189 310320 0.31473836 0.29246641 319197 0.32809043 0.31473836 297503 0.32858513 0.32809043 316184 0.34700814 0.32858513 303411 0.37892483 0.34700814 300841 0.39409524 0.37892483
Names of X columns:
barrels_purchased defl_price defl_price1
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
First and Seasonal Differences (s)
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
par6 <- '12' par5 <- '2' par4 <- '2' par3 <- 'First and Seasonal Differences (s)' par2 <- 'Do not include Seasonal Dummies' par1 <- '1' 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