Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
102750 42.6 2.75 45.498 95276 42.9 2.73 46.1773 112053 43.3 2.82 46.1937 98841 43.6 2.83 46.1272 123102 43.9 2.9 46.4199 118152 44.2 3.05 46.4535 101752 44.3 3.15 46.648 148219 45.1 3.26 46.5669 124966 45.2 3.38 46.9866 134741 45.6 3.54 47.2997 132168 45.9 3.81 47.548 100950 46.2 5.27 47.4375 96418 46.6 6.71 47.1083 86891 47.2 9.09 46.9634 89796 47.8 11.08 46.9733 119663 48 11.91 46.83 130539 48.6 11.81 47.1848 120851 49 11.81 47.1292 145422 49.4 12.09 47.1505 150583 50 11.95 46.6882 127054 50.6 11.67 46.7161 137473 51.1 11.6 46.536 127094 51.5 11.71 45.0062 132080 51.9 11.62 43.4204 188311 52.1 11.64 42.8246 107487 52.5 11.66 41.8301 84669 52.7 11.67 41.3862 149184 52.9 11.69 41.4258 121026 53.2 11.58 41.3326 81073 53.6 11.4 41.6042 132947 54.2 11.44 42.0025 141294 54.3 11.38 42.4426 155077 54.6 11.31 42.9708 145154 54.9 11.45 43.1611 127094 55.3 11.73 43.2561 151414 55.5 12.11 43.7944 167858 55.6 12.23 44.4309 127070 55.8 12.39 44.8644 154692 55.9 12.34 44.916 170905 56.1 12.42 45.1733 127751 56.5 12.37 45.3729 173795 56.8 12.37 45.3841 190181 57.1 12.39 45.6491 198417 57.4 12.43 45.9698 183018 57.6 12.48 46.1015 171608 57.9 12.45 46.1172 188087 58 12.58 46.7939 197042 58.2 12.59 47.2798 208788 58.5 12.54 47.023 178111 59.1 13.01 47.7335 236455 59.5 13.31 48.3415 233219 60 13.45 48.7789 188106 60.3 13.28 49.2046 238876 60.7 13.38 49.5627 205148 61 13.36 49.6389 214727 61.2 13.4 49.6517 213428 61.4 13.49 49.8872 195128 61.6 13.47 49.9859 206047 61.9 13.62 50.0357 201773 62.1 13.57 50.1135 192772 62.5 13.59 49.4201 198230 62.9 13.48 49.6618 181172 63.4 13.47 50.6053 189079 63.9 13.47 51.6639 179073 64.5 13.36 51.8472 197421 65.2 13.37 52.2056 195244 65.7 13.4 52.1834 219826 66 13.41 52.3807 211793 66.5 13.37 52.5124 203394 67.1 13.42 52.9384 209578 67.4 13.41 53.3363 214769 67.7 13.46 53.6296 226177 68.3 13.64 53.2837 191449 69.1 13.93 53.5675 200989 69.8 14.46 53.7364 216707 70.6 14.92 53.1571 192882 71.5 16.27 53.5566 199736 72.3 17.36 53.5534 202349 73.1 19.07 53.4808 204137 73.8 21.1 53.1195 215588 74.6 22.39 53.1786 229454 75.2 23.13 53.4617 175048 75.9 23.27 53.409 212799 76.7 24.57 53.4536 181727 77.8 26.32 53.7071 211607 78.9 28.57 53.7262 185853 80.1 30.44 53.5481 158277 81 31.4 52.4571 180695 81.8 31.84 51.1904 175959 82.7 31.86 50.5575 139550 82.7 32.3 50.166 155810 83.3 32.93 50.353 138305 84 32.73 51.1727 147014 84.8 33.1 51.8129 135994 85.5 33.23 52.7175 166455 86.3 33.94 53.0142 177737 87 34.27 52.7119 167021 87.9 35.96 52.4633 132134 88.5 36.25 52.7501 169834 89.1 36.92 52.5233 130599 89.8 36.16 52.8211 156836 90.6 36.59 53.0699 119749 91.6 35.05 53.4044 148996 92.3 34.53 53.3959 147491 93.2 34.07 53.0761 147216 93.4 33.65 52.6972 153455 93.7 33.84 52.0996 112004 94 33.99 51.5219 158512 94.3 35.41 50.4933 104139 94.6 35.53 51.4979 102536 94.5 34.71 51.1159 93017 94.9 33.2 50.6623 91988 95.8 32.25 50.3505 123616 97 32.92 50.1943 134498 97.5 33.27 50.0395 149812 97.7 32.91 49.6075 110334 97.9 32.39 49.4584 136639 98.2 32.44 49.011 102712 98 32.84 48.8232 112951 97.6 32.44 48.4682 107897 97.8 32.5 49.3992 73242 97.9 31.12 49.089 72800 97.9 30.28 49.4906 78767 98.6 28.76 50.0805 114791 99.2 28.59 50.4295 109351 99.5 28.83 50.7333 122520 99.9 28.93 51.5016 137338 100.2 29.31 52.0679 132061 100.7 29.27 52.8472 130607 101 29.36 53.2874 118570 101.2 29.05 53.4759 95873 101.3 29 53.7593 103116 101.9 27.65 54.8216 98619 102.4 27.64 55.0698 104178 102.6 27.8 55.3384 123468 103.1 27.84 55.6911 99651 103.4 27.85 55.9506 120264 103.7 27.76 56.1549 122795 104.1 28.05 56.3326 108524 104.5 27.66 56.3847 105760 105 27.39 56.2832 117191 105.3 27.56 56.1943 122882 105.3 27.55 56.4108 93275 105.3 27.3 56.4759 99842 105.5 27.38 56.3801 83803 106 26.91 56.5796 61132 106.4 26.05 56.6645 118563 106.9 26.52 56.5122 106993 107.3 26.79 56.5982 118108 107.6 26.52 56.6317 99017 107.8 25.91 56.2637 99852 108 25.76 56.496 112720 108.3 25.42 56.7412 113636 108.7 25.65 56.508 118220 109 25.69 56.6984 128854 109.3 26.04 57.2954 123898 109.6 25.8 57.5555 100823 109.3 23.13 57.1707 115107 108.8 18.1 56.7784 90624 108.6 12.78 56.8228 132001 108.9 12.24 56.938 157969 109.5 12.04 56.7427 169333 109.5 11.03 57.0569 144907 109.7 10.09 56.9807 169346 110.2 11.08 57.0954 144666 110.3 11.79 57.3542 158829 110.4 12.23 57.623 127286 110.5 12.4 58.1006 120578 111.2 13.86 57.9173 129293 111.6 15.47 58.663 122371 112.1 15.87 58.7602 115176 112.7 16.57 59.1416 142168 113.1 16.92 59.517 153260 113.5 17.31 59.7996 173906 113.8 17.77 60.2152 178446 114.4 18.07 60.7146 155962 115 17.49 60.8781 168257 115.3 17.21 61.7569 149456 115.4 17.12 62.091 136105 115.4 16.46 62.394 141507 115.7 22.4 62.4207 152084 116 15.2 62.6908 145138 116.5 14.24 62.8421 146548 117.1 14.21 63.1885 173098 117.5 14.69 63.1203 165471 118 14.68 63.2843 152271 118.5 14.02 63.3155 163201 119 13.38 63.5859 157823 119.8 13.08 63.405 166167 120.2 11.92 63.7184 154253 120.3 11.52 63.8175 170299 120.5 12.34 64.1273 166388 121.1 13.91 64.3162 141051 121.6 14.84 64.026 160254 122.3 15.54 64.166 164995 123.1 17.33 64.222 195971 123.8 17.97 63.7707 182635 124.1 17.27 63.8022 189829 124.4 16.93 63.236 209476 124.6 15.95 63.8059 189848 125 16.14 63.576 183746 125.6 16.61 63.5346 192682 125.9 17.08 63.7465 169677 126.1 17.72 64.1419 201823 127.4 18.85 63.7117 172643 128 18.79 64.3504 202931 128.7 17.75 64.6721 175863 128.9 16.02 64.5975 222061 129.2 14.61 64.7028 199797 129.9 13.83 64.9174 214638 130.4 13.92 64.8436 200106 131.6 19.57 65.043 166077 132.7 25.63 65.1372 160586 133.5 30.08 64.6442 158330 133.8 29.51 63.8853 141749 133.8 25.75 63.4658 170795 134.6 22.98 63.1915 153286 134.8 18.39 62.7585 163426 135 16.75 62.4265 172562 135.2 16.39 62.5503 197474 135.6 16.57 63.1756 189822 136 16.4 63.742 188511 136.2 16.15 63.8029 207437 136.6 16.8 63.8503 192128 137.2 17.14 64.4151 175716 137.4 17.97 64.2992 159108 137.8 18.06 64.2209 175801 137.9 16.6 63.9602 186723 138.1 14.87 63.596 154970 138.6 14.42 64.0409 172446 139.3 14.48 64.5973 185965 139.5 15.5 65.0756 195525 139.7 16.74 65.2831 193156 140.2 18.27 65.2957 212705 140.5 18.2 65.8801 201357 140.9 18.03 65.5581 189971 141.3 17.86 65.715 216523 141.8 18.22 66.2013 193233 142 17.63 66.4879 191996 141.9 16.22 66.5431 211974 142.6 15.5 66.8264 175907 143.1 15.71 67.1172 206109 143.6 16.49 67.0479 220275 144 16.69 67.2498 211342 144.2 16.71 67.0325 222528 144.4 16.07 67.1532 229523 144.4 14.96 67.3586 204153 144.8 14.51 67.2888 206735 145.1 14.37 67.6092 223416 145.7 14.59 68.1214 228292 145.8 13.72 68.4089 203121 145.8 12.2 68.7737 205957 146.2 11.64 69.0299 176918 146.7 12.09 69.0418 219839 147.2 11.76 69.7582 217213 147.4 12.85 70.125 216618 147.5 14.05 70.4978 248057 148 15.18 70.948 245642 148.4 16.09 71.0595 242485 149 15.97 71.4749 260423 149.4 15 71.7333 221030 149.5 14.8 72.3479 229157 149.7 15.31 72.8018 220858 149.7 14.7 73.5563 212270 150.3 15.06 73.6891 195944 150.9 15.53 73.5889 239741 151.4 15.78 73.6895 212013 151.9 16.76 73.676 240514 152.2 17.4 73.8858 241982 152.5 16.78 74.1391 245447 152.5 15.51 73.8447 240839 152.9 15.22 74.7803 244875 153.2 15.44 75.0755 226375 153.7 15.25 74.9925 231567 153.6 15.1 75.1822 235746 153.5 15.82 75.4725 238990 154.4 16.43 74.9823 198120 154.9 16.1 76.153 201663 155.7 17.31 76.0724 238198 156.3 19.27 76.7608 261641 156.6 18.9 77.3269 253014 156.7 17.96 77.9694 275225 157 18.16 77.8351 250957 157.3 18.65 78.3005 260375 157.8 19.97 78.8378 250694 158.3 21.41 78.7843 216953 158.6 21.38 79.4683 247816 158.6 21.63 79.9829 224135 159.1 21.86 80.0837 211073 159.6 20.48 81.0483 245623 160 18.76 81.6195 250947 160.2 17.13 81.6408 278223 160.1 17.06 82.1311 254232 160.3 16.85 82.5332 266293 160.5 16.41 83.1538 280897 160.8 16.95 84.0293 274565 161.2 16.73 84.7873 280555 161.6 17.71 85.5125 252757 161.5 17.25 86.2601 250131 161.3 16.05 86.5262 271208 161.6 14.31 86.9662 230593 161.9 13.02 87.0687 263407 162.2 11.88 87.1414 289968 162.5 11.77 87.4497 282846 162.8 11.8 88.0124 271314 163 11.12 87.4571 289718 163.2 10.78 87.1484 300227 163.4 10.55 88.936 259951 163.6 10.99 88.778 263149 164 11.66 89.4857 267953 164 10.79 89.4358 252378 163.9 9.38 89.7761 280356 164.3 9.21 90.1893 234298 164.5 9.48 90.6683 271574 165 10.5 90.831 262378 166.2 12.88 91.0632 289457 166.2 14.6 91.7311 278274 166.2 14.52 91.5818 288932 166.7 16.11 92.1587 283813 167.1 17.88 92.5363 267600 167.9 19.69 92.1699 267574 168.2 20.76 93.3786 254862 168.3 21.05 93.824 248974 168.3 22.79 94.5441 256840 168.8 23.31 94.5458 250914 169.8 25.14 94.8185 279334 171.2 26.41 95.1983 286549 171.3 24.41 95.8921 302266 171.5 24.28 96.0691 298205 172.4 26.78 96.1568 300843 172.8 27.73 96.0239 312955 172.8 26.59 95.7182 275962 173.7 29.03 96.1105 299561 174 28.57 95.8225 260975 174.1 28.34 95.8391 274836 174 26.4 95.5791 284112 175.1 23.19 94.9499 247331 175.8 23.85 94.369 298120 176.2 22.75 94.1259 306008 176.9 21.66 93.9061 306813 177.7 22.65 93.2803 288550 178 23.09 92.7057 301636 177.5 22.33 92.1721 293215 177.5 22.14 92.0023 270713 178.3 23.02 91.6795 311803 177.7 19.88 91.2682 281316 177.4 17 90.7894 281450 176.7 15.46 90.8311 295494 177.1 16.29 91.3471 246411 177.8 16.58 91.3672 267037 178.8 19.27 92.1054 296134 179.8 22.53 92.479 296505 179.8 23.75 92.8824 270677 179.9 23.35 93.7637 290855 180.1 23.73 93.5461 296068 180.7 24.58 93.5765 272653 181 25.49 93.7116 315720 181.3 26.25 93.4006 286298 181.3 24.19 93.8758 284170 180.9 24.15 93.4191 273338 181.7 27.76 93.9571 250262 183.1 30.37 94.2558 294768 184.2 30.39 94.0416 318088 183.8 26.01 93.3666 319111 183.5 24.05 93.3852 312982 183.7 25.5 93.5219 335511 183.9 26.75 93.9144 319674 184.6 27.56 93.7371 316796 185.2 26.43 94.3262 329992 185 26.28 94.4442 291352 184.5 26.54 95.2224 314131 184.3 27.17 95.1545 309876 185.2 28.57 95.3434 288494 186.2 29.17 95.9228 329991 187.4 30.66 95.4538 311663 188 31 95.8653 317854 189.1 33.14 96.6472 344729 189.7 33.74 95.8588 324108 189.4 33.38 96.5901 333756 189.5 36.54 96.6687 297013 189.9 37.52 96.745 313249 190.9 41.84 97.6604 329660 191 41.19 97.8427 320586 190.3 36.46 98.5495 325786 190.7 35.27 99.002 293425 191.8 36.93 99.6741 324180 193.3 41.28 99.5181 315528 194.6 44.78 99.6518 319982 194.4 43.04 99.8158 327865 194.5 44.41 100.2232 312106 195.4 49.07 99.8997 329039 196.4 52.85 100.1025 277589 198.8 57.42 98.2644 300884 199.2 56.21 99.4949 314028 197.6 52.16 100.5129 314259 196.8 49.79 101.1118 303472 198.3 51.8 101.2313 290744 198.7 53.86 101.2755 313340 199.8 52.32 101.4651 294281 201.5 56.65 101.9012 325796 202.5 62.04 101.7589 329839 202.9 62.12 102.1304 322588 203.5 64.93 102.0989 336528 203.9 66.13 102.4526 316381 202.9 62.4 102.2753 308602 201.8 55.47 102.2299 299010 201.5 52.22 102.1419 293645 201.8 53.84 103.2191 320108 202.4 52.23 102.7129 252869 203.5 50.71 103.7659 324248 205.4 53 103.9538 304775 206.7 57.28 104.7077 320208 207.9 59.36 104.7507 321260 208.4 60.95 104.7581 310320 208.3 65.56 104.7111 319197 207.9 68.21 104.9122 297503 208.5 68.51 105.2764 316184 208.9 72.49 104.772 303411 210.2 79.65 105.3295 300841 210 82.76 105.3213
Names of X columns:
barrels_purchased cpi unit_price US_IND_PROD
Sample Range:
(leave blank to include all observations)
From:
To:
Column Number of Endogenous Series
(?)
Fixed Seasonal Effects
Include Seasonal Dummies
Do not include Seasonal Dummies
Include Seasonal Dummies
Type of Equation
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