Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
102750 0.06455399 NA NA 1 NA 95276 0.06363636 0.06455399 NA 1 102750 112053 0.06512702 0.06363636 0.06455399 1 95276 98841 0.06490826 0.06512702 0.06363636 1 112053 123102 0.06605923 0.06490826 0.06512702 1 98841 118152 0.06900452 0.06605923 0.06490826 1 123102 101752 0.07110609 0.06900452 0.06605923 1 118152 148219 0.07228381 0.07110609 0.06900452 1 101752 124966 0.07477876 0.07228381 0.07110609 1 148219 134741 0.07763158 0.07477876 0.07228381 1 124966 132168 0.08300654 0.07763158 0.07477876 1 134741 100950 0.11406926 0.08300654 0.07763158 1 132168 96418 0.14399142 0.11406926 0.08300654 1 100950 86891 0.19258475 0.14399142 0.11406926 1 96418 89796 0.23179916 0.19258475 0.14399142 1 86891 119663 0.248125 0.23179916 0.19258475 1 89796 130539 0.24300412 0.248125 0.23179916 1 119663 120851 0.24102041 0.24300412 0.248125 1 130539 145422 0.24473684 0.24102041 0.24300412 1 120851 150583 0.239 0.24473684 0.24102041 1 145422 127054 0.23063241 0.239 0.24473684 1 150583 137473 0.22700587 0.23063241 0.239 1 127054 127094 0.22737864 0.22700587 0.23063241 1 137473 132080 0.2238921 0.22737864 0.22700587 1 127094 188311 0.22341651 0.2238921 0.22737864 1 132080 107487 0.22209524 0.22341651 0.2238921 1 188311 84669 0.22144213 0.22209524 0.22341651 1 107487 149184 0.22098299 0.22144213 0.22209524 1 84669 121026 0.21766917 0.22098299 0.22144213 1 149184 81073 0.21268657 0.21766917 0.22098299 1 121026 132947 0.21107011 0.21268657 0.21766917 1 81073 141294 0.20957643 0.21107011 0.21268657 1 132947 155077 0.20714286 0.20957643 0.21107011 1 141294 145154 0.20856102 0.20714286 0.20957643 1 155077 127094 0.21211573 0.20856102 0.20714286 1 145154 151414 0.2181982 0.21211573 0.20856102 1 127094 167858 0.21996403 0.2181982 0.21211573 1 151414 127070 0.22204301 0.21996403 0.2181982 1 167858 154692 0.22075134 0.22204301 0.21996403 1 127070 170905 0.22139037 0.22075134 0.22204301 1 154692 127751 0.21893805 0.22139037 0.22075134 1 170905 173795 0.21778169 0.21893805 0.22139037 1 127751 190181 0.21698774 0.21778169 0.21893805 1 173795 198417 0.21655052 0.21698774 0.21778169 1 190181 183018 0.21666667 0.21655052 0.21698774 1 198417 171608 0.21502591 0.21666667 0.21655052 1 183018 188087 0.21689655 0.21502591 0.21666667 1 171608 197042 0.21632302 0.21689655 0.21502591 1 188087 208788 0.21435897 0.21632302 0.21689655 1 197042 178111 0.22013536 0.21435897 0.21632302 1 208788 236455 0.22369748 0.22013536 0.21435897 1 178111 233219 0.22416667 0.22369748 0.22013536 1 236455 188106 0.22023217 0.22416667 0.22369748 1 233219 238876 0.22042834 0.22023217 0.22416667 1 188106 205148 0.21901639 0.22042834 0.22023217 1 238876 214727 0.21895425 0.21901639 0.22042834 1 205148 213428 0.21970684 0.21895425 0.21901639 1 214727 195128 0.21866883 0.21970684 0.21895425 1 213428 206047 0.22003231 0.21866883 0.21970684 1 195128 201773 0.21851852 0.22003231 0.21866883 1 206047 192772 0.21744 0.21851852 0.22003231 1 201773 198230 0.21430843 0.21744 0.21851852 1 192772 181172 0.21246057 0.21430843 0.21744 1 198230 189079 0.21079812 0.21246057 0.21430843 1 181172 179073 0.20713178 0.21079812 0.21246057 1 189079 197421 0.20506135 0.20713178 0.21079812 1 179073 195244 0.20395738 0.20506135 0.20713178 1 197421 219826 0.20318182 0.20395738 0.20506135 1 195244 211793 0.20105263 0.20318182 0.20395738 1 219826 203394 0.2 0.20105263 0.20318182 1 211793 209578 0.19896142 0.2 0.20105263 1 203394 214769 0.19881832 0.19896142 0.2 1 209578 226177 0.19970717 0.19881832 0.19896142 1 214769 191449 0.2015919 0.19970717 0.19881832 1 226177 200989 0.20716332 0.2015919 0.19970717 1 191449 216707 0.21133144 0.20716332 0.2015919 1 200989 192882 0.22755245 0.21133144 0.20716332 1 216707 199736 0.24011065 0.22755245 0.21133144 1 192882 202349 0.26087551 0.24011065 0.22755245 1 199736 204137 0.28590786 0.26087551 0.24011065 1 202349 215588 0.30013405 0.28590786 0.26087551 1 204137 229454 0.30757979 0.30013405 0.28590786 1 215588 175048 0.30658762 0.30757979 0.30013405 1 229454 212799 0.32033898 0.30658762 0.30757979 1 175048 181727 0.33830334 0.32033898 0.30658762 1 212799 211607 0.36210393 0.33830334 0.32033898 1 181727 185853 0.38002497 0.36210393 0.33830334 1 211607 158277 0.38765432 0.38002497 0.36210393 1 185853 180695 0.38924205 0.38765432 0.38002497 1 158277 175959 0.38524788 0.38924205 0.38765432 1 180695 139550 0.39056832 0.38524788 0.38924205 1 175959 155810 0.39531813 0.39056832 0.38524788 1 139550 138305 0.38964286 0.39531813 0.39056832 1 155810 147014 0.39033019 0.38964286 0.39531813 1 138305 135994 0.38865497 0.39033019 0.38964286 1 147014 166455 0.39327926 0.38865497 0.39033019 1 135994 177737 0.39390805 0.39327926 0.38865497 1 166455 167021 0.40910125 0.39390805 0.39327926 1 177737 132134 0.40960452 0.40910125 0.39390805 1 167021 169834 0.41436588 0.40960452 0.40910125 1 132134 130599 0.40267261 0.41436588 0.40960452 1 169834 156836 0.40386313 0.40267261 0.41436588 1 130599 119749 0.38264192 0.40386313 0.40267261 1 156836 148996 0.37410618 0.38264192 0.40386313 1 119749 147491 0.36555794 0.37410618 0.38264192 1 148996 147216 0.36027837 0.36555794 0.37410618 1 147491 153455 0.36115261 0.36027837 0.36555794 1 147216 112004 0.36159574 0.36115261 0.36027837 1 153455 158512 0.37550371 0.36159574 0.36115261 1 112004 104139 0.3755814 0.37550371 0.36159574 1 158512 102536 0.36730159 0.3755814 0.37550371 1 104139 93017 0.34984194 0.36730159 0.3755814 1 102536 91988 0.33663883 0.34984194 0.36730159 1 93017 123616 0.33938144 0.33663883 0.34984194 1 91988 134498 0.34123077 0.33938144 0.33663883 1 123616 149812 0.33684749 0.34123077 0.33938144 1 134498 110334 0.3308478 0.33684749 0.34123077 1 149812 136639 0.33034623 0.3308478 0.33684749 1 110334 102712 0.33510204 0.33034623 0.3308478 1 136639 112951 0.33237705 0.33510204 0.33034623 1 102712 107897 0.33231084 0.33237705 0.33510204 1 112951 73242 0.31787538 0.33231084 0.33237705 1 107897 72800 0.3092952 0.31787538 0.33231084 1 73242 78767 0.29168357 0.3092952 0.31787538 1 72800 114791 0.28820565 0.29168357 0.3092952 1 78767 109351 0.28974874 0.28820565 0.29168357 1 114791 122520 0.28958959 0.28974874 0.28820565 1 109351 137338 0.29251497 0.28958959 0.28974874 1 122520 132061 0.29066534 0.29251497 0.28958959 1 137338 130607 0.29069307 0.29066534 0.29251497 1 132061 118570 0.28705534 0.29069307 0.29066534 1 130607 95873 0.28627838 0.28705534 0.29069307 1 118570 103116 0.27134446 0.28627838 0.28705534 1 95873 98619 0.26992187 0.27134446 0.28627838 1 103116 104178 0.27095517 0.26992187 0.27134446 1 98619 123468 0.2700291 0.27095517 0.26992187 1 104178 99651 0.26934236 0.2700291 0.27095517 1 123468 120264 0.26769527 0.26934236 0.2700291 1 99651 122795 0.26945245 0.26769527 0.26934236 1 120264 108524 0.264689 0.26945245 0.26769527 1 122795 105760 0.26085714 0.264689 0.26945245 1 108524 117191 0.2617284 0.26085714 0.264689 1 105760 122882 0.26163343 0.2617284 0.26085714 1 117191 93275 0.25925926 0.26163343 0.2617284 1 122882 99842 0.25952607 0.25925926 0.26163343 1 93275 83803 0.25386792 0.25952607 0.25925926 1 99842 61132 0.24483083 0.25386792 0.25952607 1 83803 118563 0.24808232 0.24483083 0.25386792 1 61132 106993 0.24967381 0.24808232 0.24483083 1 118563 118108 0.2464684 0.24967381 0.24808232 1 106993 99017 0.2403525 0.2464684 0.24967381 1 118108 99852 0.23851852 0.2403525 0.2464684 1 99017 112720 0.23471837 0.23851852 0.2403525 1 99852 113636 0.23597056 0.23471837 0.23851852 1 112720 118220 0.23568807 0.23597056 0.23471837 1 113636 128854 0.23824337 0.23568807 0.23597056 1 118220 123898 0.23540146 0.23824337 0.23568807 1 128854 100823 0.2116194 0.23540146 0.23824337 1 123898 115107 0.16636029 0.2116194 0.23540146 1 100823 90624 0.11767956 0.16636029 0.2116194 1 115107 132001 0 0 0 0 0 157969 0 0 0 0 0 169333 0 0 0 0 0 144907 0 0 0 0 0 169346 0 0 0 0 0 144666 0 0 0 0 0 158829 0 0 0 0 0 127286 0 0 0 0 0 120578 0 0 0 0 0 129293 0 0 0 0 0 122371 0 0 0 0 0 115176 0 0 0 0 0 142168 0 0 0 0 0 153260 0 0 0 0 0 173906 0 0 0 0 0 178446 0 0 0 0 0 155962 0 0 0 0 0 168257 0 0 0 0 0 149456 0 0 0 0 0 136105 0 0 0 0 0 141507 0 0 0 0 0 152084 0 0 0 0 0 145138 0 0 0 0 0 146548 0 0 0 0 0 173098 0 0 0 0 0 165471 0 0 0 0 0 152271 0 0 0 0 0 163201 0 0 0 0 0 157823 0 0 0 0 0 166167 0 0 0 0 0 154253 0 0 0 0 0 170299 0 0 0 0 0 166388 0 0 0 0 0 141051 0 0 0 0 0 160254 0 0 0 0 0 164995 0 0 0 0 0 195971 0 0 0 0 0 182635 0 0 0 0 0 189829 0 0 0 0 0 209476 0 0 0 0 0 189848 0 0 0 0 0 183746 0 0 0 0 0 192682 0 0 0 0 0 169677 0 0 0 0 0 201823 0 0 0 0 0 172643 0 0 0 0 0 202931 0 0 0 0 0 175863 0 0 0 0 0 222061 0 0 0 0 0 199797 0 0 0 0 0 214638 0 0 0 0 0 200106 0 0 0 0 0 166077 0 0 0 0 0 160586 0 0 0 0 0 158330 0 0 0 0 0 141749 0 0 0 0 0 170795 0 0 0 0 0 153286 0 0 0 0 0 163426 0 0 0 0 0 172562 0 0 0 0 0 197474 0 0 0 0 0 189822 0 0 0 0 0 188511 0 0 0 0 0 207437 0 0 0 0 0 192128 0 0 0 0 0 175716 0 0 0 0 0 159108 0 0 0 0 0 175801 0 0 0 0 0 186723 0 0 0 0 0 154970 0 0 0 0 0 172446 0 0 0 0 0 185965 0 0 0 0 0 195525 0 0 0 0 0 193156 0 0 0 0 0 212705 0 0 0 0 0 201357 0 0 0 0 0 189971 0 0 0 0 0 216523 0 0 0 0 0 193233 0 0 0 0 0 191996 0 0 0 0 0 211974 0 0 0 0 0 175907 0 0 0 0 0 206109 0 0 0 0 0 220275 0 0 0 0 0 211342 0 0 0 0 0 222528 0 0 0 0 0 229523 0 0 0 0 0 204153 0 0 0 0 0 206735 0 0 0 0 0 223416 0 0 0 0 0 228292 0 0 0 0 0 203121 0 0 0 0 0 205957 0 0 0 0 0 176918 0 0 0 0 0 219839 0 0 0 0 0 217213 0 0 0 0 0 216618 0 0 0 0 0 248057 0 0 0 0 0 245642 0 0 0 0 0 242485 0 0 0 0 0 260423 0 0 0 0 0 221030 0 0 0 0 0 229157 0 0 0 0 0 220858 0 0 0 0 0 212270 0 0 0 0 0 195944 0 0 0 0 0 239741 0 0 0 0 0 212013 0 0 0 0 0 240514 0 0 0 0 0 241982 0 0 0 0 0 245447 0 0 0 0 0 240839 0 0 0 0 0 244875 0 0 0 0 0 226375 0 0 0 0 0 231567 0 0 0 0 0 235746 0 0 0 0 0 238990 0 0 0 0 0 198120 0 0 0 0 0 201663 0 0 0 0 0 238198 0 0 0 0 0 261641 0 0 0 0 0 253014 0 0 0 0 0 275225 0 0 0 0 0 250957 0 0 0 0 0 260375 0 0 0 0 0 250694 0 0 0 0 0 216953 0 0 0 0 0 247816 0 0 0 0 0 224135 0 0 0 0 0 211073 0 0 0 0 0 245623 0 0 0 0 0 250947 0 0 0 0 0 278223 0 0 0 0 0 254232 0 0 0 0 0 266293 0 0 0 0 0 280897 0 0 0 0 0 274565 0 0 0 0 0 280555 0 0 0 0 0 252757 0 0 0 0 0 250131 0 0 0 0 0 271208 0 0 0 0 0 230593 0 0 0 0 0 263407 0 0 0 0 0 289968 0 0 0 0 0 282846 0 0 0 0 0 271314 0 0 0 0 0 289718 0 0 0 0 0 300227 0 0 0 0 0 259951 0 0 0 0 0 263149 0 0 0 0 0 267953 0 0 0 0 0 252378 0 0 0 0 0 280356 0 0 0 0 0 234298 0 0 0 0 0 271574 0 0 0 0 0 262378 0 0 0 0 0 289457 0 0 0 0 0 278274 0 0 0 0 0 288932 0 0 0 0 0 283813 0 0 0 0 0 267600 0 0 0 0 0 267574 0 0 0 0 0 254862 0 0 0 0 0 248974 0 0 0 0 0 256840 0 0 0 0 0 250914 0 0 0 0 0 279334 0 0 0 0 0 286549 0 0 0 0 0 302266 0 0 0 0 0 298205 0 0 0 0 0 300843 0 0 0 0 0 312955 0 0 0 0 0 275962 0 0 0 0 0 299561 0 0 0 0 0 260975 0 0 0 0 0 274836 0 0 0 0 0 284112 0 0 0 0 0 247331 0 0 0 0 0 298120 0 0 0 0 0 306008 0 0 0 0 0 306813 0 0 0 0 0 288550 0 0 0 0 0 301636 0 0 0 0 0 293215 0 0 0 0 0 270713 0 0 0 0 0 311803 0 0 0 0 0 281316 0 0 0 0 0 281450 0 0 0 0 0 295494 0 0 0 0 0 246411 0 0 0 0 0 267037 0 0 0 0 0 296134 0 0 0 0 0 296505 0 0 0 0 0 270677 0 0 0 0 0 290855 0 0 0 0 0 296068 0 0 0 0 0 272653 0 0 0 0 0 315720 0 0 0 0 0 286298 0 0 0 0 0 284170 0 0 0 0 0 273338 0 0 0 0 0 250262 0 0 0 0 0 294768 0 0 0 0 0 318088 0 0 0 0 0 319111 0 0 0 0 0 312982 0 0 0 0 0 335511 0 0 0 0 0 319674 0 0 0 0 0 316796 0 0 0 0 0 329992 0 0 0 0 0 291352 0 0 0 0 0 314131 0 0 0 0 0 309876 0 0 0 0 0 288494 0 0 0 0 0 329991 0 0 0 0 0 311663 0 0 0 0 0 317854 0 0 0 0 0 344729 0 0 0 0 0 324108 0 0 0 0 0 333756 0 0 0 0 0 297013 0 0 0 0 0 313249 0 0 0 0 0 329660 0 0 0 0 0 320586 0 0 0 0 0 325786 0 0 0 0 0 293425 0 0 0 0 0 324180 0 0 0 0 0 315528 0 0 0 0 0 319982 0 0 0 0 0 327865 0 0 0 0 0 312106 0 0 0 0 0 329039 0 0 0 0 0 277589 0 0 0 0 0 300884 0 0 0 0 0 314028 0 0 0 0 0 314259 0 0 0 0 0 303472 0 0 0 0 0 290744 0 0 0 0 0 313340 0 0 0 0 0 294281 0 0 0 0 0 325796 0 0 0 0 0 329839 0 0 0 0 0 322588 0 0 0 0 0 336528 0 0 0 0 0 316381 0 0 0 0 0 308602 0 0 0 0 0 299010 0 0 0 0 0 293645 0 0 0 0 0 320108 0 0 0 0 0 252869 0 0 0 0 0 324248 0 0 0 0 0 304775 0 0 0 0 0 320208 0 0 0 0 0 321260 0 0 0 0 0 310320 0 0 0 0 0 319197 0 0 0 0 0 297503 0 0 0 0 0 316184 0 0 0 0 0 303411 0 0 0 0 0 300841 0 0 0 0 0
Names of X columns:
barrels_purchased defl_pricedum defl_price1dum defl_price2dum dum barrels1dum
Sample Range:
(leave blank to include all observations)
From:
To:
Column Number of Endogenous Series
(?)
Fixed Seasonal Effects
Do not include Seasonal Dummies
Include Seasonal Dummies
Type of Equation
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) 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