Home » date » 2010 » Nov » 23 »

Multiple Regression G Minitutorial

*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: Tue, 23 Nov 2010 22:51:32 +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/23/t1290552638grcyesj6i1pc9h5.htm/, Retrieved Tue, 23 Nov 2010 23:50:41 +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/23/t1290552638grcyesj6i1pc9h5.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 «
7 7 1 7 7 1 7 7 1 5 6 1 5 5 1 5 5 1 6 6 2 5 6 1 4 5 1 4 5 2 5 6 2 5 6 2 5 6 2 5 6 2 5 6 1 6 7 1 7 5 1 6 7 1 7 7 1 7 7 1 7 6 2 6 7 1 5 6 1 5 7 1 6 7 1 3 7 2 7 7 1 6 6 1 6 6 1 5 6 1 5 4 1 7 7 1 4 7 2 5 6 1 6 7 1 6 7 2 4 6 1 5 6 1 4 5 1 6 7 1 3 6 1 6 6 1 6 6 1 7 7 1 7 7 1 5 6 2 5 6 3 6 6 2 3 4 1 7 7 1 4 7 1 7 7 1 7 7 1 6 7 2 3 7 1 7 7 1 6 7 2 5 6 2 6 7 2 6 6 1 3 3 1 5 5 1 4 4 2 5 7 1 7 7 NA 5 7 1 2 5 1 4 5 1 2 6 1 6 7 1 7 6 1 6 7 2 3 6 1 7 7 2 5 7 1 6 5 1 7 6 1 6 5 1 6 5 1 7 6 1 6 5 1 5 6 1 3 6 1 5 7 1 5 5 1 7 6 1 5 6 2 7 6 1 5 6 1 5 6 1 6 6 1 7 6 1 6 6 2 5 5 1 5 5 1 6 6 1 5 4 4 5 3 6 5 1 1 4 5 3 4 3 3 4 5 2 4 4 1 5 5 1 6 7 2 6 6 2 6 6 2 5 5 2 5 6 1 7 7 1 5 7 1 5 7 1 5 7 1 5 5 2 7 7 1 7 7 1 7 7 2 5 7 1 7 6 1 5 6 1 5 7 1 6 7 1 5 7 1 6 5 1 6 7 1 7 6 1 5 6 2 7 6 2 5 6 1 6 6 1 7 6 2 7 5 2 7 3 1 6 5 1 6 6 2 5 6 4 6 6 4 3 6 1 5 5 1 4 6 2 4 5 2 5 4 3 7 7 3 6 7 2 6 6 2 5 6 2 5 6 1 2 6 3 6 7 2 4 7 2 4 6 2 5 6 2 4 5 1 4 5 1 3 5 1 6 5 1 6 6 2 7 7 1 5 7 1 3 5 1 6 4 1 4 3 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
Q1_7[t] = + 3.06528780326958 + 0.164175161185608Q1_2[t] -0.0765245287154905Q1_3[t] + 0.243401719833989Q1_5[t] + 0.419839287888058Q1_8[t] -0.303558928060235Q1_12[t] + 0.085748375843493Q1_16[t] -0.161019595095292Q1_22[t] + 0.306324782495529GENDER[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.065287803269580.8160553.75620.0002450.000122
Q1_20.1641751611856080.0858251.91290.0576290.028814
Q1_3-0.07652452871549050.088532-0.86440.3887350.194367
Q1_50.2434017198339890.1271811.91380.057510.028755
Q1_80.4198392878880580.1198763.50230.0006050.000302
Q1_12-0.3035589280602350.103292-2.93880.0038050.001903
Q1_160.0857483758434930.1040480.82410.4111530.205577
Q1_22-0.1610195950952920.106772-1.50810.1336010.0668
GENDER0.3063247824955290.1761771.73870.0840930.042046


Multiple Linear Regression - Regression Statistics
Multiple R0.450959020796799
R-squared0.203364038438007
Adjusted R-squared0.161709870513197
F-TEST (value)4.8822014355226
F-TEST (DF numerator)8
F-TEST (DF denominator)153
p-value2.21235956312515e-05
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.06402597940044
Sum Squared Residuals173.219146580378


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
176.33698628528350.663013714716503
255.39602435435525-0.396024354355251
356.13769214741941-1.13769214741941
455.81336098894718-0.813360988947182
555.59468683892177-0.59468683892177
675.247384172478281.75261582752172
776.804330662874320.195669337125685
855.58147508452284-0.581475084522841
935.86925219603765-2.86925219603765
1065.819019208333620.180980791666376
1176.28728920402380.7127107959762
1266.3057368982798-0.305736898279805
1355.56594010521421-0.565940105214208
1435.82824305546163-2.82824305546163
1576.249335652813380.750664347186624
1655.68320106920056-0.683201069200558
1775.652614099157051.34738590084295
1876.557562691935530.44243730806447
1975.90086204719311.0991379528069
2066.10027450265332-0.100274502653322
2155.67884361987783-0.678843619877834
2277.56175867688814-0.561758676888145
2342.973548242861861.02645175713814
2475.281754489509331.71824551049067
2576.14231170798790.8576882920121
2676.14231170798790.8576882920121
2779.49382445205272-2.49382445205272
2832.037693358359040.962306641640964
2977.98319436951923-0.983194369519232
3054.211092366672650.788907633327353
3177.39727766381894-0.397277663818941
3254.565883735592080.434116264407923
3355.56895713630856-0.568957136308561
3444.45493221874906-0.454932218749061
3555.2262063776982-0.2262063776982
3664.913663739940781.08633626005922
3778.4655031839114-1.46550318391141
3854.643311067779020.356688932220977
3975.578319518432531.42168048156747
4076.83713921122530.162860788774708
4166.48687977662416-0.486879776624159
4264.594686838921771.40531316107823
4376.15430140955120.845698590448803
4477.18500182611667-0.185001826116668
4565.302875670782290.697124329217706
4667.8094056495506-1.8094056495506
4743.33847153925830.661528460741705
4877.75886200010738-0.758862000107379
4954.824959174643740.175040825356262
5066.50578289698796-0.505782896987962
5157.39412209772863-2.39412209772863
5232.321240620960380.67875937903962
5375.960650087158561.03934991284144
5466.55440712584521-0.554407125845215
5566.09562099238533-0.0956209923853308
5655.81586364224331-0.815863642243308
5754.248082343349680.751917656650315
5875.963104906063651.03689509393635
5976.778712204260270.221287795739735
6077.39506311974298-0.39506311974298
6166.13052138306137-0.130521383061368
6264.89238817095881.1076118290412
6376.600432238450720.399567761549281
6476.545789904759350.454210095240646
6554.048819462113660.951180537886337
6676.907533438612410.0924665613875884
6767.3057368982798-1.3057368982798
6855.07468333503607-0.0746833350360746
6966.28175448950933-0.281754489509331
7055.83713921122529-0.837139211225291
7155.46991205946541-0.469912059465413
7265.74335827742680.256641722573196
7365.038830035263880.961169964736119
7464.783503820194161.21649617980584
7576.16246813781540.837531862184606
7666.23899266653088-0.238992666530884
7754.165099821941490.834900178058513
7876.557562691935530.44243730806447
7975.429198550504591.57080144949541
8065.378180242805620.621819757194375
8176.980038803428920.0199611965710835
8265.981292112892610.0187078871073924
8364.664067894276021.33593210572398
8476.152822011158030.847177988841974
8565.451792056573740.548207943426255
8675.860028348909651.13997165109035
8777.02367345923255-0.023673459232553
8857.94195693749092-2.94195693749092
8932.433667243826480.566332756173522
9065.771082556288380.22891744371162
9167.69856002751253-1.69856002751253
9254.640964487229220.359035512770785
9366.24808234334968-0.248082343349685
9465.571797701237410.428202298762586
9564.837139211225291.16286078877471
9677.37211196176794-0.372111961767939
9765.715950602904730.28404939709527
9865.61975632709760.380243672902398
9965.480085254123880.519914745876117
10076.49192219542610.508077804573901
10167.20668349111864-1.20668349111864
10255.92113490466636-0.921134904666362
10354.740592422991510.259407577008491
10465.778873665566270.22112633443373
10564.944657585598651.05534241440135
10666.55454129615442-0.554541296154416
10755.01182409687694-0.0118240968769383
10868.00863596291228-2.00863596291228
10943.904767584177120.095232415822883
11065.008635962912280.991364037087722
11175.860028348909651.13997165109035
11277.05270959518268-0.052709595182682
11355.0014485427201-0.00144854272010161
11454.087062748254390.912937251745607
11579.66650605734698-2.66650605734698
11631.758534308743041.24146569125696
11776.750024858990520.249975141009482
11853.716014427407131.28398557259287
11978.05828872355003-1.05828872355003
12054.507036206451650.492963793548347
12134.0592653620773-1.0592653620773
12266.66098538770463-0.660985387704627
12354.336986285283490.663013714716506
12444.05277480151025-0.0527748015102448
12576.565306561966270.434693438033726
12669.1890122145288-3.1890122145288
12777.52097959087286-0.520979590872858
12822.21109236667265-0.211092366672646
12954.664689550442150.335310449557851
13066.31894865267873-0.318948652678734
13167.87941456766134-1.87941456766134
13266.29335748506149-0.293357485061486
13320.6607654676736261.33923453232637
13467.54105144789064-1.54105144789064
13576.203628234440780.79637176555922
13641.971737568756392.02826243124361
13777.55440712584521-0.554407125845215
13877.10027450265332-0.100274502653322
13969.02609036280688-3.02609036280688
14065.099021193189630.900978806810369
14120.1058488622683391.89415113773166
14278.12344173420253-1.12344173420253
14377.03700219719906-0.0370021971990613
14454.728213009773190.271786990226809
14555.77784560080772-0.777845600807716
14666.24195204202131-0.241952042021315
14754.70550470294110.294495297058905
14864.995318241391731.00468175860827
14966.61010481188055-0.610104811880548
15065.619328659008550.38067134099145
15153.895871428413451.10412857158655
15265.479135906593410.520864093406585
15377.13456783795716-0.134567837957156
15476.784731261589480.215268738410524
15565.187909731208440.81209026879156
15664.636317635663931.36368236433607
15765.640964487229220.359035512770785
15877.9016120180868-0.901612018086801
15966.76964981843827-0.769649818438267
16055.8923881709588-0.892388170958799
16155.90981000297906-0.909810002979057
16256.46910391473786-1.46910391473786
1634NANA
1644NANA


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.3279178602955750.6558357205911490.672082139704425
130.5488238567965580.9023522864068840.451176143203442
140.9038009192669210.1923981614661570.0961990807330785
150.8454069005847030.3091861988305930.154593099415297
160.8411979586940390.3176040826119230.158802041305961
170.825435208905990.3491295821880190.174564791094009
180.7887325309314460.4225349381371090.211267469068554
190.7684313409690810.4631373180618380.231568659030919
200.7469955914155530.5060088171688940.253004408584447
210.7026972964020320.5946054071959360.297302703597968
220.6388490167655910.7223019664688180.361150983234409
230.5753956019656840.8492087960686320.424604398034316
240.789879703343630.4202405933127410.210120296656371
250.8147986659535890.3704026680928210.185201334046411
260.804663813828360.3906723723432790.195336186171639
270.9560223807197330.08795523856053490.0439776192802674
280.9459247252716930.1081505494566140.0540752747283068
290.9308191248535820.1383617502928360.0691808751464181
300.9147278429405650.170544314118870.0852721570594351
310.8999701028788290.2000597942423430.100029897121171
320.9389976166223660.1220047667552670.0610023833776335
330.9215288283846670.1569423432306670.0784711716153334
340.9163758546831920.1672482906336170.0836241453168083
350.8912523391360980.2174953217278050.108747660863902
360.8910387946967470.2179224106065050.108961205303253
370.8970774468920250.2058451062159490.102922553107975
380.8711697001050410.2576605997899180.128830299894959
390.9082665557507080.1834668884985840.0917334442492921
400.8843423379218460.2313153241563080.115657662078154
410.8664676369241730.2670647261516530.133532363075827
420.8860453976921880.2279092046156240.113954602307812
430.8725786206000110.2548427587999770.127421379399988
440.84441252730720.3111749453856010.1555874726928
450.8210755653313980.3578488693372030.178924434668602
460.856264563499090.2874708730018190.14373543650091
470.8312105328160030.3375789343679950.168789467183997
480.812589111373020.3748217772539590.187410888626979
490.7812495307087950.437500938582410.218750469291205
500.7476388005827060.5047223988345890.252361199417294
510.8611883264476620.2776233471046770.138811673552338
520.8390950317679360.3218099364641280.160904968232064
530.865572249590250.2688555008194990.134427750409749
540.8419191872471110.3161616255057770.158080812752889
550.8110721965874840.3778556068250320.188927803412516
560.7915934383783070.4168131232433860.208406561621693
570.7740224842146710.4519550315706570.225977515785329
580.7647600919580770.4704798160838460.235239908041923
590.7324932389872030.5350135220255950.267506761012797
600.6960792366342810.6078415267314380.303920763365719
610.6561507074473240.6876985851053510.343849292552676
620.6628902871840110.6742194256319770.337109712815989
630.6282419644919470.7435160710161060.371758035508053
640.5890698152664670.8218603694670650.410930184733533
650.5856940109269980.8286119781460040.414305989073002
660.5385459846532980.9229080306934040.461454015346702
670.5610197997300690.8779604005398630.438980200269931
680.5134528113396160.9730943773207670.486547188660384
690.4704071648478440.9408143296956890.529592835152156
700.451270177723850.90254035544770.54872982227615
710.4122738823315570.8245477646631150.587726117668443
720.3702094052191710.7404188104383420.629790594780829
730.3624393093327270.7248786186654540.637560690667273
740.3667455082191270.7334910164382540.633254491780873
750.3485689748396140.6971379496792290.651431025160386
760.3078472969523480.6156945939046970.692152703047652
770.2886676312474140.5773352624948290.711332368752586
780.2560302132351850.512060426470370.743969786764815
790.3075520092478480.6151040184956960.692447990752152
800.283436274718660.5668725494373190.71656372528134
810.2449462532916480.4898925065832960.755053746708352
820.2094823079478440.4189646158956890.790517692052156
830.227347977181180.454695954362360.77265202281882
840.221205319679380.4424106393587610.77879468032062
850.1948881153642920.3897762307285840.805111884635708
860.193770929161450.38754185832290.80622907083855
870.1630638225195410.3261276450390820.836936177480459
880.3882373801049120.7764747602098250.611762619895088
890.3549188574293680.7098377148587350.645081142570632
900.31628663050940.6325732610188010.6837133694906
910.3729857315517510.7459714631035010.62701426844825
920.3314473539260320.6628947078520650.668552646073968
930.2918356332574990.5836712665149980.708164366742501
940.2610342906526460.5220685813052930.738965709347354
950.2664928126624370.5329856253248750.733507187337563
960.2322463443285310.4644926886570620.767753655671469
970.2017097860700450.4034195721400890.798290213929955
980.1758629466932820.3517258933865650.824137053306718
990.1550697391902050.310139478380410.844930260809795
1000.1357504850001290.2715009700002590.86424951499987
1010.1402130338045720.2804260676091430.859786966195428
1020.1342839364256280.2685678728512570.865716063574372
1030.111738650460150.2234773009203010.88826134953985
1040.09160055257050220.1832011051410040.908399447429498
1050.09237028979363780.1847405795872760.907629710206362
1060.07701650774031650.1540330154806330.922983492259684
1070.06103165951242070.1220633190248410.93896834048758
1080.09877946698016990.197558933960340.90122053301983
1090.07880204313517470.1576040862703490.921197956864825
1100.07679166459593810.1535833291918760.923208335404062
1110.0759300593350530.1518601186701060.924069940664947
1120.06107965923859860.1221593184771970.938920340761401
1130.04854378582317910.09708757164635810.951456214176821
1140.045861021921560.091722043843120.95413897807844
1150.1508150290610950.301630058122190.849184970938905
1160.1554549157829180.3109098315658360.844545084217082
1170.1349581697577620.2699163395155250.865041830242238
1180.151974612375010.303949224750020.84802538762499
1190.1464322820409810.2928645640819610.85356771795902
1200.1265434437962960.2530868875925930.873456556203704
1210.1217670890284970.2435341780569940.878232910971503
1220.09903849753510560.1980769950702110.900961502464894
1230.08760762892856260.1752152578571250.912392371071437
1240.06715300239287540.1343060047857510.932846997607125
1250.05440486739425430.1088097347885090.945595132605746
1260.2569878933883330.5139757867766650.743012106611667
1270.2146342471168030.4292684942336050.785365752883197
1280.1739204372376410.3478408744752810.82607956276236
1290.139634607699450.2792692153988990.86036539230055
1300.1116142751641140.2232285503282280.888385724835886
1310.3433895527495150.686779105499030.656610447250485
1320.2906130684685120.5812261369370240.709386931531488
1330.3422044814142390.6844089628284780.657795518585761
1340.3865233525248240.7730467050496480.613476647475176
1350.3442564710159820.6885129420319630.655743528984018
1360.4666029657936520.9332059315873030.533397034206348
1370.4224813737494910.8449627474989810.577518626250509
1380.3500089245539490.7000178491078970.649991075446051
1390.7239471073903420.5521057852193170.276052892609658
1400.6548077074947530.6903845850104950.345192292505247
1410.6324472419423760.7351055161152480.367552758057624
1420.6288576595857330.7422846808285340.371142340414267
1430.557648962367930.8847020752641390.442351037632069
1440.4881641543590830.9763283087181650.511835845640917
1450.5716679304502840.8566641390994320.428332069549716
1460.5680687062540140.8638625874919720.431931293745986
1470.4841300171259870.9682600342519750.515869982874013
1480.3651655244387640.7303310488775270.634834475561236
1490.2586791941694340.5173583883388680.741320805830566
1500.1540132559047540.3080265118095090.845986744095246
1510.7527716702676740.4944566594646510.247228329732326
1520.5661134440986010.8677731118027980.433886555901399


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 level30.0212765957446809OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/10fmdi1290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/10fmdi1290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/1qly61290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/1qly61290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/2qly61290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/2qly61290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/3jcg91290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/3jcg91290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/4jcg91290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/4jcg91290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/5jcg91290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/5jcg91290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/6c3fu1290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/6c3fu1290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/7muex1290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/7muex1290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/8muex1290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/8muex1290552679.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/9muex1290552679.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290552638grcyesj6i1pc9h5/9muex1290552679.ps (open in new window)


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