Home » date » 2010 » Nov » 19 »

Multiple linear regression 2

*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, 19 Nov 2010 18:08:07 +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/Nov/19/t1290189983r3hp3qf3s7314tf.htm/, Retrieved Fri, 19 Nov 2010 19:06:26 +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/Nov/19/t1290189983r3hp3qf3s7314tf.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 «
15 10 77 5 4 15 11 12 13 6 12 20 63 6 4 9 12 7 11 4 15 16 73 4 10 12 12 13 14 6 12 10 76 6 6 15 11 11 12 5 14 8 90 3 5 17 11 16 12 5 8 14 67 10 8 14 10 10 6 4 11 19 69 8 9 9 11 15 10 5 15 15 70 3 6 12 9 5 11 3 4 23 54 4 8 11 10 4 10 2 13 9 54 3 11 13 12 7 12 5 19 12 76 5 6 16 12 15 15 6 10 14 75 5 8 16 12 5 13 6 15 13 76 6 11 15 13 16 18 8 6 11 80 5 5 10 9 15 11 6 7 11 89 3 10 16 12 13 12 3 14 10 73 4 7 12 12 13 13 6 16 12 74 8 7 15 12 15 14 6 16 18 78 8 13 13 12 15 16 7 14 12 76 8 10 18 13 10 16 8 15 10 69 5 8 13 11 17 16 6 14 15 74 8 6 17 12 14 15 7 12 15 82 2 8 14 12 9 13 4 9 12 77 0 7 13 15 6 8 4 12 9 84 5 5 13 11 11 14 2 14 11 75 2 9 15 12 13 15 6 12 15 54 7 9 13 10 12 13 6 14 16 79 5 11 15 11 10 16 6 10 17 79 2 11 13 13 4 13 6 14 12 69 12 11 14 6 13 12 6 16 11 88 7 9 13 12 15 15 7 10 13 57 0 7 16 12 8 11 4 8 9 69 2 6 14 10 10 14 3 12 11 86 3 6 18 12 8 13 5 11 9 65 0 6 15 12 7 13 6 8 20 66 9 5 9 11 9 12 4 13 8 54 2 4 16 9 14 14 6 11 12 85 3 10 16 10 5 13 3 12 10 79 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 time9 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
Popularity[t] = -1.16892826150712 -0.080730628713802Depression[t] + 0.045325378873952Belonging[t] + 0.0964153521063372Weighted_popularity[t] + 0.077276519014147Parental_criticism[t] -0.0572765637003982Happiness[t] + 0.117596535487944FindingFriends[t] + 0.227711407897117KnowingPeople[t] + 0.34708334464486Liked[t] + 0.520075961070442Celebrity[t] -0.00640747869671335t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-1.168928261507122.523234-0.46330.6438680.321934
Depression-0.0807306287138020.063126-1.27890.2029840.101492
Belonging0.0453253788739520.0169622.67220.0083990.0042
Weighted_popularity0.09641535210633720.058111.65920.099240.04962
Parental_criticism0.0772765190141470.0646611.19510.2339990.117
Happiness-0.05727656370039820.085478-0.67010.5038760.251938
FindingFriends0.1175965354879440.0936611.25550.2112990.10565
KnowingPeople0.2277114078971170.0642943.54170.0005350.000268
Liked0.347083344644860.0938253.69930.0003060.000153
Celebrity0.5200759610704420.1584053.28320.0012860.000643
t-0.006407478696713350.003735-1.71560.0883660.044183


Multiple Linear Regression - Regression Statistics
Multiple R0.746865837404828
R-squared0.557808579082415
Adjusted R-squared0.527312619019133
F-TEST (value)18.2912286717622
F-TEST (DF numerator)10
F-TEST (DF denominator)145
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.01899776486645
Sum Squared Residuals591.071036307677


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11513.09808455897341.90191544102664
2129.334611107783792.66538889221621
31513.6510490549111.34895094508901
41212.1896344205315-0.189634420531492
51413.63672484024930.363275159750659
689.09557557624667-1.09557557624667
71112.1115572596557-1.11155725965572
8158.382285938569766.61771406143024
946.33579814388996-2.33579814388996
101310.65320241189012.34679758810993
111914.41939705850164.58060294149841
121011.3894752132707-1.38947521327073
131517.2926358827324-2.29263588273236
14613.187466644766-7.18746664476603
15712.1231023366937-5.12310233669369
161413.47322270244920.526777297550778
171614.36701722296211.6329827770379
181615.84998237932420.150017620675771
191415.2182109966908-1.21821099669079
201515.2172057096217-0.21720570962175
211414.5468136734371-0.546813673437087
221211.25794823023680.742051769763176
2398.988513743333510.0114862566664852
241211.57961856866130.420381431338651
251413.9095348552170.0904651447829507
261212.0679306250819-0.0679306250818915
271413.66451994956330.335480050436709
281011.2303635028932-1.23036350289317
291412.96037591440251.0396240855975
301616.038856051892-0.0388560518920173
31108.922069259730751.07793074026925
32810.7539999726585-2.75399997265848
331211.69681060737380.30318939262623
341111.0749796177072-0.0749796177071755
35810.3105726476984-2.31057264769841
361312.21359081735890.786409182641092
371110.01030467164840.989695328351577
38129.83227841331952.1677215866805
391615.21785582958420.782144170415826
401613.01537483981442.98462516018557
411313.9167692548379-0.916769254837922
421415.3107122591626-1.31071225916263
4355.59431254652437-0.594312546524372
441413.27958921076240.720410789237553
45138.958374404649554.04162559535045
461615.43600075314750.563999246852537
471414.6266103305611-0.626610330561147
481514.15374757047180.846252429528169
491513.33519556290631.66480443709368
501112.2372811627391-1.23728116273909
511513.68470209339671.31529790660325
521612.66602471464453.33397528535547
531313.3258405899626-0.325840589962623
541113.7029888671069-2.70298886710691
551213.9250133183881-1.92501331838815
561211.6098233369160.390176663083983
571013.451342229255-3.45134222925503
5889.04261103534925-1.04261103534925
5999.69310574143097-0.69310574143097
601212.045387994039-0.0453879940389715
611413.9106370572280.0893629427720449
621213.0083713397218-1.00837133972183
631110.97692213531350.0230778646865252
641413.49872552489020.501274475109798
65711.6308647176515-4.63086471765147
661613.99938574768012.00061425231988
671615.49005574093020.509944259069826
681112.2982409395182-1.29824093951819
691615.2870284919230.712971508076962
701314.4142657678109-1.4142657678109
711110.91153041303670.0884695869632988
721312.79854600577340.201453994226599
731414.2807110397621-0.28071103976212
741513.48445667863431.51554332136573
75109.292770560647790.707229439352216
761514.64656239869280.353437601307165
771112.9527797832399-1.95277978323991
781111.4043554773293-0.40435547732932
7968.4575735341726-2.45757353417261
80119.645374917711391.35462508228861
811211.63428523430250.365714765697493
821313.2443154760362-0.244315476036222
831212.6581126741542-0.658112674154231
84810.8160962310738-2.81609623107383
85910.7024135722567-1.70241357225673
861011.6212793989087-1.62127939890874
871613.24291455350252.75708544649748
881512.78266009976772.21733990023233
891413.52538035299060.474619647009403
901213.5699261701497-1.56992617014973
911210.23459942399181.76540057600822
92108.709363374215061.29063662578494
931211.44546726086040.554532739139586
9489.29247098996122-1.29247098996122
951614.03574408224371.96425591775626
96117.722977922127063.27702207787294
971211.44215238202690.557847617973136
98910.3074555378289-1.30745553782888
991411.44728733081412.5527126691859
1001514.31445495535950.685545044640457
101810.5692779610823-2.56927796108232
1021212.373175300765-0.373175300764953
1031010.4270650991506-0.42706509915059
1041614.78831280611371.21168719388628
1051714.20547645726082.79452354273925
106810.0343820261573-2.0343820261573
107910.7078936298132-1.70789362981318
108811.3302451431894-3.33024514318938
1091112.3481588429061-1.34815884290607
1101615.30804175209420.69195824790584
1111313.4300882747453-0.430088274745342
11257.9242294471067-2.92422944710671
1131512.7639954519712.23600454802897
1141513.86478852759561.13521147240442
1151211.40044047143280.599559528567214
1161211.45075099457120.549249005428758
1171615.73069356494480.269306435055161
1181212.4165342860829-0.416534286082865
1191011.7091963037699-1.70919630376992
1201210.66466371609731.33533628390266
12146.22150795113951-2.22150795113951
1221112.9228174382834-1.92281743828336
1231614.65573905637991.34426094362011
12478.76472456379762-1.76472456379762
125910.71615589177-1.71615589177001
1261410.79092939477733.2090706052227
127119.678507834945081.32149216505492
1281010.8792289215278-0.879228921527816
12968.48388602635172-2.48388602635172
1301412.8020205374761.19797946252395
1311110.86688871477920.133111285220822
132119.152723110309561.84727688969044
133913.8708137524157-4.8708137524157
1341611.35724879235754.64275120764247
13577.81813032982012-0.818130329820122
13688.78068323292848-0.78068323292848
137109.867390059925120.132609940074876
1381411.94695515947032.05304484052966
13999.60739523239862-0.60739523239862
1401312.29845509555510.701544904444911
141139.522030607301483.47796939269852
1421211.77003110047150.229968899528461
1431112.56425405171-1.56425405170999
1441014.9395072859872-4.93950728598721
1451211.92877477547560.0712252245243581
1461413.28388009096990.71611990903015
1471113.3075729058824-2.30757290588238
1481310.98743024333922.01256975666079
1491413.52239996856670.477600031433272
1501312.55573089653280.444269103467223
1511615.96681135750490.0331886424950527
1521312.07869782090330.921302179096672
1531211.2563232429470.743676757053049
15499.15504321665876-0.155043216658764
1551411.20378933925442.7962106607456
1561514.57561242141920.424387578580833


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
140.9997492612568940.0005014774862120840.000250738743106042
150.999897136847380.0002057263052405180.000102863152620259
160.9998951477071390.0002097045857227920.000104852292861396
170.9998315700222490.0003368599555028120.000168429977751406
180.9998796455022720.0002407089954564890.000120354497728245
190.9997378545297440.0005242909405124810.00026214547025624
200.9995654370285150.000869125942969170.000434562971484585
210.999137460356580.001725079286839470.000862539643419735
220.999452924095780.00109415180844060.0005470759042203
230.999208320382810.001583359234381850.000791679617190925
240.99858301621370.002833967572597930.00141698378629897
250.9976450218883550.004709956223289410.0023549781116447
260.9960943352579950.007811329484010880.00390566474200544
270.995320812576780.009358374846439370.00467918742321969
280.9926112195267690.01477756094646260.00738878047323132
290.9954354374067310.00912912518653740.0045645625932687
300.9942476637566470.01150467248670660.0057523362433533
310.9914964421529550.01700711569409040.00850355784704518
320.9954311589920260.009137682015948530.00456884100797426
330.9932089017751560.01358219644968730.00679109822484363
340.989941891798940.02011621640212190.0100581082010609
350.9885356329761390.02292873404772260.0114643670238613
360.9839023346807050.03219533063858930.0160976653192947
370.9805971214720980.03880575705580360.0194028785279018
380.9824818204152470.03503635916950610.017518179584753
390.9812120621090440.03757587578191130.0187879378909557
400.9867396987244780.02652060255104320.0132603012755216
410.9823696646598140.03526067068037190.017630335340186
420.976205184821190.04758963035761990.02379481517881
430.9678150684793230.06436986304135360.0321849315206768
440.9602667505273680.0794664989452640.039733249472632
450.989203529823550.02159294035290010.01079647017645
460.9854827407696040.0290345184607930.0145172592303965
470.9805813563355840.03883728732883160.0194186436644158
480.9751229755244260.04975404895114770.0248770244755738
490.9720529445409580.05589411091808390.027947055459042
500.9675090998195370.06498180036092510.0324909001804626
510.9635855328752970.0728289342494060.036414467124703
520.9775419898325130.04491602033497370.0224580101674868
530.9702407884678580.05951842306428330.0297592115321417
540.9712801644903890.05743967101922290.0287198355096115
550.967915695553620.0641686088927590.0320843044463795
560.9593089862514420.08138202749711650.0406910137485583
570.9718415897918080.05631682041638310.0281584102081915
580.9645182704996930.0709634590006140.035481729500307
590.9540984762727360.09180304745452770.0459015237272639
600.9415396066020830.1169207867958340.058460393397917
610.9272512266280620.1454975467438760.072748773371938
620.9124334765069090.1751330469861830.0875665234930914
630.89189379674090.2162124065181990.108106203259099
640.8761863779879960.2476272440240080.123813622012004
650.93509498119810.12981003760380.0649050188019002
660.9414434120754380.1171131758491230.0585565879245615
670.928401953629120.143196092741760.0715980463708799
680.9163987282966980.1672025434066040.083601271703302
690.9000105078924770.1999789842150450.0999894921075225
700.8873821522202740.2252356955594520.112617847779726
710.8649266577201260.2701466845597480.135073342279874
720.839251605670030.3214967886599390.160748394329969
730.823824626039970.352350747920060.17617537396003
740.8172288642915430.3655422714169150.182771135708457
750.7936048529359530.4127902941280930.206395147064047
760.760977110085850.4780457798283010.239022889914151
770.751013752577390.4979724948452190.248986247422609
780.7107362792671450.578527441465710.289263720732855
790.7152341394659140.5695317210681720.284765860534086
800.7011333650869880.5977332698260240.298866634913012
810.6644571489291580.6710857021416840.335542851070842
820.6217935672504750.7564128654990510.378206432749525
830.5746544625480010.8506910749039970.425345537451999
840.5968753401092140.8062493197815730.403124659890786
850.5780599061909950.843880187618010.421940093809005
860.554541979181380.890916041637240.44545802081862
870.5971582603009790.8056834793980420.402841739699021
880.6252310135678020.7495379728643960.374768986432198
890.5912221789544480.8175556420911040.408777821045552
900.5718954488561880.8562091022876250.428104551143812
910.5641121564393510.8717756871212980.435887843560649
920.5372589310704540.9254821378590910.462741068929546
930.4938645032188880.9877290064377750.506135496781112
940.4751315789452450.950263157890490.524868421054755
950.4901708993316510.9803417986633020.509829100668349
960.63433053850410.73133892299180.3656694614959
970.590805468357350.81838906328530.40919453164265
980.5557193654086340.8885612691827320.444280634591366
990.6135686294146040.7728627411707930.386431370585396
1000.5845495580907630.8309008838184730.415450441909237
1010.5983612438312650.803277512337470.401638756168735
1020.5514689781239760.8970620437520470.448531021876024
1030.5014317908163590.9971364183672820.498568209183641
1040.509095427668290.981809144663420.49090457233171
1050.5666181835178960.8667636329642080.433381816482104
1060.5669412906700470.8661174186599070.433058709329953
1070.5265533044676240.9468933910647520.473446695532376
1080.6113309046650160.7773381906699670.388669095334984
1090.592419206520890.815161586958220.40758079347911
1100.5493061972848160.9013876054303680.450693802715184
1110.4939868535680090.9879737071360180.506013146431991
1120.6451668519738170.7096662960523660.354833148026183
1130.6595099309755260.6809801380489480.340490069024474
1140.6518289861665070.6963420276669870.348171013833493
1150.5989864859986710.8020270280026580.401013514001329
1160.5614663665922050.8770672668155890.438533633407795
1170.5184822119699760.9630355760600470.481517788030024
1180.5057864211651750.988427157669650.494213578834825
1190.5265866491714060.9468267016571880.473413350828594
1200.4719280996890090.9438561993780180.528071900310991
1210.446656039848590.893312079697180.55334396015141
1220.4062971632009440.8125943264018880.593702836799056
1230.4513333974960030.9026667949920060.548666602503997
1240.4109431067698690.8218862135397380.589056893230131
1250.4445165454474130.8890330908948250.555483454552587
1260.4640486629798160.9280973259596320.535951337020184
1270.4522297360553760.9044594721107520.547770263944624
1280.3826198011587830.7652396023175660.617380198841217
1290.6069338593179050.786132281364190.393066140682095
1300.716758395021370.5664832099572610.283241604978631
1310.7712682568877770.4574634862244460.228731743112223
1320.829064516229620.3418709675407580.170935483770379
1330.8068867699170450.3862264601659090.193113230082955
1340.8620868893475250.275826221304950.137913110652475
1350.8029249787245340.3941500425509320.197075021275466
1360.7477576402932160.5044847194135680.252242359706784
1370.8073846023370440.3852307953259110.192615397662956
1380.748551388071170.5028972238576610.25144861192883
1390.644129329121650.71174134175670.35587067087835
1400.5136510207734940.9726979584530110.486348979226505
1410.4818939207945290.9637878415890580.518106079205471
1420.3364232238923890.6728464477847780.663576776107611


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level160.124031007751938NOK
5% type I error level340.263565891472868NOK
10% type I error level460.356589147286822NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/10mk2o1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/10mk2o1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/1495s1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/1495s1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/2f04c1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/2f04c1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/3f04c1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/3f04c1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/4f04c1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/4f04c1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/5f04c1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/5f04c1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/6pa4f1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/6pa4f1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/7013i1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/7013i1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/8013i1290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/8013i1290190073.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/9bbk31290190073.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290189983r3hp3qf3s7314tf/9bbk31290190073.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = Linear Trend ;
 
R code (references can be found in the software module):
library(lattice)
library(lmtest)
n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
if (n > n25) {
kp3 <- k + 3
nmkm3 <- n - k - 3
gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
numgqtests <- 0
numsignificant1 <- 0
numsignificant5 <- 0
numsignificant10 <- 0
for (mypoint in kp3:nmkm3) {
j <- 0
numgqtests <- numgqtests + 1
for (myalt in c('greater', 'two.sided', 'less')) {
j <- j + 1
gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
}
if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
}
gqarr
}
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
qqline(mysum$resid)
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
if (n > n25) {
bitmap(file='test9.png')
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
dev.off()
}
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')
if (n > n25) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-values',header=TRUE)
a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'breakpoint index',header=TRUE)
a<-table.element(a,'greater',header=TRUE)
a<-table.element(a,'2-sided',header=TRUE)
a<-table.element(a,'less',header=TRUE)
a<-table.row.end(a)
for (mypoint in kp3:nmkm3) {
a<-table.row.start(a)
a<-table.element(a,mypoint,header=TRUE)
a<-table.element(a,gqarr[mypoint-kp3+1,1])
a<-table.element(a,gqarr[mypoint-kp3+1,2])
a<-table.element(a,gqarr[mypoint-kp3+1,3])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable5.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Description',header=TRUE)
a<-table.element(a,'# significant tests',header=TRUE)
a<-table.element(a,'% significant tests',header=TRUE)
a<-table.element(a,'OK/NOK',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'1% type I error level',header=TRUE)
a<-table.element(a,numsignificant1)
a<-table.element(a,numsignificant1/numgqtests)
if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'5% type I error level',header=TRUE)
a<-table.element(a,numsignificant5)
a<-table.element(a,numsignificant5/numgqtests)
if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'10% type I error level',header=TRUE)
a<-table.element(a,numsignificant10)
a<-table.element(a,numsignificant10/numgqtests)
if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable6.tab')
}
 





Copyright

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