Home » date » 2010 » Dec » 03 »

workshop 7

*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 13:26:39 +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/t1291383045g9b194f6q7jal4j.htm/, Retrieved Fri, 03 Dec 2010 14:30:56 +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/t1291383045g9b194f6q7jal4j.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 «
4 4 1 4 2 4 2 1 4 2 4 3 2 5 2 4 2 1 3 2 4 2 2 4 2 5 2 1 3 2 4 1 3 4 3 3 1 1 3 3 4 1 1 2 4 4 2 1 4 2 4 2 2 2 3 4 2 4 2 4 4 2 2 2 2 2 2 1 1 3 3 1 1 4 2 4 3 3 4 1 3 2 2 2 2 2 2 2 2 2 4 2 3 3 2 3 2 3 3 2 3 3 1 3 4 4 4 2 4 4 3 2 2 3 3 3 2 2 2 4 4 2 2 2 3 4 1 3 4 2 4 2 2 4 3 4 2 2 3 2 4 2 2 4 2 4 2 2 2 2 5 4 2 4 3 4 2 3 4 4 4 4 2 5 4 4 3 2 5 2 3 1 2 4 2 4 4 2 4 4 3 3 2 4 2 4 2 1 2 3 4 4 2 4 4 3 2 1 4 4 5 3 2 4 5 4 3 2 3 3 3 2 2 2 2 3 1 2 3 2 3 2 2 4 2 4 1 3 3 3 4 2 2 2 3 4 4 2 4 4 4 2 2 4 2 4 2 4 3 4 4 2 1 4 4 4 2 2 3 2 5 2 2 4 2 3 1 1 2 1 3 2 5 4 2 5 3 2 4 3 5 2 2 4 2 4 2 2 4 2 4 1 1 3 2 3 1 2 1 4 4 2 2 3 3 4 2 2 3 2 5 1 2 4 2 4 2 2 2 4 4 1 1 3 2 5 4 1 5 2 4 4 2 4 3 3 1 2 4 2 4 1 1 3 2 4 3 2 4 2 4 4 2 2 2 4 2 1 3 2 4 4 3 4 2 4 4 3 3 4 4 3 3 4 2 3 4 2 4 2 4 2 2 3 4 3 2 2 3 3 5 2 1 2 2 4 2 4 4 2 5 2 3 3 3 5 2 2 2 1 4 2 2 2 4 4 1 2 3 2 4 3 1 2 4 4 3 2 2 3 4 2 3 4 3 5 4 1 4 4 4 4 2 4 4 3 2 2 2 2 4 2 2 2 4 3 1 1 4 1 4 1 1 2 3 4 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'George Udny Yule' @ 72.249.76.132
R Framework
error message
The field 'Names of X columns' contains a hard return which cannot be interpreted.
Please, resubmit your request without hard returns in the 'Names of X columns'.


Multiple Linear Regression - Estimated Regression Equation
neat[t] = + 3.21891279228362 + 0.0516504616509237fail[t] -0.0871109318539845performance[t] + 0.119903178282154goals[t] + 0.0433235060326741`right `[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)3.218912792283620.30995110.385200
fail0.05165046165092370.0743540.69470.4883260.244163
performance-0.08711093185398450.074886-1.16330.2465390.123269
goals0.1199031782821540.0691721.73340.0850360.042518
`right `0.04332350603267410.072480.59770.5509030.275451


Multiple Linear Regression - Regression Statistics
Multiple R0.185351963661483
R-squared0.0343553504331678
Adjusted R-squared0.0091097386797866
F-TEST (value)1.36084444175002
F-TEST (DF numerator)4
F-TEST (DF denominator)153
p-value0.250158771852256
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.792631195123482
Sum Squared Residuals96.1244243568806


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
143.904663432227360.0953365677726389
243.801362508925460.198637491074545
343.885805217004550.114194782995451
443.68145933064330.318540669356698
543.714251577071470.285748422928529
653.68145933064331.3185406693567
743.618813689599240.381186310400763
833.67313237502505-0.673132375025052
943.596552702775570.403447297224429
1043.801362508925460.198637491074544
1143.517768726539840.482231273460164
1243.386870368864540.613129631135458
1343.474445220507160.525554779492838
1423.48497648011167-1.48497648011167
1533.74971204727453-0.749712047274532
1643.635467600835740.364532399164264
1733.47444522050716-0.474445220507162
1823.47444522050716-1.47444522050716
1943.507237466935330.492762533064668
2033.50723746693533-0.507237466935332
2133.81975680435957-0.819756804359573
2243.904199512438670.095800487561333
2333.63767190482199-0.637671904821991
2433.56109223257251-0.561092232572511
2543.517768726539840.482231273460164
2643.575490183566560.424509816433437
2743.757575083104150.242424916895855
2843.594348398789320.405651601210683
2943.714251577071470.285748422928529
3043.474445220507160.525554779492838
3153.860876006405991.13912399359401
3243.713787657282840.286212342717165
3344.02410269072082-0.0241026907208213
3443.885805217004550.114194782995451
3533.66260111542055-0.662601115420547
3643.904199512438670.095800487561333
3733.76590203872239-0.765902038722395
3843.604879658393820.395120341606179
3943.904199512438670.095800487561333
4033.8880095209908-0.888009520990804
4153.895872556820421.10412744317958
4243.689322366472910.310677633527085
4333.47444522050716-0.474445220507162
4433.54269793713839-0.542697937138393
4533.71425157707147-0.714251577071471
4643.498910511317080.501089488682917
4743.517768726539840.482231273460164
4843.904199512438670.095800487561333
4943.714251577071470.285748422928529
5043.50677354714670.493226452853304
5143.88800952099080.111990479009196
5243.594348398789320.405651601210683
5353.714251577071471.28574842292853
5433.46658218467755-0.466582184677549
5533.45291878150952-0.452918781509518
5653.809225544755071.19077445524493
5753.714251577071471.28574842292853
5843.714251577071470.285748422928529
5943.629808868992380.370191131007622
6033.38953859263943-0.389538592639433
6143.637671904821990.362328095178009
6243.594348398789320.405651601210683
6353.662601115420551.33739888457945
6443.561092232572510.438907767427489
6543.629808868992380.370191131007622
6654.024566610509460.975433389490542
6743.860876006405990.139123993594007
6833.66260111542055-0.662601115420547
6943.629808868992380.370191131007622
7043.765902038722400.234097961277605
7143.577746143809010.42225385619099
7243.68145933064330.318540669356699
7343.730441568519330.269558431480666
7443.697185402302530.302814597697472
7543.678791106868410.321208893131589
7633.81755250037332-0.817552500373319
7743.680995410854670.319004589145335
7833.63767190482199-0.637671904821991
7953.561556152361151.43844384763885
8043.54002971336350.459970286636498
8153.550560972968011.44943902703199
8253.431121714474491.56887828552551
8343.561092232572510.438907767427489
8443.542697937138390.457302062861607
8543.699853626077420.300146373922581
8643.569419188190760.43058081180924
8743.670464151250160.329535848749839
8853.991310444292651.00868955570735
8943.904199512438670.095800487561333
9033.47444522050716-0.474445220507162
9143.561092232572510.438907767427489
9233.70638854124186-0.706388541241858
9343.55322919674290.446770803257103
9443.542697937138390.457302062861607
9543.594348398789320.405651601210683
9643.659932891645660.340067108354343
9743.732645872505590.267354127494411
9833.68665414269802-0.686654142698024
9933.6814593306433-0.681459330643301
10033.38733428865318-0.387334288653178
10133.86087600640599-0.860876006405993
10233.59434839878932-0.594348398789317
10323.47177699673227-1.47177699673227
10433.50723746693533-0.507237466935332
10553.800898589136821.19910141086318
10623.63160090944619-1.63160090944619
10723.6814593306433-1.6814593306433
10833.52609568215809-0.526095682158086
10933.59388447900068-0.59388447900068
110NANA0.438443847638853
11143.621069649841680.378930350158316
11244.76590203872239-0.765902038722395
11334.7825042937027-1.78250429370270
11422.91293873158936-0.91293873158936
11532.542697937138390.457302062861607
11645.62714064521749-1.62714064521749
11721.714251577071470.285748422928529
11843.689322366472910.310677633527085
11945.59655270277557-1.59655270277557
12022.93965998264173-0.939659982641728
12133.46611826488891-0.466118264888913
12233.63767190482199-0.637671904821991
12332.509905690710220.490094309289777
12443.604415738605180.395584261394815
12543.387334288653180.612665711346822
12644.85301297057638-0.85301297057638
12732.757575083104150.242424916895855
12843.714251577071470.285748422928529
12943.860876006405990.139123993594007
13045.55102489275664-1.55102489275664
13121.526095682158090.473904317841914
13242.888009520990801.11199047900920
13354.586485362959700.413514637040297
13443.517768726539840.482231273460164
13543.678327187079770.321672812920226
13644.54269793713839-0.542697937138393
13735.63767190482199-2.63767190482199
13810.5943483987893170.405651601210683
13944.68932236647291-0.689322366472915
14033.68932236647291-0.689322366472915
14133.76590203872239-0.765902038722395
14235.80609340119154-2.80609340119154
14310.7515040877283430.248495912271657
14442.343546862831871.65645313716813
14554.852549050787740.147450949212257
14644.60221143461893-0.60221143461893
14732.594348398789320.405651601210683
14844.34621508660676-0.346215086606758
14932.474445220507160.525554779492838
15043.801362508925460.198637491074544
15143.947523018471340.0524769815286590
15242.676122883093521.32387711690648
15356.43112171447449-1.43112171447449
15422.72211461290108-0.722114612901085
15533.59434839878932-0.594348398789317
15632.664393155874360.335606844125642
15743.714251577071470.285748422928529
15844.49017129216639-0.490171292166389
1593NANA


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.2580564424897010.5161128849794010.741943557510299
90.2288992343029280.4577984686058560.771100765697072
100.1382262084815880.2764524169631770.861773791518412
110.1092565274583840.2185130549167680.890743472541616
120.05951009467327930.1190201893465590.94048990532672
130.04309565571272210.08619131142544430.956904344287278
140.335060117433880.670120234867760.66493988256612
150.3662971985841720.7325943971683430.633702801415828
160.2997904856655050.5995809713310110.700209514334495
170.2650901408612910.5301802817225820.734909859138709
180.4283148128311270.8566296256622550.571685187168873
190.3641280203816550.728256040763310.635871979618345
200.3374180938400940.6748361876801880.662581906159906
210.3659305560059470.7318611120118950.634069443994053
220.2971360707948730.5942721415897470.702863929205127
230.2767278644408710.5534557288817430.723272135559129
240.2301363556490430.4602727112980860.769863644350957
250.2196904132236240.4393808264472480.780309586776376
260.1728124787662740.3456249575325480.827187521233726
270.1325885327087350.2651770654174700.867411467291265
280.1076012568542980.2152025137085970.892398743145702
290.08013336446427290.1602667289285460.919866635535727
300.07316169429433760.1463233885886750.926838305705662
310.08910749091457620.1782149818291520.910892509085424
320.06642738181269270.1328547636253850.933572618187307
330.05251152698811860.1050230539762370.947488473011881
340.0395170584432540.0790341168865080.960482941556746
350.040646722552370.081293445104740.95935327744763
360.02914868970156990.05829737940313980.97085131029843
370.03659146193053050.0731829238610610.96340853806947
380.03333289526068180.06666579052136360.966667104739318
390.02382560889181450.04765121778362890.976174391108185
400.02382520398150930.04765040796301850.97617479601849
410.03410303313514180.06820606627028360.965896966864858
420.0254491688897050.050898337779410.974550831110295
430.02051092141439430.04102184282878860.979489078585606
440.01679389746824950.03358779493649910.98320610253175
450.01700838219089760.03401676438179520.982991617809102
460.01343573717616480.02687147435232970.986564262823835
470.01120059726062510.02240119452125020.988799402739375
480.007934568163750240.01586913632750050.99206543183625
490.005709721777772820.01141944355554560.994290278222227
500.004055820499138250.00811164099827650.995944179500862
510.002801017283510060.005602034567020120.99719898271649
520.002115681891675930.004231363783351870.997884318108324
530.004527432270756560.009054864541513110.995472567729243
540.003256843579369090.006513687158738180.996743156420631
550.004156395682253660.008312791364507320.995843604317746
560.006334624714176050.01266924942835210.993665375285824
570.01155541950238070.02311083900476140.98844458049762
580.008517409715312140.01703481943062430.991482590284688
590.006928830607996330.01385766121599270.993071169392004
600.005152651928067130.01030530385613430.994847348071933
610.003840075436839770.007680150873679540.99615992456316
620.002902751487953740.005805502975907490.997097248512046
630.005895333259631390.01179066651926280.994104666740369
640.004718948097703920.009437896195407840.995281051902296
650.003660347547059920.007320695094119850.99633965245294
660.004203628304001190.008407256608002380.995796371696
670.003038583122137610.006077166244275220.996961416877862
680.003108601999498310.006217203998996610.996891398000502
690.002406256508146250.00481251301629250.997593743491854
700.001721128377084330.003442256754168660.998278871622916
710.001280120795655210.002560241591310420.998719879204345
720.000932115438040360.001864230876080720.99906788456196
730.0006706321990854410.001341264398170880.999329367800915
740.0004598587714995330.0009197175429990660.9995401412285
750.0003260234323200050.000652046864640010.99967397656768
760.0004406322649739300.0008812645299478590.999559367735026
770.0003027202102160210.0006054404204320410.999697279789784
780.0002848169597790810.0005696339195581620.99971518304022
790.0009632149169087350.001926429833817470.999036785083091
800.0007259224099369150.001451844819873830.999274077590063
810.001819183563200430.003638367126400870.9981808164368
820.005608453113452170.01121690622690430.994391546886548
830.004368638652298530.008737277304597050.995631361347701
840.003533795759888440.007067591519776880.996466204240112
850.002601044835982880.005202089671965760.997398955164017
860.002000537007965270.004001074015930550.997999462992035
870.001510330971427750.003020661942855500.998489669028572
880.002151377998112010.004302755996224030.997848622001888
890.001613640633152230.003227281266304460.998386359366848
900.001333959067300880.002667918134601750.998666040932699
910.001014277437733110.002028554875466220.998985722562267
920.0009186449969696950.001837289993939390.99908135500303
930.00072260120194040.00144520240388080.99927739879806
940.0005733597471772640.001146719494354530.999426640252823
950.0004442574106333490.0008885148212666990.999555742589367
960.0003528813663808890.0007057627327617770.999647118633619
970.0002527729517350010.0005055459034700010.999747227048265
980.000276215227565040.000552430455130080.999723784772435
990.0002461523353384990.0004923046706769990.999753847664661
1000.0001822129925288060.0003644259850576110.999817787007471
1010.0002059633836696290.0004119267673392580.99979403661633
1020.0001687806622999010.0003375613245998020.9998312193377
1030.0005067214655258610.001013442931051720.999493278534474
1040.0003875358456555420.0007750716913110830.999612464154344
1050.0008776985401290750.001755397080258150.999122301459871
1060.003230415472100960.006460830944201910.9967695845279
1070.009430393599023370.01886078719804670.990569606400977
1080.00809730961931580.01619461923863160.991902690380684
1090.006795115535590190.01359023107118040.99320488446441
1100.005317555559988490.01063511111997700.994682444440012
1110.003958432557941640.007916865115883290.996041567442058
1120.003578029295087220.007156058590174450.996421970704913
1130.009426702622942130.01885340524588430.990573297377058
1140.00874854902112530.01749709804225060.991251450978875
1150.007361778197217540.01472355639443510.992638221802782
1160.01589550544201110.03179101088402220.984104494557989
1170.01244825119792800.02489650239585600.987551748802072
1180.009559257610169030.01911851522033810.99044074238983
1190.02021418550104510.04042837100209020.979785814498955
1200.01964710787543860.03929421575087720.980352892124561
1210.01580797884011590.03161595768023170.984192021159884
1220.01331097430595310.02662194861190630.986689025694047
1230.01024433216266300.02048866432532600.989755667837337
1240.007537581527822540.01507516305564510.992462418472178
1250.006343916809922720.01268783361984540.993656083190077
1260.005849546287368570.01169909257473710.994150453712631
1270.004185356111655270.008370712223310540.995814643888345
1280.003015991130638610.006031982261277220.996984008869361
1290.002009572025810840.004019144051621680.99799042797419
1300.00487487135304030.00974974270608060.99512512864696
1310.003466038711452670.006932077422905340.996533961288547
1320.008125693624237280.01625138724847460.991874306375763
1330.006064498038055230.01212899607611050.993935501961945
1340.004996961634047580.009993923268095160.995003038365952
1350.004871622524430290.009743245048860570.99512837747557
1360.003119822484804720.006239644969609430.996880177515195
1370.04147337752099060.08294675504198120.95852662247901
1380.0308089508494490.0616179016988980.96919104915055
1390.02400961124162850.0480192224832570.975990388758372
1400.01865453913844610.03730907827689210.981345460861554
1410.01672949001357790.03345898002715580.983270509986422
1420.3846876011018420.7693752022036850.615312398898158
1430.3921439880881270.7842879761762540.607856011911873
1440.5953416143018440.8093167713963110.404658385698156
1450.4914649960229630.9829299920459260.508535003977037
1460.440757803190760.881515606381520.55924219680924
1470.3756121401749050.751224280349810.624387859825095
1480.3265607726366010.6531215452732020.673439227363399
1490.6305854393544070.7388291212911850.369414560645593
1500.4748358017109890.9496716034219780.525164198289011
1510.3822929029795320.7645858059590630.617707097020469


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


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/1ayzl1291382788.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/1ayzl1291382788.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/23qg61291382788.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/23qg61291382788.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/33qg61291382788.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/33qg61291382788.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/6dhxr1291382788.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/6dhxr1291382788.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/76qeu1291382788.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/76qeu1291382788.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/86qeu1291382788.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291383045g9b194f6q7jal4j/86qeu1291382788.ps (open in new window)


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