Home » date » 2010 » Dec » 03 »

Workshop 7 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, 03 Dec 2010 12:20:20 +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/03/t1291378745yqb5ixqdvvv6pxw.htm/, Retrieved Fri, 03 Dec 2010 13:19:17 +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/03/t1291378745yqb5ixqdvvv6pxw.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:
Mini-tutorial Gender
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 5 2 2 1 1 1 1 4 1 3 1 4 1 1 7 3 3 1 5 1 1 7 2 2 1 2 2 2 5 2 1 1 1 2 2 5 1 1 1 1 2 1 4 1 3 1 2 2 2 4 3 3 2 1 1 1 6 1 1 1 1 1 2 5 1 1 1 1 2 1 1 1 1 1 3 2 2 5 1 1 1 1 1 1 4 2 1 2 1 1 2 6 3 1 1 1 1 2 7 2 2 1 2 1 2 7 3 3 1 4 2 1 2 2 1 1 1 2 1 6 1 1 1 1 1 1 3 1 1 1 2 1 2 6 1 1 1 3 2 2 6 1 3 1 1 1 1 5 1 1 1 1 2 2 6 3 2 1 1 1 2 4 1 3 2 1 2 2 3 3 1 2 2 1 2 4 1 1 1 1 1 2 5 1 1 2 1 1 2 6 1 1 2 1 2 1 6 3 3 2 1 2 1 4 1 1 1 1 2 2 6 1 3 1 1 1 1 6 1 1 1 1 2 2 5 1 3 1 1 1 2 6 3 1 1 1 1 2 4 1 1 1 1 2 1 6 1 1 1 1 1 2 7 1 3 1 1 2 1 5 2 3 1 1 1 1 6 1 3 1 1 2 2 6 1 1 2 1 1 1 5 2 2 2 4 2 2 7 2 3 1 1 1 2 6 2 2 1 1 1 1 3 1 1 1 4 2 1 4 1 1 1 2 1 2 5 2 3 1 2 1 2 4 2 3 2 1 1 1 3 1 1 1 1 2 2 5 3 1 1 2 1 2 5 1 1 1 1 2 1 4 1 2 1 1 2 1 5 1 1 1 1 1 2 1 2 2 1 1 1 2 2 1 1 2 1 1 2 3 3 3 1 1 2 1 4 2 2 1 2 1 1 3 3 3 1 1 2 1 7 1 1 1 1 2 1 2 1 1 1 1 1 1 4 3 1 1 2 1 1 2 1 1 1 1 2 2 5 1 1 1 2 1 2 6 1 2 1 4 2 2 6 1 2 1 1 2 2 6 1 1 1 1 1 1 6 2 2 1 1 1 2 6 3 3 1 2 1 2 6 1 1 1 3 1 1 6 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 time10 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Member[t] = + 1.30267905579266 + 0.0638572513593550Provison[t] + 0.0593542522425081Mother[t] + 0.00438665208409937Father[t] + 0.0498968809279368Illness[t] -0.0440151152769835Tobacco[t] -0.130198915314923Gender[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.302679055792660.2754434.72945e-063e-06
Provison0.06385725135935500.0282672.25910.0253190.01266
Mother0.05935425224250810.0538091.10310.2717680.135884
Father0.004386652084099370.0496510.08830.9297170.464858
Illness0.04989688092793680.1175610.42440.6718580.335929
Tobacco-0.04401511527698350.042108-1.04530.2975690.148784
Gender-0.1301989153149230.082834-1.57180.1181050.059052


Multiple Linear Regression - Regression Statistics
Multiple R0.284268140970020
R-squared0.0808083759705509
Adjusted R-squared0.0440407110093729
F-TEST (value)2.19781093131354
F-TEST (DF numerator)6
F-TEST (DF denominator)150
p-value0.0462273521497196
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.487546698306195
Sum Squared Residuals35.6552674543908


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
121.625129971578640.374870028421361
211.37425977422996-0.374259774229960
311.64052491751606-0.64052491751606
411.57863044370548-0.578630443705482
521.490544404179660.509455595820344
621.431190151937150.568809848062853
711.33209108946901-0.332091089469008
821.674910505473870.325089494526134
911.62524631861143-0.625246318611425
1021.431190151937150.568809848062852
1111.08773091594576-0.0877309159457599
1221.561389067252070.43861093274793
1311.60678294906316-0.60678294906316
1421.743954823096440.256045176903559
1521.708829359020400.291170640979595
1621.554341117478120.445658882521878
1711.29897265010159-0.29897265010159
1811.62524631861143-0.625246318611425
1911.38965944925638-0.389659449256376
2021.407017172742540.592982827257464
2121.634019622779620.365980377220376
2211.43119015193715-0.431190151937147
2321.748341475180540.251658524819459
2421.426003085673930.573996914326072
2521.558264834669330.441735165330671
2621.497531815892710.502468184107285
2721.611285948180010.388714051819993
2821.544944284224440.455055715775560
2911.67242609287765-0.672426092877654
3011.36733290057779-0.367332900577792
3121.634019622779620.365980377220376
3211.49504740329650-0.495047403296503
3321.570162371420270.429837628579731
3421.743954823096440.256045176903559
3521.367332900577790.632667099422208
3611.62524631861143-0.625246318611425
3721.567677958824060.432322041175943
3811.62951662366278-0.629516623662777
3911.50382070746470-0.503820707464702
4021.675143199539360.324856800460638
4111.41278259136074-0.412782591360741
4221.757231126381490.242768873618513
4321.688987222938030.311012777061967
4411.17143030338749-0.171430303387487
4511.45351670061573-0.453516700615731
4621.585501508385790.414498491614207
4721.615556253231360.384443746768642
4811.30347564921844-0.303475649218437
4921.636082456460100.363917543539897
5021.431190151937150.568809848062852
5111.37171955266189-0.371719552661892
5211.56138906725207-0.56138906725207
5321.369700966141260.630299033858743
5421.419714194101940.580285805898058
5521.430957457871650.569042542128348
5611.51725760494234-0.517257604942339
5711.43095745787165-0.430957457871652
5811.55890465465586-0.558904654655858
5911.36981731317400-0.369817313174005
6011.57222520510075-0.572225205100748
6111.23961839785908-0.239618397859082
6221.517373951975090.482626048024913
6321.367388709549650.632611290450348
6421.499434055380600.500565944619398
6521.625246318611430.374753681388575
6611.68898722293803-0.688987222938033
6721.708713011987660.291286988012343
6821.537216088057460.462783911942542
6911.50382070746470-0.503820707464702
7011.56127272021932-0.561272720219322
7111.4310738049044-0.4310738049044
7221.688870875905280.311129124094715
7311.69337387502213-0.693373875022132
7411.62524631861143-0.625246318611425
7511.68199981122497-0.681999811224973
7611.69337387502213-0.693373875022132
7721.683916503707560.316083496292439
7811.58561785541854-0.585617855418541
7921.493028816775870.506971183224132
8021.629516623662780.370483376337223
8121.693373875022130.306626124977868
8221.43546045698850.564539543011501
8311.68887087590528-0.688870875905285
8421.748341475180540.251658524819459
8521.688987222938030.311012777061967
8611.31224895338664-0.312248953386636
8721.649358759745150.350641240254851
8821.561389067252070.43861093274793
8911.49504740329650-0.495047403296503
9011.36733290057779-0.367332900577792
9121.618258906898370.381741093101634
9221.625129971578680.374870028421322
9321.644972107661050.355027892338951
9411.55878830762311-0.55878830762311
9521.517313413914200.482686586085802
9611.73900045089872-0.739000450898717
9721.693373875022130.306626124977868
9811.55878830762311-0.55878830762311
9911.70871301198766-0.708713011987657
10021.625246318611430.374753681388575
10121.281787082620040.718212917379962
10211.36733290057779-0.367332900577792
10321.494814709231010.505185290768993
10421.693373875022130.306626124977868
10511.60084064535132-0.600840645351318
10611.74395482309644-0.743954823096441
10711.62963297069552-0.629632970695525
10811.28951527878702-0.289515278787019
10921.752844474297390.247155525702612
11011.18014779858383-0.180147798583826
11111.49753181589271-0.497531815892715
11211.19987358763345-0.19987358763345
11311.64497210766105-0.644972107661049
11421.556941877107080.443058122892918
11511.56132852919118-0.561328529191182
11621.752844474297390.247155525702612
11711.63401962277962-0.634019622779624
11821.497531815892710.502468184107285
11921.625013624545930.374986375454070
12011.49320097278047-0.493200972780475
12111.72999445266502-0.729994452665023
12221.689103569970780.310896430029219
12321.367332900577790.632667099422208
12411.56127272021932-0.561272720219322
12521.470758077069140.529241922930857
12621.677613159140870.322386840859126
12721.431190151937150.568809848062852
12821.618142559865620.381857440134382
12911.47663984272010-0.476639842720097
13021.620682781433690.379317218566310
13121.629516623662780.370483376337223
13221.645088454693800.354911545306203
13321.494814709231010.505185290768993
13411.64058545557695-0.64058545557695
13511.75272812726464-0.75272812726464
13621.664814243743420.335185756256579
13721.578514096672730.421485903327266
13821.708713011987660.291286988012343
13921.565775719336170.434224280663831
14011.49054440417966-0.490544404179655
14121.387175036660160.612824963339836
14221.693373875022130.306626124977868
14321.749836588747390.250163411252605
14411.70375863978993-0.703758639789933
14511.37171955266189-0.371719552661892
14621.558788307623110.44121169237689
14721.514773192346130.485226807653873
14821.689103569970780.310896430029219
14911.58123120333444-0.581231203334442
15021.693490222054880.30650977794512
15121.551815348904750.448184651095249
15221.629632970695520.370367029304475
15311.49481470923101-0.494814709231007
15411.36733290057779-0.367332900577792
15521.807812074455800.192187925544203
15611.50191846797681-0.501918467976814
15721.857708955383730.142291044616267


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.3516309155804570.7032618311609150.648369084419543
110.6670882037524050.6658235924951910.332911796247595
120.5883234142940630.8233531714118740.411676585705937
130.5731243316703360.8537513366593280.426875668329664
140.4901694029945100.9803388059890210.509830597005489
150.4759606658366790.9519213316733570.524039334163321
160.5393737227088470.9212525545823050.460626277291153
170.6498747982623850.700250403475230.350125201737615
180.666626880346390.666746239307220.33337311965361
190.591028103738950.81794379252210.40897189626105
200.664066334498840.671867331002320.33593366550116
210.6246710514906840.7506578970186330.375328948509316
220.6534015862766980.6931968274466040.346598413723302
230.5834193378189240.8331613243621520.416580662181076
240.5604620304865620.8790759390268760.439537969513438
250.5696274522116140.860745095576770.430372547788385
260.5962246638344910.8075506723310170.403775336165509
270.5539562906683990.8920874186632030.446043709331601
280.5002520783692690.9994958432614620.499747921630731
290.6710926496322640.6578147007354730.328907350367736
300.660789416684710.6784211666305810.339210583315290
310.624394278547670.7512114429046610.375605721452330
320.6423177583416670.7153644833166660.357682241658333
330.6109831204175590.7780337591648830.389016879582441
340.5614365498166510.8771269003666980.438563450183349
350.5812079577829570.8375840844340860.418792042217043
360.6273126565688120.7453746868623760.372687343431188
370.5940647355420470.8118705289159070.405935264457953
380.645694472462980.708611055074040.35430552753702
390.6597535974245770.6804928051508460.340246402575423
400.6206016275328650.758796744934270.379398372467135
410.5971025929858150.805794814028370.402897407014185
420.5527823135870320.8944353728259360.447217686412968
430.5144065977510340.9711868044979320.485593402248966
440.4647194657362880.9294389314725760.535280534263712
450.4513206403937050.902641280787410.548679359606295
460.438073377976660.876146755953320.56192662202334
470.4088882227877130.8177764455754250.591111777212287
480.38040517923150.7608103584630.6195948207685
490.3564500201938450.712900040387690.643549979806155
500.3661615063869940.7323230127739890.633838493613006
510.3501116424368670.7002232848737350.649888357563133
520.3702551334250640.7405102668501290.629744866574936
530.3896819243429690.7793638486859380.610318075657031
540.4059325107374180.8118650214748370.594067489262582
550.3994865546247220.7989731092494450.600513445375278
560.4098409673652370.8196819347304750.590159032634763
570.4231646067360360.8463292134720710.576835393263964
580.4390246372969770.8780492745939540.560975362703023
590.4208665748842760.8417331497685520.579133425115724
600.4371645125931890.8743290251863790.56283548740681
610.4009381570263480.8018763140526950.599061842973652
620.4062922958058720.8125845916117430.593707704194128
630.4541796842483240.9083593684966480.545820315751676
640.4523019076676360.9046038153352710.547698092332364
650.4295619652422080.8591239304844160.570438034757792
660.4803520032550160.9607040065100320.519647996744984
670.448337749471980.896675498943960.55166225052802
680.4424106534299940.8848213068599880.557589346570006
690.4465737694455210.8931475388910420.553426230554479
700.4598526180563180.9197052361126360.540147381943682
710.4458747256117380.8917494512234760.554125274388262
720.4182523430582830.8365046861165670.581747656941717
730.4636016095397410.9272032190794810.536398390460259
740.494308328096170.988616656192340.50569167190383
750.534502110363110.930995779273780.46549788963689
760.5772480014251210.8455039971497580.422751998574879
770.5647250905056170.8705498189887660.435274909494383
780.5844434854206420.8311130291587170.415556514579358
790.589986163402970.820027673194060.41001383659703
800.573315949099130.853368101801740.42668405090087
810.5465292487278020.9069415025443960.453470751272198
820.5649337027489980.8701325945020040.435066297251002
830.6039808365106560.7920383269786870.396019163489344
840.5705311374784240.8589377250431520.429468862521576
850.5425438627038310.9149122745923390.457456137296169
860.5113600828752960.9772798342494080.488639917124704
870.4884762049306750.976952409861350.511523795069325
880.4786707643067470.9573415286134940.521329235693253
890.4853774845395690.9707549690791370.514622515460431
900.4675751557284040.9351503114568080.532424844271596
910.4432101310886260.8864202621772520.556789868911374
920.4255285130536730.8510570261073460.574471486946327
930.4022001318395540.8044002636791090.597799868160446
940.4271015553966670.8542031107933350.572898444603333
950.4231923323617660.8463846647235330.576807667638234
960.4712057968253650.942411593650730.528794203174635
970.4432147940617690.8864295881235370.556785205938231
980.4798097990069380.9596195980138760.520190200993062
990.5259312808615630.9481374382768740.474068719138437
1000.5030572358430780.9938855283138450.496942764156922
1010.6387619223020390.7224761553959220.361238077697961
1020.6269011987558760.7461976024882470.373098801244124
1030.6210923145188020.7578153709623960.378907685481198
1040.589906696974680.820186606050640.41009330302532
1050.5921918870111840.8156162259776320.407808112988816
1060.6604806143780830.6790387712438340.339519385621917
1070.69843728699750.60312542600500.3015627130025
1080.6604080872229840.6791838255540330.339591912777016
1090.6177227546735070.7645544906529860.382277245326493
1100.5689004300152620.8621991399694750.431099569984737
1110.558404059352640.8831918812947210.441595940647361
1120.5078001016379220.9843997967241570.492199898362078
1130.554182282711550.8916354345769010.445817717288451
1140.5591168946001780.8817662107996440.440883105399822
1150.5587708033690880.8824583932618230.441229196630912
1160.50924380332140.98151239335720.4907561966786
1170.5816981508822820.8366036982354360.418301849117718
1180.6104623644026590.7790752711946820.389537635597341
1190.6126922814110210.7746154371779590.387307718588979
1200.6040536961232340.7918926077535320.395946303876766
1210.6072671940591670.7854656118816650.392732805940833
1220.5563211106313150.8873577787373710.443678889368685
1230.5918893945457560.8162212109084870.408110605454244
1240.5828060454959140.8343879090081720.417193954504086
1250.5640274575525350.871945084894930.435972542447465
1260.5087858356105430.9824283287789140.491214164389457
1270.5160536201526340.9678927596947330.483946379847366
1280.4663543812974760.9327087625949520.533645618702524
1290.4743388757476110.9486777514952220.525661124252389
1300.4252937666672730.8505875333345460.574706233332727
1310.403640030449980.807280060899960.59635996955002
1320.3547288415144210.7094576830288430.645271158485579
1330.3725327431932740.7450654863865480.627467256806726
1340.436018925922370.872037851844740.56398107407763
1350.5601921295896060.8796157408207870.439807870410394
1360.4857064024856180.9714128049712350.514293597514382
1370.4344561305199830.8689122610399660.565543869480017
1380.3747053658011950.749410731602390.625294634198805
1390.3663048331892770.7326096663785530.633695166810723
1400.4131243933952390.8262487867904790.586875606604761
1410.5106371522571310.9787256954857380.489362847742869
1420.4545025555675420.9090051111350850.545497444432458
1430.4182844638785690.8365689277571380.581715536121431
1440.806041608145670.387916783708660.19395839185433
1450.7473596354019710.5052807291960570.252640364598029
1460.6126911508317590.7746176983364830.387308849168241
1470.7539803762304380.4920392475391230.246019623769562


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level00OK
10% type I error level00OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/10qujv1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/10qujv1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/11tmj1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/11tmj1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/21tmj1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/21tmj1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/31tmj1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/31tmj1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/4u2lm1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/4u2lm1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/5u2lm1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/5u2lm1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/64b2p1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/64b2p1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/7fkjs1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/7fkjs1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/8fkjs1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/8fkjs1291378809.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/9fkjs1291378809.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291378745yqb5ixqdvvv6pxw/9fkjs1291378809.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