Home » date » 2010 » Nov » 23 »

ws7

*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 18:48: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/23/t1290538406q1w1e77gq345j98.htm/, Retrieved Tue, 23 Nov 2010 19:53:27 +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/t1290538406q1w1e77gq345j98.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 5 6 1 5 5 1 5 5 6 6 2 5 6 1 4 5 4 5 2 5 6 2 5 6 5 6 2 5 6 2 5 6 6 7 1 7 5 1 6 7 7 7 1 7 7 1 7 6 6 7 1 5 6 1 5 7 6 7 1 3 7 2 7 7 6 6 1 6 6 1 5 6 5 4 1 7 7 1 4 7 5 6 1 6 7 1 6 7 4 6 1 5 6 1 4 5 6 7 1 3 6 1 6 6 6 6 1 7 7 1 7 7 5 6 2 5 6 3 6 6 3 4 1 7 7 1 4 7 7 7 1 7 7 1 6 7 3 7 1 7 7 1 6 7 5 6 2 6 7 2 6 6 3 3 1 5 5 1 4 4 5 7 1 7 7 NA 5 7 2 5 1 4 5 1 2 6 6 7 1 7 6 1 6 7 3 6 1 7 7 2 5 7 6 5 1 7 6 1 6 5 6 5 1 7 6 1 6 5 5 6 1 3 6 1 5 7 5 5 1 7 6 1 5 6 7 6 1 5 6 1 5 6 6 6 1 7 6 1 6 6 5 5 1 5 5 1 6 6 5 4 4 5 3 6 5 1 4 5 3 4 3 3 4 5 4 4 1 5 5 1 6 7 6 6 2 6 6 2 5 5 5 6 1 7 7 1 5 7 5 7 1 5 7 1 5 5 7 7 1 7 7 1 7 7 5 7 1 7 6 1 5 6 5 7 1 6 7 1 5 7 6 5 1 6 7 1 7 6 5 6 2 7 6 2 5 6 6 6 1 7 6 2 7 5 7 3 1 6 5 1 6 6 5 6 4 6 6 4 3 6 5 5 1 4 6 2 4 5 5 4 3 7 7 3 6 7 6 6 2 5 6 2 5 6 2 6 3 6 7 2 4 7 4 6 2 5 6 2 4 5 4 5 1 3 5 1 6 5 6 6 2 7 7 1 5 7 3 5 1 6 4 1 4 3 6 7 1 6 7 1 6 6 6 6 1 5 5 2 5 6 5 6 1 5 6 1 5 5 6 7 1 7 7 1 6 6 1 4 1 7 7 1 6 6 5 3 2 7 7 1 6 7 7 4 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time16 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Q1_2[t] = + 1.40959032447186 + 0.214052726496256Q1_3[t] -0.221309515615679Q1_5[t] + 0.139321285447932Q1_7[t] -0.170063333558011Q1_8[t] + 0.0973404013927267Q1_12[t] + 0.533060442743739Q1_16[t] + 0.000288089514899795Q1_22[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.409590324471860.7439981.89460.0600180.030009
Q1_30.2140527264962560.0801172.67180.0083570.004179
Q1_5-0.2213095156156790.116417-1.9010.0591690.029584
Q1_70.1393212854479320.0734521.89680.059730.029865
Q1_8-0.1700633335580110.114261-1.48840.1386950.069348
Q1_120.09734040139272670.0979460.99380.3218730.160937
Q1_160.5330604427437390.0861516.187500
Q1_220.0002880895148997950.0998060.00290.9977010.49885


Multiple Linear Regression - Regression Statistics
Multiple R0.589668535792311
R-squared0.347708982103448
Adjusted R-squared0.318059390380877
F-TEST (value)11.7272772373036
F-TEST (DF numerator)7
F-TEST (DF denominator)154
p-value6.46072084720117e-12
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.987559040203053
Sum Squared Residuals150.192020114564


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
176.302235684762630.69776431523737
255.08296998996925-0.0829699899692469
364.158536698051821.84146330194818
444.57517290520693-0.575172905206927
554.789225631703180.210774368296816
666.1093019091349-0.109301909134906
776.301947595247730.698052404752275
865.127535561937290.872464438062708
965.842290944363620.157709055636378
1065.052516031374070.947483968625932
1154.060896177042640.939103822957362
1255.4158012300747-0.415801230074696
1344.3798462136675-0.379846213667498
1465.381665344270270.618334655729733
1566.08818295826637-0.0881829582663672
1655.41962647583965-0.419626475839649
1734.06089617704264-1.06089617704264
1875.769175242018881.23082475798112
1935.76917524201888-2.76917524201888
2055.29154402633684-0.291544026336844
2133.90746327822184-0.90746327822184
2256.13070273930874-1.13070273930874
2321.939238575576900.060761424423105
2468.11940247417162-2.11940247417162
2532.510556943554580.489443056445417
2665.510556943554580.489443056445417
2765.634840264545170.365159735454828
2854.977784590325740.0222154096742560
2952.913194745926142.08680525407386
3076.724897759565740.275102240434261
3166.40226579573163-0.402265795731630
3254.816612306149750.183387693850248
3355.28872397395144-0.288723973951436
3445.18850115875027-1.18850115875027
3542.928258827636221.07174117236378
3666.02206207277889-0.0220620727788895
3754.956896049349480.0431039506505178
3854.302235684762620.697764315237376
3977.40589004331826-0.405890043318256
4055.09679351382721-0.0967935138272135
4154.734520856807280.265479143192721
4266.06786820259905-0.0678682025990474
4355.3550105141873-0.355010514187305
4464.113481628187051.88651837181295
4575.614487803217731.38551219678227
4654.123812603116040.876187396883964
4754.879078834084210.120921165915790
4853.789225631703181.21077436829682
4968.00440171474859-2.00440171474859
5022.25587709944454-0.255877099444545
5145.12333513532087-1.12333513532087
5242.800752557163211.19924744283679
5367.6446652607054-1.64466526070540
5432.629565867056050.370434132943947
5565.180598480876870.819401519123126
5665.912906656411240.0870933435887634
5754.768887152503980.231112847496015
58610.1267289730152-4.12672897301521
5910.691654820418180.30834517958182
6052.454635334338452.54536466566155
6177.1817915471502-0.181791547150197
6243.977496500810840.0225034991891557
6353.763155684799691.23684431520031
6466.34806553811466-0.348065538114661
6543.405890043318260.594109956681744
6665.682916875510530.317083124489466
6766.27647994462676-0.276479944626764
6854.882452697816060.117547302183942
6956.84075990327575-1.84075990327575
7032.957472228379280.0425277716207182
7154.41580123007470.584198769925304
7266.68291687551053-0.682916875510534
7354.950032520946370.0499674790536287
7465.866515643411610.133484356588389
7566.35120899195423-0.351208991954231
7643.997834980010040.00216501998995678
7743.333167111152970.666832888847027
7864.769175242018881.23082475798112
7977.66578421157393-0.665784211573933
8045.47143474977593-1.47143474977593
8154.052227941859170.947772058140831
8265.371523747621550.628476252378449
8366.938950486062-0.938950486061995
8457.09861025070913-2.09861025070913
8531.510845033069481.48915496693052
8676.652462916915360.347537083084645
8765.867185255697470.132814744302533
8844.86661147038852-0.866611470388524
8943.928835006666020.0711649933339847
9055.83215565814372-0.832155658143717
9131.764974815402461.23502518459754
9276.82424666984150.175753330158494
9365.629565867056050.370434132943947
9466.5121987995109-0.512198799510906
9544.23611479927515-0.236114799275146
9654.585288384602910.414711615397093
9765.786929033305240.213070966694757
9853.689518922188341.31048107781166
9965.912679572470850.0873204275291543
10067.37181183713645-1.37181183713645
10144.12667129339259-0.126671293392593
10254.108233347950670.891766652049334
10366.58557647411781-0.585576474117807
10455.00823854892092-0.00823854892092293
10555.9816098360907-0.981609836090697
10644.74494814925004-0.744948149250038
10742.765740372712531.23425962728747
10866.88427182841883-0.884271828418827
10954.585576474117810.414423525882193
11067.30223568476262-1.30223568476262
11154.652462916915360.347537083084645
11266.038980597031-0.0389805970310015
11355.2121757960212-0.212175796021199
11443.769175242018880.230824757981116
11566.02905688963615-0.0290568896361497
11642.61791934657221.38208065342780
11755.19824725049979-0.198247250499793
11854.030847509265330.969152490734675
11966.87995180677858-0.879951806778578
12033.71449419065486-0.71449419065486
12154.691597140795560.308402859204443
12242.320301289095761.67969871090424
12354.302235684762620.697764315237376
12455.57860777451328-0.578607774513283
12575.340781699511471.65921830048853
12654.273563574727580.726436425272415
12776.908039457251640.0919605427483604
12854.585576474117810.414423525882193
12943.960124232295440.0398757677045588
13067.07749129984059-1.07749129984059
13143.479803880192580.520196119807415
13244.6683999713198-0.668399971319801
13343.289465807729630.710534192270373
13443.280305190391720.719694809608282
13565.545557539597880.454442460402119
13667.56697010771707-1.56697010771707
13754.629565867056050.370434132943947
13833.29154402633684-0.291544026336844
13966.59285938048997-0.592859380489967
14055.11156950602239-0.111569506022393
14145.73369769340686-1.73369769340686
14255.23220246217362-0.232202462173619
14320.8798942766939281.12010572330607
14455.83817521536291-0.838175215362912
14578.24985123179654-1.24985123179654
14643.429741955235630.570258044764371
14743.222579364932080.777420635067921
14877.15167316964871-0.151673169648707
14965.840759903275750.159240096724248
15055.72719435796368-0.727194357963679
15154.427733446352590.572266553647411
15255.30223568476262-0.302235684762623
15376.799629200614060.200370799385937
15466.0012698493164-0.00126984931639935
15569.46160735989486-3.46160735989486
15654.688988834373780.31101116562622
15721.824246669841510.175753330158494
15844.44596709915498-0.445967099154975
15965.1218040942330.878195905767004
16054.698853929914980.301146070085020
16155.94422488355112-0.944224883551115
16254.966891965212310.0331080347876898
1634NANA
1644NANA


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
110.03964787849043190.07929575698086370.960352121509568
120.09629101069055590.1925820213811120.903708989309444
130.3114657847002620.6229315694005250.688534215299738
140.2006153153317950.4012306306635890.799384684668205
150.1320270954283620.2640541908567240.867972904571638
160.08967749613844430.1793549922768890.910322503861556
170.1208002831477690.2416005662955390.87919971685223
180.08135411844641320.1627082368928260.918645881553587
190.827155547647750.3456889047044990.172844452352249
200.7761014747174160.4477970505651670.223898525282584
210.730469019701770.539061960596460.26953098029823
220.7207220808050130.5585558383899730.279277919194987
230.6517335699126690.6965328601746620.348266430087331
240.6387256098831420.7225487802337160.361274390116858
250.5958641427675840.8082717144648320.404135857232416
260.5405854991378580.9188290017242850.459414500862142
270.4708768344641280.9417536689282570.529123165535872
280.4071314332091090.8142628664182170.592868566790891
290.603088502627330.7938229947453390.396911497372669
300.5397450741169580.9205098517660840.460254925883042
310.5042307674354020.9915384651291960.495769232564598
320.5123067842484840.9753864315030320.487693215751516
330.465021891548610.930043783097220.53497810845139
340.4389654100440330.8779308200880650.561034589955967
350.4053178942520580.8106357885041160.594682105747942
360.3493770982800120.6987541965600230.650622901719988
370.3337918017704530.6675836035409060.666208198229547
380.2936096839307720.5872193678615440.706390316069228
390.2587526551355720.5175053102711430.741247344864428
400.2142309302197940.4284618604395880.785769069780206
410.1754297625408150.3508595250816310.824570237459185
420.1417576747985270.2835153495970550.858242325201472
430.1124434311144080.2248868622288170.887556568885592
440.2326919073827140.4653838147654280.767308092617286
450.2514708313860390.5029416627720790.74852916861396
460.3093836706724730.6187673413449470.690616329327527
470.2675104615043910.5350209230087810.73248953849561
480.2648868167217330.5297736334434650.735113183278267
490.5427387971186940.9145224057626120.457261202881306
500.5019673965850430.9960652068299140.498032603414957
510.5633403117857770.8733193764284450.436659688214223
520.5574590930779880.8850818138440240.442540906922012
530.6492620633312030.7014758733375940.350737936668797
540.6054416431280890.7891167137438220.394558356871911
550.6142171921673060.7715656156653890.385782807832694
560.5661241425098790.8677517149802410.433875857490121
570.5185808666400260.9628382667199470.481419133359973
580.9691839590891820.06163208182163570.0308160409108179
590.9615945379081430.07681092418371360.0384054620918568
600.9930355494290390.01392890114192210.00696445057096103
610.990935243041240.01812951391752140.00906475695876071
620.9876728453332940.02465430933341160.0123271546667058
630.9898738484882570.02025230302348590.0101261515117430
640.9868598011158510.02628039776829790.0131401988841490
650.9840387456917620.03192250861647660.0159612543082383
660.9793238015566370.04135239688672660.0206761984433633
670.9734552355284150.05308952894316910.0265447644715846
680.9654813311161720.06903733776765520.0345186688838276
690.9803665022868580.03926699542628480.0196334977131424
700.974068385796740.05186322840651990.0259316142032599
710.9688366549280820.06232669014383630.0311633450719182
720.9633592584386160.07328148312276730.0366407415613836
730.9536967018738980.09260659625220450.0463032981261023
740.9416512900135170.1166974199729660.058348709986483
750.9284326563597520.1431346872804960.0715673436402482
760.911032630219820.1779347395603610.0889673697801805
770.9021630129194370.1956739741611250.0978369870805625
780.9124247424647160.1751505150705670.0875752575352835
790.9020590405254850.1958819189490310.0979409594745153
800.9276199676808020.1447600646383950.0723800323191975
810.9262814060152070.1474371879695860.0737185939847931
820.9158944274454660.1682111451090680.0841055725545342
830.9138085335321130.1723829329357740.0861914664678869
840.9645874496479720.07082510070405640.0354125503520282
850.9750835131190370.0498329737619270.0249164868809635
860.9688987239394960.06220255212100820.0311012760605041
870.959603584754410.08079283049117970.0403964152455899
880.9571300333677550.08573993326448960.0428699666322448
890.945161171734850.1096776565302990.0548388282651495
900.945487927725210.1090241445495780.0545120722747892
910.9519554463685760.0960891072628480.048044553631424
920.939431412805020.1211371743899610.0605685871949807
930.9279359812676320.1441280374647370.0720640187323684
940.9152281558433950.1695436883132090.0847718441566046
950.895490752968010.2090184940639790.104509247031989
960.8764646485930790.2470707028138430.123535351406921
970.8504411104601290.2991177790797430.149558889539871
980.8690157445546980.2619685108906040.130984255445302
990.8414885622623860.3170228754752280.158511437737614
1000.8618755660750430.2762488678499140.138124433924957
1010.8333754281504050.333249143699190.166624571849595
1020.8290923343849260.3418153312301480.170907665615074
1030.8058627243260390.3882745513479230.194137275673961
1040.770040845896730.459918308206540.22995915410327
1050.7827094734856190.4345810530287620.217290526514381
1060.7760436992435480.4479126015129040.223956300756452
1070.8060901769729250.3878196460541490.193909823027075
1080.7875843994596350.424831201080730.212415600540365
1090.7569781747830880.4860436504338250.243021825216912
1100.772047173441460.4559056531170810.227952826558540
1110.7400821541680360.5198356916639270.259917845831964
1120.7022540883687390.5954918232625220.297745911631261
1130.6621048736271860.6757902527456280.337895126372814
1140.6217774929165270.7564450141669460.378222507083473
1150.5747124725466410.8505750549067180.425287527453359
1160.680980695694350.6380386086113010.319019304305651
1170.6346509159558120.7306981680883770.365349084044188
1180.6157637302825970.7684725394348060.384236269717403
1190.5782164002960090.8435671994079830.421783599703991
1200.548897624654040.9022047506919190.451102375345960
1210.4978984681211060.9957969362422120.502101531878894
1220.5395967842089660.9208064315820690.460403215791034
1230.5239267467302950.952146506539410.476073253269705
1240.476704761945340.953409523890680.52329523805466
1250.651815744026860.6963685119462810.348184255973141
1260.6269516131769190.7460967736461620.373048386823081
1270.5784737939574250.843052412085150.421526206042575
1280.5392797581090490.9214404837819020.460720241890951
1290.4855566895025070.9711133790050130.514443310497493
1300.4632187235744110.9264374471488220.536781276425589
1310.4094389958367410.8188779916734820.590561004163259
1320.3537084406603840.7074168813207680.646291559339616
1330.3605705098756930.7211410197513870.639429490124306
1340.3185785589931680.6371571179863370.681421441006832
1350.2982587001857220.5965174003714440.701741299814278
1360.357824817665810.715649635331620.64217518233419
1370.3448027021260510.6896054042521030.655197297873949
1380.2814020895533810.5628041791067610.71859791044662
1390.2254659421110320.4509318842220630.774534057888968
1400.1998726654757250.399745330951450.800127334524275
1410.2331175385747130.4662350771494250.766882461425287
1420.1839403016239750.3678806032479510.816059698376025
1430.1721491539619650.3442983079239290.827850846038035
1440.1787074684877890.3574149369755780.821292531512211
1450.1378933159510690.2757866319021390.86210668404893
1460.1198408729954350.239681745990870.880159127004565
1470.09220402526067870.1844080505213570.907795974739321
1480.05626605615473630.1125321123094730.943733943845264
1490.03358637493269290.06717274986538580.966413625067307
1500.01683667750939650.03367335501879300.983163322490604
1510.1204748036126560.2409496072253120.879525196387344
1520.5585513161570830.8828973676858340.441448683842917
1530.4336426259487520.8672852518975050.566357374051248


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level100.06993006993007NOK
10% type I error level250.174825174825175NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290538406q1w1e77gq345j98/102nea1290538063.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290538406q1w1e77gq345j98/102nea1290538063.ps (open in new window)


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


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


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


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290538406q1w1e77gq345j98/92nea1290538063.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290538406q1w1e77gq345j98/92nea1290538063.ps (open in new window)


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





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by