Home » date » 2009 » Nov » 21 »

WS07-Multiple Regression

*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: Fri, 20 Nov 2009 18:20:00 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4.htm/, Retrieved Sat, 21 Nov 2009 02:26:23 +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/2009/Nov/21/t1258766771r9w0yoc73jkviy4.htm/},
    year = {2009},
}
@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 = {2009},
    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 «
423.4 0 404.1 0 500 0 472.6 0 496.1 0 562 0 434.8 0 538.2 0 577.6 0 518.1 0 625.2 0 561.2 0 523.3 0 536.1 0 607.3 0 637.3 0 606.9 0 652.9 0 617.2 0 670.4 0 729.9 0 677.2 0 710 0 844.3 0 748.2 0 653.9 0 742.6 0 854.2 0 808.4 0 1819 1 1936.5 1 1966.1 1 2083.1 1 1620.1 1 1527.6 1 1795 1 1685.1 1 1851.8 1 2164.4 1 1981.8 1 1726.5 1 2144.6 1 1758.2 1 1672.9 1 1837.3 1 1596.1 1 1446 1 1898.4 1 1964.1 1 1755.9 1 2255.3 1 1881.2 1 2117.9 1 1656.5 1 1544.1 1 2098.9 1 2133.3 1 1963.5 1 1801.2 1 2365.4 1 1936.5 1 1667.6 1 1983.5 1 2058.6 1 2448.3 1 1858.1 1 1625.4 1 2130.6 1 2515.7 1 2230.2 1 2086.9 1 2235 1 2100.2 1 2288.6 1 2490 1 2573.7 1 2543.8 1 2004.7 1 2390 1 2338.4 1 2724.5 1 2292.5 1 2386 1 2477.9 1 2337 1 2605.1 1 2560.8 1 2839.3 1 2407.2 1 2085.2 1 2735.6 1 2798.7 1 3053.2 1 2405 1 2471.9 1 2727.3 1 2790.7 1 2385.4 1 3206.6 1 2705.6 1 3518.4 1 1954.9 1 2584.3 1 2535.8 1 2685.9 1 2866 1 2236.6 1 2934.9 1 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!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Y(Export_farma_prod)[t] = + 611.496551724142 + 1678.78366805608`X(sprong)`[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)611.49655172414274.3199428.227900
`X(sprong)`1678.7836680560885.34445119.670700


Multiple Linear Regression - Regression Statistics
Multiple R0.875389579068774
R-squared0.766306915142206
Adjusted R-squared0.76432646527053
F-TEST (value)386.935779643651
F-TEST (DF numerator)1
F-TEST (DF denominator)118
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation400.225137425860
Sum Squared Residuals18901258.9540508


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1423.4611.49655172413-188.096551724130
2404.1611.496551724125-207.396551724125
3500611.496551724139-111.496551724139
4472.6611.496551724139-138.896551724139
5496.1611.496551724139-115.396551724139
6562611.496551724139-49.4965517241387
7434.8611.496551724139-176.696551724139
8538.2611.496551724139-73.2965517241387
9577.6611.496551724139-33.8965517241386
10518.1611.496551724139-93.3965517241386
11625.2611.49655172413913.7034482758613
12561.2611.496551724139-50.2965517241387
13523.3611.496551724139-88.1965517241387
14536.1611.496551724139-75.3965517241386
15607.3611.496551724139-4.19655172413875
16637.3611.49655172413925.8034482758613
17606.9611.496551724139-4.59655172413884
18652.9611.49655172413941.4034482758612
19617.2611.4965517241395.70344827586134
20670.4611.49655172413958.9034482758612
21729.9611.496551724139118.403448275861
22677.2611.49655172413965.7034482758613
23710611.49655172413998.5034482758613
24844.3611.496551724139232.803448275861
25748.2611.496551724139136.703448275861
26653.9611.49655172413942.4034482758612
27742.6611.496551724139131.103448275861
28854.2611.496551724139242.703448275861
29808.4611.496551724139196.903448275861
3018192290.28021978022-471.28021978022
311936.52290.28021978022-353.78021978022
321966.12290.28021978022-324.18021978022
332083.12290.28021978022-207.18021978022
341620.12290.28021978022-670.18021978022
351527.62290.28021978022-762.68021978022
3617952290.28021978022-495.28021978022
371685.12290.28021978022-605.18021978022
381851.82290.28021978022-438.48021978022
392164.42290.28021978022-125.880219780220
401981.82290.28021978022-308.48021978022
411726.52290.28021978022-563.78021978022
422144.62290.28021978022-145.68021978022
431758.22290.28021978022-532.08021978022
441672.92290.28021978022-617.38021978022
451837.32290.28021978022-452.98021978022
461596.12290.28021978022-694.18021978022
4714462290.28021978022-844.28021978022
481898.42290.28021978022-391.88021978022
491964.12290.28021978022-326.18021978022
501755.92290.28021978022-534.38021978022
512255.32290.28021978022-34.9802197802196
521881.22290.28021978022-409.08021978022
532117.92290.28021978022-172.380219780220
541656.52290.28021978022-633.78021978022
551544.12290.28021978022-746.18021978022
562098.92290.28021978022-191.380219780220
572133.32290.28021978022-156.980219780220
581963.52290.28021978022-326.78021978022
591801.22290.28021978022-489.08021978022
602365.42290.2802197802275.1197802197803
611936.52290.28021978022-353.78021978022
621667.62290.28021978022-622.68021978022
631983.52290.28021978022-306.78021978022
642058.62290.28021978022-231.680219780220
652448.32290.28021978022158.019780219780
661858.12290.28021978022-432.18021978022
671625.42290.28021978022-664.88021978022
682130.62290.28021978022-159.68021978022
692515.72290.28021978022225.41978021978
702230.22290.28021978022-60.08021978022
712086.92290.28021978022-203.380219780220
7222352290.28021978022-55.2802197802198
732100.22290.28021978022-190.08021978022
742288.62290.28021978022-1.68021978021987
7524902290.28021978022199.719780219780
762573.72290.28021978022283.41978021978
772543.82290.28021978022253.519780219780
782004.72290.28021978022-285.58021978022
7923902290.2802197802299.7197802197802
802338.42290.2802197802248.1197802197803
812724.52290.28021978022434.21978021978
822292.52290.280219780222.21978021978022
8323862290.2802197802295.7197802197802
842477.92290.28021978022187.619780219780
8523372290.2802197802246.7197802197802
862605.12290.28021978022314.81978021978
872560.82290.28021978022270.519780219780
882839.32290.28021978022549.01978021978
892407.22290.28021978022116.91978021978
902085.22290.28021978022-205.08021978022
912735.62290.28021978022445.31978021978
922798.72290.28021978022508.41978021978
933053.22290.28021978022762.91978021978
9424052290.28021978022114.719780219780
952471.92290.28021978022181.619780219780
962727.32290.28021978022437.019780219780
972790.72290.28021978022500.41978021978
982385.42290.2802197802295.1197802197803
993206.62290.28021978022916.31978021978
1002705.62290.28021978022415.31978021978
1013518.42290.280219780221228.11978021978
1021954.92290.28021978022-335.38021978022
1032584.32290.28021978022294.019780219780
1042535.82290.28021978022245.519780219780
1052685.92290.28021978022395.61978021978
10628662290.28021978022575.71978021978
1072236.62290.28021978022-53.6802197802199
1082934.92290.28021978022644.61978021978
1092668.62290.28021978022378.31978021978
1102371.22290.2802197802280.91978021978
1113165.92290.28021978022875.61978021978
1122887.22290.28021978022596.91978021978
1133112.22290.28021978022821.91978021978
1142671.22290.28021978022380.91978021978
1152432.62290.28021978022142.31978021978
1162812.32290.28021978022522.01978021978
1173095.72290.28021978022805.41978021978
1182862.92290.28021978022572.61978021978
1192607.32290.28021978022317.019780219780
1202862.52290.28021978022572.21978021978


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
50.002548261413559590.005096522827119170.99745173858644
60.001170037554557600.002340075109115190.998829962445442
70.0001919847073559030.0003839694147118060.999808015292644
84.43102757986334e-058.86205515972669e-050.999955689724201
91.81393787903007e-053.62787575806015e-050.99998186062121
102.86045794958925e-065.7209158991785e-060.99999713954205
112.41033635681395e-064.82067271362791e-060.999997589663643
125.15477922922994e-071.03095584584599e-060.999999484522077
138.25362591969503e-081.65072518393901e-070.999999917463741
141.33269862214333e-082.66539724428666e-080.999999986673014
155.08933655645804e-091.01786731129161e-080.999999994910663
162.99680916336652e-095.99361832673305e-090.99999999700319
178.66036988838159e-101.73207397767632e-090.999999999133963
184.97350627497977e-109.94701254995955e-100.99999999950265
191.40443467144352e-102.80886934288703e-100.999999999859557
208.51649437203201e-111.7032988744064e-100.999999999914835
211.36539899088159e-102.73079798176317e-100.99999999986346
226.22650892332271e-111.24530178466454e-100.999999999937735
234.14555257905999e-118.29110515811997e-110.999999999958544
242.81945665671629e-105.63891331343259e-100.999999999718054
251.94360954801925e-103.88721909603849e-100.999999999805639
265.52135355003007e-111.10427071000601e-100.999999999944786
273.14115776991543e-116.28231553983085e-110.999999999968588
287.40320360954235e-111.48064072190847e-100.999999999925968
296.6856088014826e-111.33712176029652e-100.999999999933144
302.03877853935221e-114.07755707870441e-110.999999999979612
317.1711477352395e-121.4342295470479e-110.999999999992829
322.34951305099513e-124.69902610199026e-120.99999999999765
331.30505372079942e-122.61010744159884e-120.999999999998695
346.55932475923159e-121.31186495184632e-110.99999999999344
354.41142577377296e-118.82285154754591e-110.999999999955886
361.72749089357268e-113.45498178714535e-110.999999999982725
371.11109498785635e-112.2221899757127e-110.99999999998889
384.37975277542928e-128.75950555085856e-120.99999999999562
391.71669627295394e-113.43339254590788e-110.999999999982833
408.79305063279658e-121.75861012655932e-110.999999999991207
415.811583410086e-121.1623166820172e-110.999999999994188
421.00183665636844e-112.00367331273687e-110.999999999989982
436.14506777519582e-121.22901355503916e-110.999999999993855
446.78591656727517e-121.35718331345503e-110.999999999993214
453.22913109145724e-126.45826218291447e-120.99999999999677
467.57870615735575e-121.51574123147115e-110.999999999992421
471.05757148566129e-102.11514297132258e-100.999999999894243
486.37349331129436e-111.27469866225887e-100.999999999936265
494.44673263750856e-118.89346527501712e-110.999999999955533
503.55805164529656e-117.11610329059312e-110.99999999996442
512.13370848512149e-104.26741697024299e-100.99999999978663
521.40681583093066e-102.81363166186132e-100.999999999859318
531.80296170204467e-103.60592340408933e-100.999999999819704
543.60250612081756e-107.20501224163511e-100.99999999963975
552.22015316533750e-094.44030633067500e-090.999999997779847
562.80608857413867e-095.61217714827734e-090.999999997193911
573.9030884825351e-097.8061769650702e-090.999999996096911
583.39140470543664e-096.78280941087329e-090.999999996608595
594.36296816466258e-098.72593632932515e-090.999999995637032
602.81015803495758e-085.62031606991517e-080.99999997189842
612.79264896429318e-085.58529792858637e-080.99999997207351
621.07217018907921e-072.14434037815843e-070.99999989278298
631.23073173294119e-072.46146346588238e-070.999999876926827
641.48775709142014e-072.97551418284028e-070.99999985122429
651.02769631019277e-062.05539262038553e-060.99999897230369
661.85853281889022e-063.71706563778044e-060.999998141467181
671.81257733269860e-053.62515466539721e-050.999981874226673
682.65303370922856e-055.30606741845711e-050.999973469662908
690.0001324586276438490.0002649172552876970.999867541372356
700.0001853626194733750.0003707252389467490.999814637380527
710.000262878904953510.000525757809907020.999737121095047
720.0003692246791050160.0007384493582100320.999630775320895
730.0005545441233036520.001109088246607300.999445455876696
740.000811252021847390.001622504043694780.999188747978153
750.001650053751287460.003300107502574930.998349946248713
760.003617985922082010.007235971844164020.996382014077918
770.006040315114405890.01208063022881180.993959684885594
780.01115743551329960.02231487102659910.9888425644867
790.01355497481906010.02710994963812020.98644502518094
800.01601682861541350.03203365723082690.983983171384587
810.03055845925901510.06111691851803010.969441540740985
820.03483023840063250.0696604768012650.965169761599368
830.03832702209980130.07665404419960270.961672977900199
840.04215503101646650.0843100620329330.957844968983533
850.04699969480696990.09399938961393970.95300030519303
860.05412752136002170.1082550427200430.945872478639978
870.0579306424061670.1158612848123340.942069357593833
880.085449052532270.170898105064540.91455094746773
890.08626066949123080.1725213389824620.91373933050877
900.1424508642283810.2849017284567620.857549135771619
910.1550190180770300.3100380361540600.84498098192297
920.1728662919125610.3457325838251230.827133708087439
930.2653121277169950.530624255433990.734687872283005
940.2624611351652790.5249222703305570.737538864834721
950.2517361178292640.5034722356585280.748263882170736
960.2392154646135130.4784309292270260.760784535386487
970.2313130422990060.4626260845980110.768686957700994
980.2327483226742520.4654966453485030.767251677325748
990.3656072729109260.7312145458218530.634392727089074
1000.3280170077812140.6560340155624280.671982992218786
1010.7244817725594280.5510364548811440.275518227440572
1020.9187833840884520.1624332318230950.0812166159115476
1030.8972724822472840.2054550355054320.102727517752716
1040.8788601847622080.2422796304755850.121139815237793
1050.8408636230167670.3182727539664670.159136376983233
1060.8030386089937080.3939227820125840.196961391006292
1070.8983810365693880.2032379268612240.101618963430612
1080.8698448371102120.2603103257795760.130155162889788
1090.8225338603651750.3549322792696490.177466139634825
1100.887350758472690.2252984830546190.112649241527309
1110.9108944395938090.1782111208123820.0891055604061909
1120.8561521993881670.2876956012236650.143847800611833
1130.8745473904349970.2509052191300050.125452609565003
1140.7840466967766520.4319066064466950.215953303223348
1150.849776979329240.3004460413415180.150223020670759


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level720.648648648648649NOK
5% type I error level760.684684684684685NOK
10% type I error level810.72972972972973NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/1041d71258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/1041d71258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/1yra21258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/1yra21258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/2fg881258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/2fg881258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/3uchu1258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/3uchu1258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/48pat1258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/48pat1258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/5uo941258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/5uo941258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/623gw1258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/623gw1258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/7kpki1258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/7kpki1258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/8qksk1258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/8qksk1258766393.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/9r8dv1258766393.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/21/t1258766771r9w0yoc73jkviy4/9r8dv1258766393.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Do not include Seasonal 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

Creative Commons License

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