| vertraging met 2 lags | *The author of this computation has been verified* | R Software Module: /rwasp_multipleregression.wasp (opens new window with default values) | Title produced by software: Multiple Regression | Date of computation: Sun, 05 Dec 2010 10:34:04 +0000 | | Cite this page as follows: | Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc.htm/, Retrieved Sun, 05 Dec 2010 11:33:03 +0100 | | BibTeX entries for LaTeX users: | @Manual{KEY,
author = {{YOUR NAME}},
publisher = {Office for Research Development and Education},
title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc.htm/},
year = {2010},
}
@Manual{R,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Development Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2010},
note = {{ISBN} 3-900051-07-0},
url = {http://www.R-project.org},
}
| | Original text written by user: | | | IsPrivate? | No (this computation is public) | | User-defined keywords: | | | Dataseries X: | » Textbox « » Textfile « » CSV « | 9939 2462 9321 9769
9336 3695 9939 9321
10195 4831 9336 9939
9464 5134 10195 9336
10010 6250 9464 10195
10213 5760 10010 9464
9563 6249 10213 10010
9890 2917 9563 10213
9305 1741 9890 9563
9391 2359 9305 9890
9928 1511 9391 9305
8686 2059 9928 9391
9843 2635 8686 9928
9627 2867 9843 8686
10074 4403 9627 9843
9503 5720 10074 9627
10119 4502 9503 10074
10000 5749 10119 9503
9313 5627 10000 10119
9866 2846 9313 10000
9172 1762 9866 9313
9241 2429 9172 9866
9659 1169 9241 9172
8904 2154 9659 9241
9755 2249 8904 9659
9080 2687 9755 8904
9435 4359 9080 9755
8971 5382 9435 9080
10063 4459 8971 9435
9793 6398 10063 8971
9454 4596 9793 10063
9759 3024 9454 9793
8820 1887 9759 9454
9403 2070 8820 9759
9676 1351 9403 8820
8642 2218 9676 9403
9402 2461 8642 9676
9610 3028 9402 8642
9294 4784 9610 9402
9448 4975 9294 9610
10319 4607 9448 9294
9548 6249 10319 9448
9801 4809 9548 10319
9596 3157 9801 9548
8923 1910 9596 9801
9746 2228 8923 9596
9829 1594 9746 8923
9125 2467 982 etc... | | Output produced by software: | Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!
Multiple Linear Regression - Estimated Regression Equation | geboortes[t] = + 3636.49072146087 -0.112892682481442huwelijken[t] + 0.263683500627484`geboortes-1`[t] + 0.288035361724047`geboortes-2`[t] + 1160.87808712201M1[t] + 804.780496030499M2[t] + 1154.06440433495M3[t] + 1093.94205740715M4[t] + 1625.10788116370M5[t] + 1529.28339577008M6[t] + 984.223018622453M7[t] + 980.829801148078M8[t] + 147.756081412069M9[t] + 717.424338136781M10[t] + 1000.90518467358M11[t] + 5.07968162684443t + e[t] |
Multiple Linear Regression - Ordinary Least Squares | Variable | Parameter | S.D. | T-STAT H0: parameter = 0 | 2-tail p-value | 1-tail p-value | (Intercept) | 3636.49072146087 | 1159.935649 | 3.1351 | 0.002422 | 0.001211 | huwelijken | -0.112892682481442 | 0.086241 | -1.309 | 0.194366 | 0.097183 | `geboortes-1` | 0.263683500627484 | 0.113501 | 2.3232 | 0.022777 | 0.011388 | `geboortes-2` | 0.288035361724047 | 0.103306 | 2.7882 | 0.006656 | 0.003328 | M1 | 1160.87808712201 | 179.014803 | 6.4848 | 0 | 0 | M2 | 804.780496030499 | 173.408091 | 4.641 | 1.4e-05 | 7e-06 | M3 | 1154.06440433495 | 273.383148 | 4.2214 | 6.5e-05 | 3.3e-05 | M4 | 1093.94205740715 | 308.809287 | 3.5425 | 0.000673 | 0.000336 | M5 | 1625.10788116370 | 324.639934 | 5.0059 | 3e-06 | 2e-06 | M6 | 1529.28339577008 | 331.642973 | 4.6112 | 1.5e-05 | 8e-06 | M7 | 984.223018622453 | 310.683442 | 3.1679 | 0.002192 | 0.001096 | M8 | 980.829801148078 | 169.087085 | 5.8007 | 0 | 0 | M9 | 147.756081412069 | 141.153351 | 1.0468 | 0.298435 | 0.149218 | M10 | 717.424338136781 | 167.257971 | 4.2893 | 5.1e-05 | 2.5e-05 | M11 | 1000.90518467358 | 153.908161 | 6.5033 | 0 | 0 | t | 5.07968162684443 | 1.519014 | 3.3441 | 0.001271 | 0.000635 |
Multiple Linear Regression - Regression Statistics | Multiple R | 0.884336823751576 | R-squared | 0.782051617843026 | Adjusted R-squared | 0.740138467428223 | F-TEST (value) | 18.6588602885557 | F-TEST (DF numerator) | 15 | F-TEST (DF denominator) | 78 | p-value | 0 | Multiple Linear Regression - Residual Statistics | Residual Standard Deviation | 262.90500426931 | Sum Squared Residuals | 5391285.21904798 |
Multiple Linear Regression - Actuals, Interpolation, and Residuals | Time or Index | Actuals | Interpolation Forecast | Residuals Prediction Error | 1 | 9939 | 9796.11806397139 | 142.881936028613 | 2 | 9336 | 9339.82003834253 | -3.82003834253265 | 3 | 10195 | 9584.942243642 | 610.057756358005 | 4 | 9464 | 9548.51189946857 | -84.5118994685719 | 5 | 10010 | 10013.4389079649 | -3.43890796494174 | 6 | 10213 | 9911.4288605364 | 301.571139463592 | 7 | 9563 | 9527.0387014109 | 35.9612985890944 | 8 | 9890 | 9791.96048661366 | 98.039513386343 | 9 | 9305 | 8995.72976268722 | 309.270237312777 | 10 | 9391 | 9440.64273868194 | -49.6427386819357 | 11 | 9928 | 9679.11235603523 | 248.887643964766 | 12 | 8686 | 8787.7907439339 | -101.790743933897 | 13 | 9843 | 9715.90240903993 | 127.097590960076 | 14 | 9627 | 9286.03528820429 | 340.96471179571 | 15 | 10074 | 9743.29699522328 | 330.703004776724 | 16 | 9503 | 9595.22555374235 | -92.2255537423501 | 17 | 10119 | 10247.1628742205 | -128.162874220498 | 18 | 10000 | 10013.6017402415 | -13.6017402414695 | 19 | 9313 | 9633.44539823076 | -320.445398230761 | 20 | 9866 | 9733.65963938788 | 132.340360612121 | 21 | 9172 | 8975.97795143118 | 196.022048568825 | 22 | 9241 | 9451.71367616553 | -210.713676165533 | 23 | 9659 | 9700.8166047626 | -41.8166047625995 | 24 | 8904 | 8723.8859526929 | 180.114047307106 | 25 | 9755 | 9800.43665483292 | -45.4366548329166 | 26 | 9080 | 9406.8997113737 | -326.899711373707 | 27 | 9435 | 9639.63846609964 | -204.638466099642 | 28 | 8971 | 9368.2903601792 | -397.290360179194 | 29 | 10063 | 9988.63922061385 | 74.3607793861546 | 30 | 9793 | 9833.28948036081 | -40.289480360814 | 31 | 9454 | 9740.08146850483 | -286.081468504825 | 32 | 9759 | 9752.07697513991 | 6.92302486008712 | 33 | 8820 | 9035.22139707908 | -215.221397079078 | 34 | 9403 | 9429.56195277316 | -26.5619527731566 | 35 | 9676 | 9682.5545958479 | -6.5545958478981 | 36 | 8642 | 8828.76134864618 | -186.761348646177 | 37 | 9402 | 9773.2711096539 | -371.271109653892 | 38 | 9610 | 9260.81394567647 | 349.186054323534 | 39 | 9294 | 9690.69102821114 | -396.691028211141 | 40 | 9448 | 9590.67322959654 | -142.673229596544 | 41 | 10319 | 10118.0513269249 | 200.948673075056 | 42 | 9548 | 10115.9625132757 | -567.962513275689 | 43 | 9801 | 9786.12610160603 | 14.8738983939659 | 44 | 9596 | 9818.94793898736 | -222.947938987360 | 45 | 8923 | 9150.5489048201 | -227.548904820103 | 46 | 9746 | 9452.89072506683 | 293.109274933167 | 47 | 9829 | 9836.18893649984 | -7.18893649984472 | 48 | 9125 | 9000.74695489778 | 124.253045102215 | 49 | 9782 | 10032.6371814359 | -250.637181435944 | 50 | 9441 | 9495.726071993 | -54.7260719930035 | 51 | 9162 | 9827.71450914803 | -665.71450914803 | 52 | 9915 | 9569.61281577675 | 345.387184223256 | 53 | 10444 | 10132.8328437666 | 311.167156233379 | 54 | 10209 | 10431.2061171296 | -222.206117129616 | 55 | 9985 | 10035.8189929045 | -50.8189929044843 | 56 | 9842 | 10110.7978762684 | -268.797876268362 | 57 | 9429 | 9319.99963940786 | 109.000360592138 | 58 | 10132 | 9711.3538939417 | 420.646106058298 | 59 | 9849 | 10146.2533378513 | -297.253337851295 | 60 | 9172 | 9218.34824902134 | -46.3482490213431 | 61 | 10313 | 10115.1339731965 | 197.866026803507 | 62 | 9819 | 9710.91320844425 | 108.086791555751 | 63 | 9955 | 10143.5476826325 | -188.547682632449 | 64 | 10048 | 9958.25614872157 | 89.7438512784339 | 65 | 10082 | 10452.4165853727 | -370.416585372677 | 66 | 10541 | 10422.7122701434 | 118.287729856579 | 67 | 10208 | 10042.6818157895 | 165.318184210520 | 68 | 10233 | 10343.4557969425 | -110.455796942469 | 69 | 9439 | 9547.27191919747 | -108.271919197470 | 70 | 9963 | 9885.53666661955 | 77.4633333804533 | 71 | 10158 | 10173.7685252058 | -15.7685252057688 | 72 | 9225 | 9325.5388833213 | -100.538883321297 | 73 | 10474 | 10245.7649636926 | 228.235036307412 | 74 | 9757 | 9842.11939349422 | -85.1193934942222 | 75 | 10490 | 10236.5612466379 | 253.438753362084 | 76 | 10281 | 10061.3678626308 | 219.632137369163 | 77 | 10444 | 10751.7142609246 | -307.71426092463 | 78 | 10640 | 10623.7684723606 | 16.2315276394003 | 79 | 10695 | 10135.4561510115 | 559.54384898846 | 80 | 10786 | 10568.3406883947 | 217.659311605283 | 81 | 9832 | 9902.3336761824 | -70.3336761823956 | 82 | 9747 | 10181.9710950787 | -434.971095078689 | 83 | 10411 | 10291.3056437974 | 119.694356202640 | 84 | 9511 | 9379.9278674866 | 131.072132513392 | 85 | 10402 | 10430.7356441769 | -28.7356441768552 | 86 | 9701 | 10028.6723424715 | -327.672342471529 | 87 | 10540 | 10278.6078284056 | 261.392171594449 | 88 | 10112 | 10050.0621298842 | 61.9378701158079 | 89 | 10915 | 10691.7439802118 | 223.256019788158 | 90 | 11183 | 10775.0305459520 | 407.969454048017 | 91 | 10384 | 10502.3513705420 | -118.351370541969 | 92 | 10834 | 10686.7605982656 | 147.239401734356 | 93 | 9886 | 9878.9167491947 | 7.08325080530593 | 94 | 10216 | 10285.3292516726 | -69.3292516726035 |
Goldfeld-Quandt test for Heteroskedasticity | p-values | Alternative Hypothesis | breakpoint index | greater | 2-sided | less | 19 | 0.201182633859419 | 0.402365267718837 | 0.798817366140581 | 20 | 0.104773992835336 | 0.209547985670672 | 0.895226007164664 | 21 | 0.0706728628117478 | 0.141345725623496 | 0.929327137188252 | 22 | 0.0340786981996974 | 0.0681573963993948 | 0.965921301800303 | 23 | 0.036950761932912 | 0.073901523865824 | 0.963049238067088 | 24 | 0.0463920786586959 | 0.0927841573173918 | 0.953607921341304 | 25 | 0.0296777603368790 | 0.0593555206737580 | 0.970322239663121 | 26 | 0.0452378030011035 | 0.090475606002207 | 0.954762196998896 | 27 | 0.251133967892408 | 0.502267935784815 | 0.748866032107592 | 28 | 0.253202265363620 | 0.506404530727239 | 0.74679773463638 | 29 | 0.205827469367373 | 0.411654938734746 | 0.794172530632627 | 30 | 0.161554530874449 | 0.323109061748898 | 0.83844546912555 | 31 | 0.138294937491488 | 0.276589874982976 | 0.861705062508512 | 32 | 0.103264711407728 | 0.206529422815455 | 0.896735288592272 | 33 | 0.0755784135863159 | 0.151156827172632 | 0.924421586413684 | 34 | 0.0941304277345407 | 0.188260855469081 | 0.905869572265459 | 35 | 0.0669925425152418 | 0.133985085030484 | 0.933007457484758 | 36 | 0.0481968602958169 | 0.0963937205916337 | 0.951803139704183 | 37 | 0.0379180784555797 | 0.0758361569111594 | 0.96208192154442 | 38 | 0.143321067205705 | 0.286642134411409 | 0.856678932794296 | 39 | 0.154041480919744 | 0.308082961839487 | 0.845958519080256 | 40 | 0.168888597567551 | 0.337777195135101 | 0.83111140243245 | 41 | 0.24409698630166 | 0.48819397260332 | 0.75590301369834 | 42 | 0.264810288311703 | 0.529620576623406 | 0.735189711688297 | 43 | 0.329939281986394 | 0.659878563972788 | 0.670060718013606 | 44 | 0.333593505747279 | 0.667187011494558 | 0.666406494252721 | 45 | 0.306111148654739 | 0.612222297309479 | 0.693888851345261 | 46 | 0.434353035691273 | 0.868706071382546 | 0.565646964308727 | 47 | 0.41836567671648 | 0.83673135343296 | 0.58163432328352 | 48 | 0.514201346488836 | 0.971597307022327 | 0.485798653511164 | 49 | 0.460465929288417 | 0.920931858576834 | 0.539534070711583 | 50 | 0.407831311308252 | 0.815662622616504 | 0.592168688691748 | 51 | 0.791732530612401 | 0.416534938775197 | 0.208267469387599 | 52 | 0.843270301189228 | 0.313459397621543 | 0.156729698810772 | 53 | 0.876863273479989 | 0.246273453040022 | 0.123136726520011 | 54 | 0.85261189308446 | 0.294776213831081 | 0.147388106915541 | 55 | 0.829543458370346 | 0.340913083259307 | 0.170456541629653 | 56 | 0.886576326456198 | 0.226847347087604 | 0.113423673543802 | 57 | 0.860332345954129 | 0.279335308091742 | 0.139667654045871 | 58 | 0.933998230229 | 0.132003539541999 | 0.0660017697709995 | 59 | 0.909252198090309 | 0.181495603819382 | 0.090747801909691 | 60 | 0.876331446088798 | 0.247337107822404 | 0.123668553911202 | 61 | 0.864236806830297 | 0.271526386339405 | 0.135763193169703 | 62 | 0.898391347483002 | 0.203217305033996 | 0.101608652516998 | 63 | 0.870320215729554 | 0.259359568540893 | 0.129679784270446 | 64 | 0.852241302104237 | 0.295517395791525 | 0.147758697895763 | 65 | 0.879465696102535 | 0.24106860779493 | 0.120534303897465 | 66 | 0.836107602374454 | 0.327784795251092 | 0.163892397625546 | 67 | 0.799848130419027 | 0.400303739161947 | 0.200151869580973 | 68 | 0.838727087474007 | 0.322545825051985 | 0.161272912525993 | 69 | 0.848150847229067 | 0.303698305541865 | 0.151849152770933 | 70 | 0.773806674706725 | 0.452386650586549 | 0.226193325293275 | 71 | 0.7124341347609 | 0.575131730478201 | 0.287565865239101 | 72 | 0.597733776226374 | 0.804532447547251 | 0.402266223773626 | 73 | 0.4874974494068 | 0.9749948988136 | 0.512502550593199 | 74 | 0.356287802738762 | 0.712575605477525 | 0.643712197261238 | 75 | 0.277259191942267 | 0.554518383884534 | 0.722740808057733 |
Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity | Description | # significant tests | % significant tests | OK/NOK | 1% type I error level | 0 | 0 | OK | 5% type I error level | 0 | 0 | OK | 10% type I error level | 7 | 0.122807017543860 | NOK |
| | Charts produced by software: | | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/10mr591291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/10mr591291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/1ri7j1291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/1ri7j1291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/2ri7j1291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/2ri7j1291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/3ri7j1291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/3ri7j1291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/4jr6m1291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/4jr6m1291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/5jr6m1291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/5jr6m1291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/6jr6m1291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/6jr6m1291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/7c05p1291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/7c05p1291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/8c05p1291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/8c05p1291545234.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/9mr591291545234.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/05/t1291545173v4igqmxxbjjuibc/9mr591291545234.ps (open in new window) |
| | Parameters (Session): | par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ; | | Parameters (R input): | par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ; | | R code (references can be found in the software module): | library(lattice)
library(lmtest)
n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
if (n > n25) {
kp3 <- k + 3
nmkm3 <- n - k - 3
gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
numgqtests <- 0
numsignificant1 <- 0
numsignificant5 <- 0
numsignificant10 <- 0
for (mypoint in kp3:nmkm3) {
j <- 0
numgqtests <- numgqtests + 1
for (myalt in c('greater', 'two.sided', 'less')) {
j <- j + 1
gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
}
if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
}
gqarr
}
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
qqline(mysum$resid)
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
if (n > n25) {
bitmap(file='test9.png')
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
dev.off()
}
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')
if (n > n25) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-values',header=TRUE)
a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'breakpoint index',header=TRUE)
a<-table.element(a,'greater',header=TRUE)
a<-table.element(a,'2-sided',header=TRUE)
a<-table.element(a,'less',header=TRUE)
a<-table.row.end(a)
for (mypoint in kp3:nmkm3) {
a<-table.row.start(a)
a<-table.element(a,mypoint,header=TRUE)
a<-table.element(a,gqarr[mypoint-kp3+1,1])
a<-table.element(a,gqarr[mypoint-kp3+1,2])
a<-table.element(a,gqarr[mypoint-kp3+1,3])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable5.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Description',header=TRUE)
a<-table.element(a,'# significant tests',header=TRUE)
a<-table.element(a,'% significant tests',header=TRUE)
a<-table.element(a,'OK/NOK',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'1% type I error level',header=TRUE)
a<-table.element(a,numsignificant1)
a<-table.element(a,numsignificant1/numgqtests)
if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'5% type I error level',header=TRUE)
a<-table.element(a,numsignificant5)
a<-table.element(a,numsignificant5/numgqtests)
if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'10% type I error level',header=TRUE)
a<-table.element(a,numsignificant10)
a<-table.element(a,numsignificant10/numgqtests)
if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable6.tab')
}
| |
Copyright
This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Software written by Ed van Stee & Patrick Wessa
Disclaimer
Information provided on this web site is provided
"AS IS" without warranty of any kind, either express or implied,
including, without limitation, warranties of merchantability, fitness
for a particular purpose, and noninfringement. We use reasonable
efforts to include accurate and timely information and periodically
update the information, and software without notice. However, we make
no warranties or representations as to the accuracy or
completeness of such information (or software), and we assume no
liability or responsibility for errors or omissions in the content of
this web site, or any software bugs in online applications. Your use of
this web site is AT YOUR OWN RISK. Under no circumstances and under no
legal theory shall we be liable to you or any other person
for any direct, indirect, special, incidental, exemplary, or
consequential damages arising from your access to, or use of, this web
site.
Privacy Policy
We may request personal information to be submitted to our servers in order to be able to:
- personalize online software applications according to your needs
- enforce strict security rules with respect to the data that you upload (e.g. statistical data)
- manage user sessions of online applications
- alert you about important changes or upgrades in resources or applications
We NEVER allow other companies to directly offer registered users
information about their products and services. Banner references and
hyperlinks of third parties NEVER contain any personal data of the
visitor.
We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.
We carefully protect your data from loss, misuse, alteration,
and destruction. However, at any time, and under any circumstance you
are solely responsible for managing your passwords, and keeping them
secret.
We store a unique ANONYMOUS USER ID in the form of a small
'Cookie' on your computer. This allows us to track your progress when
using this website which is necessary to create state-dependent
features. The cookie is used for NO OTHER PURPOSE. At any time you may
opt to disallow cookies from this website - this will not affect other
features of this website.
We examine cookies that are used by third-parties (banner and
online ads) very closely: abuse from third-parties automatically
results in termination of the advertising contract without refund. We
have very good reason to believe that the cookies that are produced by
third parties (banner ads) do NOT cause any privacy or security risk.
FreeStatistics.org is safe. There is no need to download any
software to use the applications and services contained in this
website. Hence, your system's security is not compromised by their use,
and your personal data - other than data you submit in the account
application form, and the user-agent information that is transmitted by
your browser - is never transmitted to our servers.
As a general rule, we do not log on-line behavior of
individuals (other than normal logging of webserver 'hits'). However,
in cases of abuse, hacking, unauthorized access, Denial of Service
attacks, illegal copying, hotlinking, non-compliance with international
webstandards (such as robots.txt), or any other harmful behavior, our
system engineers are empowered to log, track, identify, publish, and
ban misbehaving individuals - even if this leads to ban entire blocks
of IP addresses, or disclosing user's identity.
FreeStatistics.org is powered by
|