Home » date » 2010 » Nov » 22 »

*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: Mon, 22 Nov 2010 19:57:03 +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/22/t1290455725ps8xvne9bkf9zyf.htm/, Retrieved Mon, 22 Nov 2010 20:55:25 +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/22/t1290455725ps8xvne9bkf9zyf.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 5 1 6 5 7 5 2 1 6 2 3 5 6 3 6 6 3 5 6 2 4 4 6 8 6 3 2 6 2 6 5 2 7 3 3 6 5 2 6 5 1 4 6 2 5 3 2 5 6 4 6 5 5 5 5 4 7 4 1 5 5 1 7 1 6 6 5 2 4 6 1 7 6 1 1 6 1 7 5 3 6 6 2 6 5 2 4 4 1 7 6 5 5 6 3 7 6 2 5 5 2 5 4 5 6 3 2 8 5 4 4 5 2 7 5 2 6 4 2 5 5 2 3 5 2 7 6 5 3 6 2 5 5 1 5 3 1 10 7 4 5 4 3 5 6 1 5 5 2 4 6 3 5 4 3 4 6 2 5 5 4 5 6 2 2 6 5 5 4 1 6 7 2 6 5 3 7 2 5 5 6 4 2 4 5 5 4 3 3 6 1 8 5 5 6 5 6 5 5 2 5 5 3 5 5 1 7 5 4 5 7 2 5 6 6 5 7 5 6 6 5 5 6 1 5 1 5 5 7 3 3 4 3 7 6 2 7 2 3 7 5 3 5 3 5 7 6 2 5 4 2 4 4 2 6 5 2 5 6 3 2 4 3 5 5 3 7 4 5 4 5 5 3 3 2 5 6 3 6 4 4 5 6 2 7 6 5 6 5 1 5 4 2 5 6 6 4 5 2 5 5 6 6 4 5 6 5 3 7 5 6 6 5 5 2 6 6 4 6 4 2 6 5 6 6 3 2 4 4 6 5 2 5 4 3 5 7 7 2 6 7 5 6 2 5 4 7 5 5 2 6 2 5 7 5 2 2 6 2 6 6 2 4 5 6 8 5 3 6 6 6 7 5 5 4 6 4 5 6 2 3 5 5 6 6 5 3 5 2 6 3 2 3 5 6 5 5 1 6 5 3 5 5 3 6 3 2 5 6 4 5 4 2 5 5 2 3 1 5 4 5 4 3 5 3 6 4 4 2 2 4 6 5 3 3 6 5 6 5 2 3 5 7 6 2 1 5 2 2 7 6 5 3 6 5 7 6 2 5 5 6 5 6 4 2 6 4 7 6 4 5 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 time12 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Cry_Sad[t] = + 1.55818696167561 + 0.00970850787920307Age[t] + 0.216489180560649Use_hands[t] + 0.273494403108749Hand_on_hips[t] + 0.148458261933412Quiet_FirstMeeting[t] -0.138792085520547Outgoing_individual[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.558186961675611.1562051.34770.1796920.089846
Age0.009708507879203070.1185360.08190.9348270.467413
Use_hands0.2164891805606490.1298331.66740.0974060.048703
Hand_on_hips0.2734944031087490.0997892.74070.0068370.003418
Quiet_FirstMeeting0.1484582619334120.0867121.71210.0888420.044421
Outgoing_individual-0.1387920855205470.103965-1.3350.18380.0919


Multiple Linear Regression - Regression Statistics
Multiple R0.294897539336513
R-squared0.0869645587067305
Adjusted R-squared0.0580710320835258
F-TEST (value)3.00982845883853
F-TEST (DF numerator)5
F-TEST (DF denominator)158
p-value0.0126753249430451
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.74510105898936
Sum Squared Residuals481.169677561553


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
173.178875966739763.82112403326024
232.926367665861050.0736323341389457
333.78414485223896-0.784144852238956
463.491318096304482.50868190369552
523.21943732814292-1.21943732814292
633.86870429494382-0.868704294943817
713.44266186196931-2.44266186196931
823.76885993587923-1.76885993587923
954.196431340868250.803568659131747
1014.26719250776156-3.26719250776156
1163.863085554996962.13691444500304
1213.00695325258194-2.00695325258194
1312.51428175211280-1.51428175211280
1423.58707268743671-1.58707268743671
1513.28453742362303-2.28453742362303
1634.20209241228145-1.20209241228145
1723.52040128847575-1.52040128847575
1824.3145315538968-2.3145315538968
1923.71215116007839-1.71215116007839
2023.59116245536906-1.59116245536906
2122.98757856828987-0.98757856828987
2223.90517588841462-1.90517588841462
2313.28858486008904-2.28858486008904
2434.45179688441205-1.45179688441205
2523.22748986960859-1.22748986960859
2633.90356225346744-0.903562253467436
2743.491275764838140.50872423516186
2852.916817401396562.08318259860344
2922.66538559937961-0.665385599379614
3054.280990783573110.719009216426887
3153.741390378655151.25860962134485
3212.90579170531742-1.90579170531742
3364.282562087053961.71743791294604
3433.28449509215669-0.284495092156694
3543.307917212914770.69208278708523
3663.578681367757442.42131863224256
3754.54762283901710.452377160982898
3853.782658211690781.21734178830922
3933.83284341804046-0.832843418040463
4034.23369406890422-1.23369406890422
4153.854990682064941.14500931793506
4223.6591933739963-1.65919337399630
4323.20675566565026-1.20675566565025
4433.4678959755464-0.467895975546402
4553.993698104652811.00630189534719
4624.07593744077801-2.07593744077801
4744.06172902328005-0.0617290232800512
4853.659108711063621.34089128893638
4923.15950128244770-1.15950128244770
5024.44650362321893-2.44650362321893
5154.665723052045650.334276947954352
5263.864614527011472.13538547298853
5363.530519938041362.46948006195864
5453.454097699734851.54590230026515
5543.477604483425610.522395516574395
5633.43299568555644-0.432995685556445
5774.500778597500952.49922140249905
5873.639776358237893.36022364176211
5953.849329610651751.15067038934825
6022.71974523659432-0.719745236594316
6163.362234518663132.63776548133687
6263.596781195315922.40321880468408
6343.837144969787390.162855030212614
6453.204067748850521.79593225114948
6524.03425946605597-2.03425946605597
6662.564308715047783.43569128495222
6733.15945895098136-0.159458950981358
6823.98403192823995-1.98403192823995
6924.18676516445539-2.18676516445539
7053.542746910372061.45725308962794
7133.52485886662816-0.524858866628164
7243.595704696454150.404295303545848
7353.131989393757271.86801060624273
7472.997287076169074.00271292383093
7522.78761791180685-0.787617911806846
7653.905175888414621.09482411158538
7763.520401288475752.47959871152425
7843.463806207614060.536193792385944
7934.34497426573434-1.34497426573434
8064.118734245828151.88126575417185
8153.571745439610651.42825456038935
8223.63977635823789-1.63977635823789
8353.007037915514611.99296208448539
8433.46207887772772-0.462078877727716
8564.487771456254561.51222854374544
8653.939875603523531.06012439647647
8713.2371983774878-2.23719837748780
8852.257641351835412.74235864816459
8923.28449509215669-1.28449509215669
9013.29416126856956-2.29416126856956
9144.59905165308468-0.599051653084684
9223.43299568555644-1.43299568555644
9333.22753220107493-0.227532201074933
9453.788276951637641.21172304836236
9563.217823693195732.78217630680427
9644.5145768733125-0.5145768733125
9743.126370653810420.873629346189583
9852.994398584488292.00560141551171
9912.22976165292492-1.22976165292492
10064.653368958833051.34663104116695
10123.08874011555439-1.08874011555438
10233.21377625672972-0.213776256729721
10353.30391210791511.6960878920849
10422.79451150848730-0.794511508487297
10523.20411008031686-1.20411008031686
10633.65357463404944-0.65357463404944
10722.78211508380836-0.782115083808357
10863.974323420360752.02567657963925
10933.73730061072280-0.737300610722804
11022.76835913946315-0.768359139463147
11113.10399378289841-2.10399378289841
11213.06122822686396-2.06122822686396
11312.98757856828987-1.98757856828987
11443.702400320732850.297599679267153
11512.56426638358144-1.56426638358144
11613.61094728134753-2.61094728134753
11713.6535323025831-2.6535323025831
11852.719745236594322.28025476340568
11953.530025133422281.46997486657772
12022.22976165292492-0.229761652924919
12133.50098427271734-0.500984272717343
12252.780797895608422.21920210439158
12323.41391744801163-1.41391744801163
12423.49127576483814-1.49127576483814
12544.25347889488269-0.253478894882691
12612.71003672871511-1.71003672871511
12754.537998994070580.462001005929424
12812.80148976810043-1.80148976810043
12923.19031180450531-1.19031180450531
13023.57174543961065-1.57174543961065
13163.65353230258312.3464676974169
13223.22348476460892-1.22348476460892
13312.28804173220661-1.28804173220661
13433.05136147557005-0.0513614755700526
13543.571745439610650.428254560389346
13662.832226709676013.16777329032399
13754.206182180213790.793817819786206
13864.39222864893691.6077713510631
13963.581496278956202.41850372104380
14013.69686624371867-2.69686624371867
14162.941652582220783.05834741777922
14223.04012621268556-1.04012621268556
14323.27482891574383-1.27482891574383
14473.362192187196803.63780781280320
14523.21377625672972-1.21377625672972
14623.38458014055944-1.38458014055944
14763.284495092156692.71550490784331
14813.40817171366576-2.40817171366576
14923.28449509215669-1.28449509215669
15033.62201530889301-0.62201530889301
15144.02455095817676-0.0245509581767641
15253.338812397905061.66118760209494
15354.354640442147210.645359557852794
15463.947972693464772.05202730653523
15532.748870760231930.251129239768074
15613.5455930705865-2.54559307058650
15733.07498417120917-0.0749841712091741
15823.34690727083707-1.34690727083707
15933.65915104252996-0.659151042529958
16073.426218000824363.57378199917564
16133.54411763897186-0.544117638971863
16242.936234417154971.06376558284503
16363.808104109082452.19189589091755
16423.08874011555439-1.08874011555438


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.9749960653803060.05000786923938870.0250039346196943
100.95653572025880.08692855948239970.0434642797411998
110.9346631374080680.1306737251838640.065336862591932
120.9251839178305070.1496321643389860.0748160821694931
130.9153859084260750.1692281831478510.0846140915739254
140.8762173392086710.2475653215826580.123782660791329
150.8587362101011720.2825275797976560.141263789898828
160.8295523532832790.3408952934334420.170447646716721
170.8264504507840420.3470990984319160.173549549215958
180.7801268681959560.4397462636080890.219873131804044
190.7224752435738320.5550495128523370.277524756426168
200.7077739570921610.5844520858156780.292226042907839
210.6426485493696180.7147029012607640.357351450630382
220.5920876268996150.815824746200770.407912373100385
230.6398064255027040.7203871489945920.360193574497296
240.59381582353110.8123683529378010.406184176468901
250.5555014922106430.8889970155787140.444498507789357
260.4895552566339350.979110513267870.510444743366065
270.4467574807324350.893514961464870.553242519267565
280.5602980028882070.8794039942235860.439701997111793
290.498149563862680.996299127725360.50185043613732
300.4769166380111880.9538332760223750.523083361988812
310.5054169193613870.9891661612772260.494583080638613
320.4609339531534860.9218679063069730.539066046846514
330.6069787191302350.786042561739530.393021280869765
340.5510211026399930.8979577947200150.448978897360007
350.5072860168684830.9854279662630340.492713983131517
360.5477333313352150.904533337329570.452266668664785
370.4977463992450370.9954927984900730.502253600754963
380.4529310398305180.9058620796610370.547068960169482
390.4131008260007510.8262016520015030.586899173999249
400.3958978203835930.7917956407671860.604102179616407
410.3995753595372060.7991507190744110.600424640462795
420.389470185154940.778940370309880.61052981484506
430.3494414402922390.6988828805844780.650558559707761
440.3012963803356580.6025927606713150.698703619664342
450.2808591498658380.5617182997316770.719140850134162
460.2643572484528780.5287144969057550.735642751547122
470.2230007386396270.4460014772792540.776999261360373
480.2007973904055690.4015947808111370.799202609594431
490.1775757524890910.3551515049781830.822424247510909
500.1816391147554940.3632782295109870.818360885244506
510.1708899765364830.3417799530729660.829110023463517
520.2016125145689470.4032250291378940.798387485431053
530.3409381407460390.6818762814920790.65906185925396
540.3458395352448140.6916790704896280.654160464755186
550.3132787388615090.6265574777230190.686721261138491
560.2721454158559660.5442908317119330.727854584144034
570.3209729141063060.6419458282126110.679027085893694
580.4365371413964790.8730742827929580.563462858603521
590.4123739741777060.8247479483554120.587626025822294
600.3702470592447430.7404941184894860.629752940755257
610.4292621735275890.8585243470551780.570737826472411
620.4965970291592820.9931940583185630.503402970840718
630.4551551887974440.9103103775948880.544844811202556
640.4536534695600240.9073069391200490.546346530439976
650.4647988303185370.9295976606370750.535201169681463
660.6379540359922980.7240919280154030.362045964007702
670.5944566017405380.8110867965189240.405543398259462
680.6019695554095520.7960608891808960.398030444590448
690.6253037516985770.7493924966028470.374696248301423
700.6166775416191190.7666449167617620.383322458380881
710.575219997555190.849560004889620.42478000244481
720.5359650371705810.9280699256588370.464034962829419
730.540219135270670.919561729458660.45978086472933
740.7123267153353150.575346569329370.287673284664685
750.67828090528620.64343818942760.3217190947138
760.6517041416904890.6965917166190220.348295858309511
770.6861484180823580.6277031638352840.313851581917642
780.6475270126638270.7049459746723460.352472987336173
790.6313411163919650.7373177672160710.368658883608035
800.6404937425310830.7190125149378330.359506257468917
810.6247250601275210.7505498797449570.375274939872478
820.6217204351390420.7565591297219150.378279564860958
830.6297873720076890.7404252559846210.370212627992311
840.5896127309567120.8207745380865750.410387269043288
850.5783324756734020.8433350486531960.421667524326598
860.552846168424160.894307663151680.44715383157584
870.5846819495660840.8306361008678320.415318050433916
880.6619897876561970.6760204246876060.338010212343803
890.643130022584520.713739954830960.35686997741548
900.6765965001629450.646806999674110.323403499837055
910.6421489611207880.7157020777584240.357851038879212
920.6320379157177650.7359241685644690.367962084282235
930.588985690117620.8220286197647590.411014309882380
940.559763899079640.880472201840720.44023610092036
950.6283206592482110.7433586815035780.371679340751789
960.5892427457658010.8215145084683980.410757254234199
970.5602300232255090.8795399535489820.439769976774491
980.5885928109050260.8228143781899480.411407189094974
990.5644801848855190.8710396302289620.435519815114481
1000.5411151074044020.9177697851911970.458884892595598
1010.5128169169358910.9743661661282170.487183083064109
1020.4666935900184550.933387180036910.533306409981545
1030.4578511106523120.9157022213046230.542148889347688
1040.4184973717670180.8369947435340360.581502628232982
1050.3913583886660720.7827167773321440.608641611333928
1060.3522497791965650.704499558393130.647750220803435
1070.3160773980989360.6321547961978730.683922601901063
1080.3329679867648450.665935973529690.667032013235155
1090.2954232691750150.590846538350030.704576730824985
1100.2601321023662250.520264204732450.739867897633775
1110.3018329959240260.6036659918480530.698167004075974
1120.3054516803094930.6109033606189850.694548319690507
1130.3038824507377850.607764901475570.696117549262215
1140.2623730434506820.5247460869013640.737626956549318
1150.2459789772692080.4919579545384160.754021022730792
1160.3070745189590400.6141490379180790.69292548104096
1170.3618770484239270.7237540968478550.638122951576073
1180.395580718064240.791161436128480.60441928193576
1190.3654591398077730.7309182796155450.634540860192227
1200.3173202747972120.6346405495944230.682679725202788
1210.2755958339983960.5511916679967920.724404166001604
1220.3114546731540990.6229093463081980.688545326845901
1230.3286029963725590.6572059927451180.671397003627441
1240.3035809026710880.6071618053421770.696419097328912
1250.2690815130820650.538163026164130.730918486917935
1260.2557350349141870.5114700698283740.744264965085813
1270.2138222415171790.4276444830343580.786177758482821
1280.2070437293413920.4140874586827830.792956270658609
1290.1814811212732780.3629622425465570.818518878726722
1300.1789741003145050.3579482006290110.821025899685495
1310.2145798538747680.4291597077495360.785420146125232
1320.1974872669414520.3949745338829040.802512733058548
1330.1821289779141740.3642579558283490.817871022085826
1340.1450456342755890.2900912685511780.854954365724411
1350.1143023358958370.2286046717916740.885697664104163
1360.2238820877971740.4477641755943480.776117912202826
1370.180641492803250.36128298560650.81935850719675
1380.1545191744417340.3090383488834680.845480825558266
1390.2119827448885250.4239654897770490.788017255111475
1400.2192778958526720.4385557917053450.780722104147328
1410.3261546133209550.652309226641910.673845386679045
1420.2873880354816240.5747760709632470.712611964518376
1430.2407500040397490.4815000080794970.759249995960251
1440.4840649674461220.9681299348922440.515935032553878
1450.4369926075991380.8739852151982760.563007392400862
1460.3674987364907880.7349974729815760.632501263509212
1470.6584122258524560.6831755482950880.341587774147544
1480.6658021465190450.668395706961910.334197853480955
1490.5903097204913020.8193805590173960.409690279508698
1500.6035256092486550.792948781502690.396474390751345
1510.5717044460331060.8565911079337880.428295553966894
1520.4941028377918620.9882056755837250.505897162208138
1530.3749922252690110.7499844505380220.625007774730989
1540.2586098927774300.5172197855548590.74139010722257
1550.5419511226066720.9160977547866550.458048877393328


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 level20.0136054421768707OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/10tz0t1290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/10tz0t1290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/14g3z1290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/14g3z1290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/24g3z1290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/24g3z1290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/3fp2k1290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/3fp2k1290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/4fp2k1290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/4fp2k1290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/5fp2k1290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/5fp2k1290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/6py151290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/6py151290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/70qi81290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/70qi81290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/80qi81290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/80qi81290455807.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/90qi81290455807.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290455725ps8xvne9bkf9zyf/90qi81290455807.ps (open in new window)


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