Home » date » 2010 » Dec » 02 »

workshop 7

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 02 Dec 2010 21:18:09 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25.htm/, Retrieved Thu, 02 Dec 2010 22:17:03 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
4 4 1 4 2 4 2 1 4 2 4 3 2 5 2 4 2 1 3 2 4 2 2 4 2 5 2 1 3 2 4 1 3 4 3 3 1 1 3 3 4 1 1 2 4 4 2 1 4 2 4 2 2 2 3 4 2 4 2 4 4 2 2 2 2 2 2 1 1 3 3 1 1 4 2 4 3 3 4 1 3 2 2 2 2 2 2 2 2 2 4 2 3 3 2 3 2 3 3 2 3 3 1 3 4 4 4 2 4 4 3 2 2 3 3 3 2 2 2 4 4 2 2 2 3 4 1 3 4 2 4 2 2 4 3 4 2 2 3 2 4 2 2 4 2 4 2 2 2 2 5 4 2 4 3 4 2 3 4 4 4 4 2 5 4 4 3 2 5 2 3 1 2 4 2 4 4 2 4 4 3 3 2 4 2 4 2 1 2 3 4 4 2 4 4 3 2 1 4 4 5 3 2 4 5 4 3 2 3 3 3 2 2 2 2 3 1 2 3 2 3 2 2 4 2 4 1 3 3 3 4 2 2 2 3 4 4 2 4 4 4 2 2 4 2 4 2 4 3 4 4 2 1 4 4 4 2 2 3 2 5 2 2 4 2 3 1 1 2 1 3 2 5 4 2 5 3 2 4 3 5 2 2 4 2 4 2 2 4 2 4 1 1 3 2 3 1 2 1 4 4 2 2 3 3 4 2 2 3 2 5 1 2 4 2 4 2 2 2 4 4 1 1 3 2 5 4 1 5 2 4 4 2 4 3 3 1 2 4 2 4 1 1 3 2 4 3 2 4 2 4 4 2 2 2 4 2 1 3 2 4 4 3 4 2 4 4 3 3 4 4 3 3 4 2 3 4 2 4 2 4 2 2 3 4 3 2 2 3 3 5 2 1 2 2 4 2 4 4 2 5 2 3 3 3 5 2 2 2 1 4 2 2 2 4 4 1 2 3 2 4 3 1 2 4 4 3 2 2 3 4 2 3 4 3 5 4 1 4 4 4 4 2 4 4 3 2 2 2 2 4 2 2 2 4 3 1 1 4 1 4 1 1 2 3 4 etc...
 
Output produced by software:

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


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24
R Framework
error message
The field 'Names of X columns' contains a hard return which cannot be interpreted.
Please, resubmit your request without hard returns in the 'Names of X columns'.


Multiple Linear Regression - Estimated Regression Equation
right [t] = + 3.08781260356635 -0.175565703273633neat[t] + 0.170884076111847failure[t] + 0.0577259776688666performance[t] -0.036240515598931goals[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.087812603566350.3911437.894300
neat-0.1755657032736330.084998-2.06550.0405490.020275
failure0.1708840761118470.0847342.01670.0454630.022731
performance0.05772597766886660.077860.74140.4595750.229788
goals-0.0362405155989310.085975-0.42150.6739590.336979


Multiple Linear Regression - Regression Statistics
Multiple R0.250034454595201
R-squared0.0625172284847196
Adjusted R-squared0.0381670266271799
F-TEST (value)2.56742136473755
F-TEST (DF numerator)4
F-TEST (DF denominator)154
p-value0.040330704676335
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.95802062625422
Sum Squared Residuals141.341742130593


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
122.98185001019235-0.981850010192352
222.64008185796866-0.640081857968656
322.83245139615044-0.83245139615044
422.67632237356759-0.676322373567588
522.69780783563752-0.697807835637523
622.50075667029395-0.500756670293955
732.584649737194540.415350262805458
832.681004000729370.318995999270627
942.541678813054671.45832118694533
1022.64008185796866-0.640081857968656
1132.770288866835390.229711133164615
1242.885740822173121.11425917782688
1322.77028886683539-0.770288866835385
1433.09993481131272-0.0999348113127153
1522.64476348513044-0.644763485130442
1612.92641788941824-1.92641788941824
1722.94585457010902-0.945854570109018
1823.12142027338265-1.12142027338265
1922.79177432890532-0.79177432890532
2022.96734003217895-0.967340032178953
2143.022772152953070.977227847046932
2243.039575987861220.960424012138782
2332.909614054510090.0903859454899132
2442.945854570109021.05414542989098
2532.770288866835390.229711133164615
2622.58464973719454-0.584649737194542
2732.697807835637520.302192164362477
2822.73404835123645-0.734048351236454
2922.69780783563752-0.697807835637523
3022.77028886683539-0.770288866835385
3132.864010284587580.135989715412415
3242.755533813306391.24446618669361
3343.003335472262290.996664527737713
3422.83245139615044-0.83245139615044
3522.70248946279931-0.702489462799308
3643.039575987861220.960424012138782
3723.04425761502300-1.04425761502300
3832.712562889166520.287437110833481
3943.039575987861220.960424012138782
4042.815647561242291.18435243875771
4152.693126208475742.30687379152426
4232.90493242734830.0950675726516984
4322.94585457010902-0.945854570109018
4422.73872997839824-0.73872997839824
4522.87337353891116-0.873373538911156
4632.620890252793470.379109747206527
4732.770288866835390.229711133164615
4843.039575987861220.960424012138782
4922.69780783563752-0.697807835637523
5042.849500306574191.15049969342581
5142.640081857968661.35991814203134
5222.73404835123645-0.734048351236454
5322.52224213236389-0.52224213236389
5412.71724451632830-1.71724451632830
5523.04655147191776-1.04655147191776
5632.693126208475740.306873791524262
5722.52224213236389-0.52224213236389
5822.69780783563752-0.697807835637523
5922.50543829745574-0.50543829745574
6042.81121100959611.18878899040390
6132.734048351236450.265951648763546
6222.73404835123645-0.734048351236454
6322.35135805625204-0.351358056252043
6442.770288866835391.22971113316461
6522.50543829745574-0.50543829745574
6622.77004379131979-0.770043791319787
6733.03957598786122-0.039575987861218
6822.70248946279931-0.702489462799308
6922.50543829745574-0.50543829745574
7022.86869191174937-0.86869191174937
7123.11205701905908-1.11205701905908
7222.67632237356759-0.676322373567588
7323.09730196553008-1.09730196553008
7443.133542481129020.866457518870985
7522.92641788941824-0.926417889418237
7623.21514169113485-1.21514169113485
7742.734048351236451.26595164876355
7832.909614054510090.0903859454899132
7922.53699718589289-0.536997185892886
8022.81325979097526-0.813259790975256
8132.616208625631690.383791374368312
8212.59472316356175-1.59472316356175
8342.770288866835391.22971113316461
8422.56316427512461-0.563164275124607
8542.883446965278371.11655303472163
8632.941172942947230.0588270570527674
8732.755533813306390.244466186693610
8842.806284306918721.19371569308128
8943.039575987861220.960424012138782
9022.94585457010902-0.945854570109018
9142.770288866835391.22971113316461
9212.64476348513044-1.64476348513044
9332.541678813054670.458321186945329
9422.56316427512461-0.563164275124607
9522.73404835123645-0.734048351236454
9622.77701927537633-0.777019275376325
9742.90493242734831.09506757265170
9833.33059364647258-0.330593646472584
9922.85188807684122-0.85188807684122
10023.00358054777788-1.00358054777788
10133.21514169113485-0.215141691134851
10222.90961405451009-0.909614054510087
10323.3715157892333-1.3715157892333
10422.96734003217895-0.967340032178953
10542.522242132363891.47775786763611
10643.441702963536410.55829703646359
10723.02745378011485-1.02745378011485
10823.11673864622087-1.11673864622087
10942.967340032178951.03265996782105
11043.048939242184790.951060757815211
11142.950536197270801.04946380272920
11232.734048351236450.265951648763546
11323.06130652544675-1.06130652544675
11433.47016390966288-0.470163909662884
11543.263039317952110.736960682047895
11623.35471195432515-1.35471195432515
11743.407756304832230.592243695167768
11843.236872228720380.763127771279616
11922.96734003217895-0.967340032178953
12033.05362086934657-0.0536208693465743
12132.817941418137040.182058581862958
12233.26074546105735-0.260745461057353
12343.142905735452590.857094264547414
12443.126101900544440.873898099455564
12543.012698726585860.987301273414142
12633.2923043494945-0.292304349494498
12742.890422449334901.10957755066510
12843.200631713121450.799368286878547
12943.236872228720380.763127771279616
13022.84950030657419-0.849500306574187
13143.215386766650450.784613233349551
13252.945854570109022.05414542989098
13342.993507121410671.00649287858933
13443.220068393812230.779931606187766
13543.085179757783720.91482024221628
13633.33059364647258-0.330593646472584
13713.35471195432515-2.35471195432515
13843.142905735452590.857094264547414
13933.17914625105152-0.179146251051517
14032.967340032178950.0326599678210465
14132.967340032178950.0326599678210465
14213.06130652544675-2.06130652544675
14343.347397481380730.652602518619266
14452.526923759525682.47307624047432
14543.426947910007410.573052089992585
14632.988825494248890.0111745057511110
14743.13822410829080.861775891709199
14833.17914625105152-0.179146251051517
14943.203019483388490.796980516611514
15043.121420273382650.878579726617349
15143.065988152608540.934011847391463
15252.777019275376322.22298072462368
15323.45611902817753-1.45611902817753
15433.15766078898158-0.157660788981582
15533.19595008595967-0.195950085959668
15643.179146251051520.820853748948483
15742.697807835637521.30219216436248
15833.23687222872038-0.236872228720384
15943.039575987861220.960424012138782


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.05118070513599420.1023614102719880.948819294864006
90.1228222588960100.2456445177920200.87717774110399
100.05801795523456560.1160359104691310.941982044765434
110.04091820957202660.08183641914405330.959081790427973
120.01852766432273720.03705532864547440.981472335677263
130.06470220400582190.1294044080116440.935297795994178
140.04153487567827520.08306975135655040.958465124321725
150.02794340735292040.05588681470584070.97205659264708
160.06960905763098770.1392181152619750.930390942369012
170.07399863812296360.1479972762459270.926001361877036
180.05917661291552150.1183532258310430.940823387084478
190.04882438019772980.09764876039545950.95117561980227
200.03387709370521310.06775418741042620.966122906294787
210.1842326556135040.3684653112270090.815767344386496
220.3823435984677590.7646871969355180.617656401532241
230.3322036667392910.6644073334785820.667796333260709
240.3604446758238870.7208893516477740.639555324176113
250.2966668600745010.5933337201490020.703333139925499
260.2428955077107480.4857910154214960.757104492289252
270.2216403831709410.4432807663418810.77835961682906
280.1960957476711220.3921914953422450.803904252328878
290.1596358621756830.3192717243513650.840364137824317
300.1562169380888560.3124338761777120.843783061911144
310.1307940870472220.2615881740944440.869205912952778
320.2116828833954900.4233657667909810.78831711660451
330.2672311741192640.5344623482385280.732768825880736
340.2370597075300970.4741194150601950.762940292469903
350.2006825504241730.4013651008483450.799317449575827
360.2096998568592170.4193997137184340.790300143140783
370.1998838274252120.3997676548504230.800116172574788
380.1638191228684190.3276382457368380.836180877131581
390.1661356483676630.3322712967353250.833864351632338
400.2268892668087700.4537785336175390.77311073319123
410.4355097351168890.8710194702337770.564490264883111
420.3829016043920850.765803208784170.617098395607915
430.3708248374562170.7416496749124330.629175162543783
440.3333455723281250.666691144656250.666654427671875
450.3049167437445190.6098334874890380.695083256255481
460.2742510128345800.5485020256691590.72574898716542
470.2329800918924710.4659601837849420.767019908107529
480.2244296224503180.4488592449006350.775570377549682
490.2030952295126200.4061904590252410.79690477048738
500.2199267262820210.4398534525640410.78007327371798
510.2723079445881870.5446158891763740.727692055411813
520.2586968393105910.5173936786211820.741303160689409
530.2397307610746670.4794615221493350.760269238925333
540.3030996012391610.6061992024783220.696900398760839
550.2898297062422710.5796594124845410.71017029375773
560.2508208239848340.5016416479696680.749179176015166
570.2309056210570660.4618112421141320.769094378942934
580.2106038413694260.4212076827388520.789396158630574
590.1844512195113760.3689024390227530.815548780488624
600.2176150584121580.4352301168243170.782384941587842
610.1858695775535900.3717391551071810.81413042244641
620.1745142285544340.3490284571088680.825485771445566
630.1498328171755860.2996656343511710.850167182824415
640.1608788992542480.3217577985084960.839121100745752
650.1404196768276730.2808393536553460.859580323172327
660.142595569329570.285191138659140.85740443067043
670.1182609941767380.2365219883534760.881739005823262
680.1070853329248240.2141706658496470.892914667075176
690.09369403351982970.1873880670396590.90630596648017
700.09310915707863770.1862183141572750.906890842921362
710.1211331061903480.2422662123806960.878866893809652
720.1134545285586020.2269090571172040.886545471441398
730.1249849813916910.2499699627833810.87501501860831
740.1182754992792390.2365509985584790.88172450072076
750.1190639585392500.2381279170784990.88093604146075
760.1323632750132760.2647265500265520.867636724986724
770.1499617918614240.2999235837228470.850038208138576
780.1278528400949860.2557056801899730.872147159905014
790.1233224272390460.2466448544780930.876677572760953
800.1185768291927440.2371536583854880.881423170807256
810.09780711678629470.1956142335725890.902192883213705
820.1703217637075520.3406435274151040.829678236292448
830.1820497168784330.3640994337568650.817950283121567
840.1726066239748530.3452132479497070.827393376025147
850.1718833127749600.3437666255499190.82811668722504
860.1441733123617430.2883466247234860.855826687638257
870.1237363728476670.2474727456953350.876263627152333
880.1225249599852770.2450499199705550.877475040014723
890.1188611789873330.2377223579746660.881138821012667
900.1193525387095920.2387050774191850.880647461290408
910.1285092040822990.2570184081645970.871490795917701
920.2225352964128630.4450705928257250.777464703587137
930.1934570535504550.3869141071009090.806542946449545
940.1953523901168810.3907047802337620.80464760988312
950.2055935905643410.4111871811286810.79440640943566
960.2298283640307500.4596567280615010.77017163596925
970.2270625357145990.4541250714291970.772937464285401
980.1941475723736970.3882951447473930.805852427626303
990.2206542699570170.4413085399140340.779345730042983
1000.2337921556736850.4675843113473690.766207844326316
1010.2032910413705620.4065820827411240.796708958629438
1020.2375863760011620.4751727520023240.762413623998838
1030.2526213363381590.5052426726763180.747378663661841
1040.2868828445653820.5737656891307640.713117155434618
1050.2849574704260160.5699149408520320.715042529573984
1060.288674539051560.577349078103120.71132546094844
1070.3598469432694060.7196938865388120.640153056730594
1080.4045562399984330.8091124799968660.595443760001567
1090.4113348674445940.8226697348891880.588665132555406
1100.4291029410909190.8582058821818390.570897058909081
1110.4356931230285420.8713862460570850.564306876971458
1120.4113393522465580.8226787044931160.588660647753442
1130.4360784195542790.8721568391085590.563921580445721
1140.3876273032973910.7752546065947820.612372696702609
1150.4183677803722380.8367355607444760.581632219627762
1160.4492663275290990.8985326550581980.550733672470901
1170.4608798045276030.9217596090552050.539120195472397
1180.4727813261043990.9455626522087990.527218673895601
1190.5688994403507540.8622011192984920.431100559649246
1200.5933109598278290.8133780803443420.406689040172171
1210.5879509068661260.8240981862677470.412049093133874
1220.5749744119432410.8500511761135170.425025588056759
1230.5467858839958380.9064282320083240.453214116004162
1240.5151371782320190.9697256435359620.484862821767981
1250.5105790516209950.978841896758010.489420948379005
1260.4640262969357660.9280525938715320.535973703064234
1270.4638869789376760.9277739578753510.536113021062324
1280.4439952452665670.8879904905331350.556004754733433
1290.4707704608224680.9415409216449350.529229539177532
1300.5419302006773110.9161395986453780.458069799322689
1310.5751106616866040.8497786766267920.424889338313396
1320.6985627432736280.6028745134527440.301437256726372
1330.6537275244294970.6925449511410070.346272475570503
1340.7288703861991990.5422592276016030.271129613800801
1350.6773133257257470.6453733485485070.322686674274253
1360.6299028256546150.740194348690770.370097174345385
1370.9185794017023930.1628411965952140.0814205982976071
1380.8893931913170170.2212136173659650.110606808682983
1390.8473766100604050.3052467798791900.152623389939595
1400.8199500339181670.3600999321636670.180049966081833
1410.7930418319867550.413916336026490.206958168013245
1420.980361244752970.03927751049406070.0196387552470303
1430.973685570488330.05262885902333920.0263144295116696
1440.96450000318250.07099999363499930.0354999968174996
1450.9532231628818120.09355367423637510.0467768371181876
1460.983617570840360.03276485831928080.0163824291596404
1470.9761508532654470.04769829346910650.0238491467345532
1480.9647189714426180.0705620571147630.0352810285573815
1490.9491667569983380.1016664860033240.0508332430016619
1500.8979034403635820.2041931192728350.102096559636417
1510.8246552981329120.3506894037341750.175344701867088


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level40.0277777777777778OK
10% type I error level130.0902777777777778OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/10einq1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/10einq1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/17y8e1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/17y8e1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/27y8e1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/27y8e1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/30qpz1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/30qpz1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/40qpz1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/40qpz1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/50qpz1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/50qpz1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/6tz7j1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/6tz7j1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/7tz7j1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/7tz7j1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/83q6m1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/83q6m1291324678.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/93q6m1291324678.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291324623xrr91hw5ln1lw25/93q6m1291324678.ps (open in new window)


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