| | *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, 12 Dec 2010 19:24:22 +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/12/t1292181747w09ygzm9tk4943g.htm/, Retrieved Sun, 12 Dec 2010 20:22:37 +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/12/t1292181747w09ygzm9tk4943g.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 « | 26105 29462 27071 31514
22397 26105 29462 27071
23843 22397 26105 29462
21705 23843 22397 26105
18089 21705 23843 22397
20764 18089 21705 23843
25316 20764 18089 21705
17704 25316 20764 18089
15548 17704 25316 20764
28029 15548 17704 25316
29383 28029 15548 17704
36438 29383 28029 15548
32034 36438 29383 28029
22679 32034 36438 29383
24319 22679 32034 36438
18004 24319 22679 32034
17537 18004 24319 22679
20366 17537 18004 24319
22782 20366 17537 18004
19169 22782 20366 17537
13807 19169 22782 20366
29743 13807 19169 22782
25591 29743 13807 19169
29096 25591 29743 13807
26482 29096 25591 29743
22405 26482 29096 25591
27044 22405 26482 29096
17970 27044 22405 26482
18730 17970 27044 22405
19684 18730 17970 27044
19785 19684 18730 17970
18479 19785 19684 18730
10698 18479 19785 19684
31956 10698 18479 19785
29506 31956 10698 18479
34506 29506 31956 10698
27165 34506 29506 31956
26736 27165 34506 29506
23691 26736 27165 34506
18157 23691 26736 27165
17328 18157 23691 26736
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 | X[t] = + 15528.2166014861 + 0.283174803792777Y_1[t] + 0.298954678015929Y_2[t] -0.0123849708445849Y_3[t] -3780.91761340949M1[t] -8590.0139987651M2[t] -4995.57765924133M3[t] -9992.05694547716M4[t] -10063.8242839980M5[t] -6319.54201284951M6[t] -3551.14205129836M7[t] -9582.68297879728M8[t] -14587.2298411741M9[t] + 5113.37309057484M10[t] -64.3210395853369M11[t] + 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) | 15528.2166014861 | 3489.29975 | 4.4502 | 2.9e-05 | 1.4e-05 | Y_1 | 0.283174803792777 | 0.113263 | 2.5002 | 0.014569 | 0.007284 | Y_2 | 0.298954678015929 | 0.114488 | 2.6112 | 0.010865 | 0.005432 | Y_3 | -0.0123849708445849 | 0.114838 | -0.1078 | 0.914401 | 0.4572 | M1 | -3780.91761340949 | 2225.513895 | -1.6989 | 0.093429 | 0.046715 | M2 | -8590.0139987651 | 1879.994129 | -4.5692 | 1.9e-05 | 9e-06 | M3 | -4995.57765924133 | 2534.664761 | -1.9709 | 0.052376 | 0.026188 | M4 | -9992.05694547716 | 2348.815557 | -4.2541 | 5.9e-05 | 3e-05 | M5 | -10063.8242839980 | 2108.647425 | -4.7726 | 9e-06 | 4e-06 | M6 | -6319.54201284951 | 2569.088047 | -2.4598 | 0.016172 | 0.008086 | M7 | -3551.14205129836 | 2071.511517 | -1.7143 | 0.090554 | 0.045277 | M8 | -9582.68297879728 | 1758.231334 | -5.4502 | 1e-06 | 0 | M9 | -14587.2298411741 | 1964.628892 | -7.4249 | 0 | 0 | M10 | 5113.37309057484 | 2739.961795 | 1.8662 | 0.065868 | 0.032934 | M11 | -64.3210395853369 | 2471.396257 | -0.026 | 0.979305 | 0.489652 |
Multiple Linear Regression - Regression Statistics | Multiple R | 0.949610283391202 | R-squared | 0.901759690322319 | Adjusted R-squared | 0.883662791171167 | F-TEST (value) | 49.8295140394219 | F-TEST (DF numerator) | 14 | F-TEST (DF denominator) | 76 | p-value | 0 | Multiple Linear Regression - Residual Statistics | Residual Standard Deviation | 1935.56350504491 | Sum Squared Residuals | 284726862.236691 |
Multiple Linear Regression - Actuals, Interpolation, and Residuals | Time or Index | Actuals | Interpolation Forecast | Residuals Prediction Error | 1 | 26105 | 27792.8971747924 | -1687.89717479238 | 2 | 22397 | 22803.0100337030 | -406.010033703028 | 3 | 23843 | 24314.2308813743 | -471.2308813743 | 4 | 21705 | 18660.2747624650 | 3044.72523753496 | 5 | 18089 | 18461.2916297380 | -372.291629737961 | 6 | 20764 | 20524.5400409325 | 239.459959067528 | 7 | 25316 | 22995.8915545894 | 2320.10844541058 | 8 | 17704 | 19097.8501522218 | -1393.85015222184 | 9 | 15548 | 13265.4885806936 | 2282.51141930637 | 10 | 28029 | 30023.5472391236 | -1994.54723912357 | 11 | 29383 | 27829.8859473677 | 1553.11405263233 | 12 | 36438 | 32035.5810047462 | 4402.41899525382 | 13 | 32034 | 30502.6694450170 | 1531.33055498297 | 14 | 22679 | 26538.8272266368 | -3859.82722663684 | 15 | 24319 | 26080.1909053885 | -1761.19090538848 | 16 | 18004 | 18805.9406961333 | -801.940696133347 | 17 | 17537 | 17552.0715458583 | -15.0715458583007 | 18 | 20366 | 19255.9010397799 | 1110.09896022013 | 19 | 22782 | 22764.0017775109 | 17.9982224890889 | 20 | 19169 | 18268.1377414668 | 900.86225853318 | 21 | 13807 | 12927.7177325538 | 879.282267446175 | 22 | 29743 | 29999.8920251339 | -256.892025133856 | 23 | 25591 | 27776.6234843554 | -2185.62348435545 | 24 | 29096 | 31495.7527011237 | -2399.75270112368 | 25 | 26482 | 27268.7360565064 | -786.73605650644 | 26 | 22405 | 22818.6792794291 | -413.679279429058 | 27 | 27044 | 24433.7350927458 | 2610.26490725424 | 28 | 17970 | 19564.4398128214 | -1594.43981282143 | 29 | 18730 | 18360.4885821342 | 369.511417865829 | 30 | 19684 | 19549.8150761006 | 134.184923899377 | 31 | 19785 | 22927.9505812060 | -3142.95058120596 | 32 | 18479 | 17200.8004938754 | 1278.19950612459 | 33 | 10698 | 11844.8064980391 | -1146.80649803908 | 34 | 31956 | 28950.3405899323 | 3005.65941006766 | 35 | 29506 | 27482.3848610801 | 2023.61513891990 | 36 | 34506 | 33304.4736347775 | 1201.52636522253 | 37 | 27165 | 29943.7113689787 | -2778.71136897866 | 38 | 26736 | 24580.9453176292 | 2155.05468237085 | 39 | 23691 | 25797.3485207880 | -2106.34852078796 | 40 | 18157 | 19901.2684711044 | -1744.26847110439 | 41 | 17328 | 17357.4079263281 | -29.4079263281101 | 42 | 18205 | 19250.2353332140 | -1045.23533321402 | 43 | 20995 | 22087.6845982702 | -1092.68459827017 | 44 | 17382 | 17118.6517668032 | 263.348233196776 | 45 | 9367 | 11914.2162705568 | -2547.21627055681 | 46 | 31124 | 28230.4958295787 | 2893.50417042127 | 47 | 26551 | 26862.4610609018 | -311.461060901819 | 48 | 30651 | 32235.4461936547 | -1584.4461936547 | 49 | 25859 | 27978.9657225631 | -2119.96572256313 | 50 | 25100 | 23095.2463289701 | 2004.75367102987 | 51 | 25778 | 24991.3837949000 | 786.616205099955 | 52 | 20418 | 20019.3392053089 | 398.66079469112 | 53 | 18688 | 18641.8463830246 | 46.1536169754334 | 54 | 20424 | 20285.4421592136 | 138.557840786435 | 55 | 24776 | 23094.6254309084 | 1681.3745690916 | 56 | 19814 | 18835.8725701124 | 978.127429887575 | 57 | 12738 | 13705.7627806549 | -967.762780654945 | 58 | 31566 | 29865.3082953355 | 1700.69170466445 | 59 | 30111 | 27965.2802946759 | 2145.71970532411 | 60 | 30019 | 33333.9367261229 | -3314.93672612293 | 61 | 31934 | 28858.8037431895 | 3075.19625681051 | 62 | 25826 | 24582.5034092985 | 1243.49659070154 | 63 | 26835 | 27020.9456729742 | -185.945672974149 | 64 | 20205 | 20460.4573712766 | -255.457371276559 | 65 | 17789 | 18888.5337556464 | -1099.53375564637 | 66 | 20520 | 19954.0997500037 | 565.90024999626 | 67 | 22518 | 22855.6879553261 | -337.687955326084 | 68 | 15572 | 18236.2976010271 | -2664.29760102714 | 69 | 11509 | 11828.3066428049 | -319.306642804933 | 70 | 25447 | 28277.0859814977 | -2830.08598149773 | 71 | 24090 | 25917.6554173090 | -1827.65541730904 | 72 | 27786 | 29814.8586868751 | -2028.85868687515 | 73 | 26195 | 26502.2519265843 | -307.251926584328 | 74 | 20516 | 22364.3673237774 | -1848.36732377739 | 75 | 22759 | 23829.2422075970 | -1070.24220759704 | 76 | 19028 | 17789.8648784297 | 1238.13512157031 | 77 | 16971 | 17402.4619391741 | -431.461939174095 | 78 | 20036 | 19421.0742456390 | 614.925754360975 | 79 | 22485 | 22488.6635343574 | -3.66353435742568 | 80 | 18730 | 18092.3896744931 | 637.610325506859 | 81 | 14538 | 12718.7014946968 | 1819.29850530322 | 82 | 27561 | 30079.3300393982 | -2518.33003939823 | 83 | 25985 | 27382.7089343100 | -1397.70893431002 | 84 | 34670 | 30945.9510526999 | 3724.04894730011 | 85 | 32066 | 28991.9645623685 | 3074.03543763146 | 86 | 27186 | 26061.4210805559 | 1124.57891944405 | 87 | 29586 | 27387.9229242323 | 2198.07707576774 | 88 | 21359 | 21644.4148024607 | -285.414802460667 | 89 | 21553 | 20020.8982380964 | 1532.10176190358 | 90 | 19573 | 21330.8923551167 | -1757.89235511668 | 91 | 24256 | 23698.4945678316 | 557.50543216837 |
Goldfeld-Quandt test for Heteroskedasticity | p-values | Alternative Hypothesis | breakpoint index | greater | 2-sided | less | 18 | 0.441396375022166 | 0.882792750044332 | 0.558603624977834 | 19 | 0.600318068217923 | 0.799363863564154 | 0.399681931782077 | 20 | 0.537086816887232 | 0.925826366225535 | 0.462913183112768 | 21 | 0.448098021551798 | 0.896196043103596 | 0.551901978448202 | 22 | 0.332048430678689 | 0.664096861357379 | 0.66795156932131 | 23 | 0.343963323986153 | 0.687926647972306 | 0.656036676013847 | 24 | 0.840588087839614 | 0.318823824320772 | 0.159411912160386 | 25 | 0.779671048016554 | 0.440657903966891 | 0.220328951983446 | 26 | 0.711823983774338 | 0.576352032451324 | 0.288176016225662 | 27 | 0.702103713406819 | 0.595792573186362 | 0.297896286593181 | 28 | 0.762690795892442 | 0.474618408215116 | 0.237309204107558 | 29 | 0.702469702624331 | 0.595060594751338 | 0.297530297375669 | 30 | 0.625294990562958 | 0.749410018874084 | 0.374705009437042 | 31 | 0.761130745191144 | 0.477738509617712 | 0.238869254808856 | 32 | 0.722237771639335 | 0.555524456721329 | 0.277762228360665 | 33 | 0.743374407344538 | 0.513251185310924 | 0.256625592655462 | 34 | 0.775399573621534 | 0.449200852756931 | 0.224600426378466 | 35 | 0.770630355020125 | 0.45873928995975 | 0.229369644979875 | 36 | 0.731557534383313 | 0.536884931233374 | 0.268442465616687 | 37 | 0.76529354528691 | 0.469412909426179 | 0.234706454713090 | 38 | 0.82279419022098 | 0.354411619558042 | 0.177205809779021 | 39 | 0.821528088740679 | 0.356943822518642 | 0.178471911259321 | 40 | 0.806281562557162 | 0.387436874885676 | 0.193718437442838 | 41 | 0.754837022425662 | 0.490325955148675 | 0.245162977574338 | 42 | 0.719078766851162 | 0.561842466297676 | 0.280921233148838 | 43 | 0.674834009747382 | 0.650331980505236 | 0.325165990252618 | 44 | 0.61085354955047 | 0.778292900899059 | 0.389146450449529 | 45 | 0.665462908028117 | 0.669074183943766 | 0.334537091971883 | 46 | 0.752680056624289 | 0.494639886751421 | 0.247319943375711 | 47 | 0.696599106193974 | 0.606801787612051 | 0.303400893806025 | 48 | 0.688048764184126 | 0.623902471631748 | 0.311951235815874 | 49 | 0.796404689374823 | 0.407190621250355 | 0.203595310625177 | 50 | 0.789668153582554 | 0.420663692834891 | 0.210331846417445 | 51 | 0.736306166786221 | 0.527387666427557 | 0.263693833213779 | 52 | 0.694388200276487 | 0.611223599447026 | 0.305611799723513 | 53 | 0.626838288925003 | 0.746323422149993 | 0.373161711074997 | 54 | 0.556561797352774 | 0.886876405294453 | 0.443438202647226 | 55 | 0.53496144955604 | 0.93007710088792 | 0.46503855044396 | 56 | 0.482584874616921 | 0.965169749233843 | 0.517415125383079 | 57 | 0.430028626046065 | 0.86005725209213 | 0.569971373953935 | 58 | 0.520675232888065 | 0.95864953422387 | 0.479324767111935 | 59 | 0.536803826427483 | 0.926392347145033 | 0.463196173572517 | 60 | 0.749918166183122 | 0.500163667633756 | 0.250081833816878 | 61 | 0.76743751394201 | 0.465124972115979 | 0.232562486057989 | 62 | 0.732566275179782 | 0.534867449640436 | 0.267433724820218 | 63 | 0.708930713588155 | 0.582138572823689 | 0.291069286411845 | 64 | 0.63049459485146 | 0.739010810297081 | 0.369505405148540 | 65 | 0.565364287765549 | 0.869271424468902 | 0.434635712234451 | 66 | 0.50818798402215 | 0.9836240319557 | 0.49181201597785 | 67 | 0.409211889894579 | 0.818423779789158 | 0.590788110105421 | 68 | 0.455129500334603 | 0.910259000669205 | 0.544870499665397 | 69 | 0.366768469503080 | 0.733536939006159 | 0.633231530496920 | 70 | 0.318832163880075 | 0.63766432776015 | 0.681167836119925 | 71 | 0.232479720560809 | 0.464959441121619 | 0.76752027943919 | 72 | 0.54544978404701 | 0.90910043190598 | 0.45455021595299 | 73 | 0.503492250011608 | 0.993015499976783 | 0.496507749988392 |
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 | 0 | 0 | OK |
| | Charts produced by software: | | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/10ad7f1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/10ad7f1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/1e29o1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/1e29o1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/2e29o1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/2e29o1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/3e29o1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/3e29o1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/47c8r1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/47c8r1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/57c8r1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/57c8r1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/67c8r1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/67c8r1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/7z37u1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/7z37u1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/8ad7f1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/8ad7f1292181853.ps (open in new window) |
| http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/9ad7f1292181853.png (open in new window) | http://www.freestatistics.org/blog/date/2010/Dec/12/t1292181747w09ygzm9tk4943g/9ad7f1292181853.ps (open in new window) |
| | Parameters (Session): | par1 = 1 ; par2 = Include Monthly Dummies ; par3 = No Linear Trend ; | | Parameters (R input): | par1 = 1 ; par2 = Include Monthly Dummies ; par3 = No 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
|