Home » date » 2010 » Nov » 23 »

WS7 - Minitutorail blog 4 linear trend

*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 19:49:15 +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/t1290541716awssfspfemeegzc.htm/, Retrieved Tue, 23 Nov 2010 20:48:36 +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/t1290541716awssfspfemeegzc.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 «
12 6 15 4 7 2 2 2 2 11 6 15 3 5 4 1 2 2 14 13 14 5 7 7 4 3 4 12 8 10 3 3 3 1 2 3 21 7 10 6 7 7 5 4 4 12 9 12 5 7 2 1 2 3 22 5 18 6 7 7 1 2 3 11 8 12 6 1 2 1 3 4 10 9 14 5 4 1 1 2 3 13 11 18 5 5 2 1 2 4 10 8 9 3 6 6 2 3 3 8 11 11 5 4 1 1 2 2 15 12 11 7 7 1 3 3 3 10 8 17 5 6 1 1 1 3 14 7 8 5 2 2 1 3 3 14 9 16 3 2 2 1 1 2 11 12 21 5 6 2 1 3 3 10 20 24 6 7 1 1 2 2 13 7 21 5 5 7 2 3 4 7 8 14 2 2 1 4 4 5 12 8 7 5 7 2 1 3 3 14 16 18 4 4 4 2 3 3 11 10 18 6 5 2 1 1 1 9 6 13 3 5 1 2 2 4 11 8 11 5 5 1 3 1 3 15 9 13 4 3 5 1 3 4 13 9 13 5 5 2 1 3 3 9 11 18 2 1 1 1 2 3 15 12 14 2 1 3 1 2 1 10 8 12 5 3 1 1 3 4 11 7 9 2 2 2 2 2 4 13 8 12 2 3 5 1 2 2 8 9 8 2 2 2 1 2 2 20 4 5 5 5 6 1 1 1 12 8 10 5 2 4 1 2 3 10 8 11 1 3 1 1 3 4 10 8 11 5 4 3 1 1 1 9 6 12 2 6 6 1 2 3 14 8 12 6 2 7 2 3 3 8 4 15 1 7 4 1 2 2 14 7 12 4 6 1 2 1 4 11 14 16 3 5 5 1 1 3 13 10 14 2 3 3 1 3 3 11 9 17 5 3 2 2 3 2 11 8 10 3 4 2 1 3 3 10 11 17 4 5 2 1 3 2 14 8 12 3 2 2 1 2 1 18 8 13 6 7 1 1 3 3 14 10 13 4 6 2 1 etc...
 
Output produced by software:

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


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time26 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
Depression[t] = + 7.13203448823286 + 0.0467973554484997CriticParents[t] -0.0610624420846635ExpecParents[t] + 0.586113320938374FutureWorrying[t] + 0.214967677788581SleepDepri[t] + 0.335209949039189ChangesLastYear[t] -0.0864177319112125FreqSmoking[t] + 0.284315482532366FreqHighAlc[t] + 0.192320018536851`FreqBeerOrWine `[t] + 0.00645640371582369t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)7.132034488232861.4863884.79824e-062e-06
CriticParents0.04679735544849970.1158670.40390.6869340.343467
ExpecParents-0.06106244208466350.086747-0.70390.48270.24135
FutureWorrying0.5861133209383740.1682183.48430.0006660.000333
SleepDepri0.2149676777885810.1417181.51690.1316380.065819
ChangesLastYear0.3352099490391890.1364352.45690.0152820.007641
FreqSmoking-0.08641773191121250.275507-0.31370.7542580.377129
FreqHighAlc0.2843154825323660.3151020.90230.3685070.184253
`FreqBeerOrWine `0.1923200185368510.2949250.65210.5154470.257723
t0.006456403715823690.0062551.03210.303860.15193


Multiple Linear Regression - Regression Statistics
Multiple R0.460266065223322
R-squared0.211844850796159
Adjusted R-squared0.15930117418257
F-TEST (value)4.03178582941739
F-TEST (DF numerator)9
F-TEST (DF denominator)135
p-value0.000136292636910840
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.89896684527411
Sum Squared Residuals1134.5411839498


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11211.80342085803770.196579141962334
21111.5506662152276-0.550666215227555
31414.9632607176114-0.96326071761145
41211.38966065790000.61033934209998
52115.72365023225035.27634976774972
61213.0241333406027-1.02413334060272
72214.73918873615097.26081126384911
81112.7631915478620-1.76319154786198
91011.9412646851759-1.94126468517594
101312.53956367681470.460436323185273
111013.3443485570999-3.34434855709992
12812.0450959149375-4.04509591493755
131514.21927938659120.780720613408847
141011.8891818950974-1.88918189509736
151412.44237312507631.55762687492375
161410.12074707753343.87925292246656
171112.7553316738041-1.75533167380410
181012.9422151434725-2.94221514347248
191314.1012420580262-1.10124205802625
20710.471230258614-3.47123025861401
211213.6638097338473-1.66380973384726
221412.72594393008281.27405606991716
231112.3015373524674-1.30153735246739
24911.1074244391899-2.10742443918993
251111.9387738468684-0.938773846868396
261513.12848028892861.87151971107138
271312.95303550350560.0469644964944373
2899.51003830215407-0.510038302154067
291510.09332169066174.90667830933828
301012.4138445152097-2.4138445152097
311110.54785998372290.45214001627708
321311.34030163637691.65969836362309
33810.4172076389737-2.41720763897374
342013.64031188296956.35968811703054
351212.8822780862179-0.882278086217913
361010.1691920958358-0.169192095835807
371012.2598983384968-2.2598983384968
38912.4578783487166-3.45787834871664
391414.5756197355890-0.575619735588976
40810.9601235592323-2.96012355923227
411411.84180861608672.15819138391332
421112.3654532504075-1.36545325040751
431311.18900750696951.81099249303052
441112.1098714923107-1.10987149231069
451111.8184464215306-0.818446421530552
461012.1466187771893-2.14661877718933
471410.61034346960963.38965653039036
481813.72266135356574.27733864643429
491412.48641261502001.51358738497998
501112.9670372099912-1.96703720999121
511211.42467197665470.575328023345259
521313.0819133275888-0.0819133275888192
53913.6882139190418-4.68821391904182
541012.2390407889505-2.23904078895049
551513.48396686251291.51603313748708
562014.10977298932395.89022701067606
571211.67259218797850.327407812021524
581211.98456716118270.0154328388173484
591411.33682045862362.66317954137641
601314.9342063362509-1.93420633625086
611114.3339567919935-3.33395679199350
621713.17680126883173.82319873116826
631212.2082127195663-0.208212719566292
641312.82675652181830.173243478181712
651413.79527892899430.204721071005673
661310.72833956191452.27166043808553
671513.79540296741431.20459703258573
681311.91093876127431.08906123872567
691013.5677501317880-3.56775013178802
701111.273139121698-0.273139121697992
711312.73146207152710.268537928472890
721714.13970362258242.86029637741759
731312.86703980502450.132960194975543
74912.0549466343081-3.05494663430812
751112.3397040899440-1.33970408994403
761010.2967752046680-0.296775204668031
77910.3058972499947-1.30589724999465
781211.28414010057940.715859899420595
791212.4348775095511-0.434877509551113
801312.36373365488880.636266345111186
811312.42349915265850.57650084734154
822214.5122209413717.48777905862899
831311.92059074689171.07940925310831
841513.73902956263601.26097043736396
851314.1015011530776-1.10150115307764
861511.59464026493983.40535973506017
871011.6874586748402-1.68745867484024
881110.87505422434800.124945775652039
891614.18379103550971.81620896449035
901112.0425833932396-1.04258339323962
911112.4255241935236-1.42552419352357
921012.7072587998349-2.70725879983489
931014.5620910104904-4.56209101049043
941614.22557233822781.77442766177225
951213.3892112914856-1.38921129148557
961113.9185426575266-2.91854265752657
971614.42105254688731.57894745311269
981914.99043906112844.00956093887163
991114.8959736676309-3.89597366763086
1001512.76725969315232.23274030684774
1012416.5715897228437.428410277157
1021411.69535268895162.30464731104837
1031513.65267762752261.34732237247740
1041114.9179142605919-3.91791426059188
1051513.56189884228761.43810115771242
1061212.9351808535059-0.935180853505916
1071010.8477922441472-0.847792244147166
1081413.99715019775740.00284980224257205
109912.9089923937108-3.90899239371078
1101510.72016026937274.27983973062725
111159.798779470067565.20122052993244
1121413.16685674001400.833143259986041
1131114.2205243292760-3.22052432927598
114814.4197763322497-6.4197763322497
1151114.3117863018382-3.31178630183823
116811.8963645932459-3.89636459324589
1171011.3260138183465-1.32601381834645
1181113.7110640088442-2.71106400884425
1191314.1597410318982-1.15974103189823
1201113.8537558806655-2.85375588066549
1212012.77456494930197.22543505069813
1221012.2969965736639-2.29699657366387
1231211.07014181803470.92985818196535
1241412.67620412352991.32379587647015
1252314.12507903314628.87492096685384
1261413.13856351477550.861436485224494
1271615.34592352574930.654076474250725
1281113.5617021817485-2.56170218174851
1291214.3748513742172-2.37485137421721
1301013.7930867095764-3.7930867095764
1311413.91653520628060.0834647937194315
132129.995515261519932.00448473848007
1331213.8351566065299-1.83515660652989
1341110.36736154871870.632638451281277
1351212.5532725501845-0.553272550184466
1361315.9200443612809-2.92004436128085
1371716.46283986748480.537160132515228
1381112.6683474667565-1.66834746675647
1391213.8583047626368-1.85830476263683
1401915.28699935574983.71300064425025
1411514.1070445744380.892955425562008
1421413.64697302670660.353026973293381
1431113.8724741017398-2.87247410173984
144910.7776270678648-1.77762706786479
1451812.01351431574585.98648568425415


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
130.4026711232189510.8053422464379020.597328876781049
140.5332704125558930.9334591748882140.466729587444107
150.5165800810898850.966839837820230.483419918910115
160.6404987390517910.7190025218964190.359501260948209
170.5310504588213960.9378990823572080.468949541178604
180.4410049275570380.8820098551140770.558995072442962
190.5811905208507980.8376189582984040.418809479149202
200.5048901254418240.9902197491163520.495109874558176
210.4278087889190800.8556175778381590.57219121108092
220.4568375649485350.913675129897070.543162435051465
230.5119951528167620.9760096943664750.488004847183238
240.433696302941480.867392605882960.56630369705852
250.3643355472401320.7286710944802640.635664452759868
260.3290588618824570.6581177237649140.670941138117543
270.2732750189162580.5465500378325160.726724981083742
280.2308240724394640.4616481448789280.769175927560536
290.2834638634537060.5669277269074130.716536136546294
300.2411616833911620.4823233667823240.758838316608838
310.1952455178076720.3904910356153430.804754482192328
320.1575383636782780.3150767273565560.842461636321722
330.154603192231780.309206384463560.84539680776822
340.1703201486742680.3406402973485360.829679851325732
350.1776787876137730.3553575752275450.822321212386227
360.175415087272670.350830174545340.82458491272733
370.2248133299823370.4496266599646750.775186670017663
380.2695321936375790.5390643872751580.730467806362421
390.2746899529964560.5493799059929120.725310047003544
400.2483981759489420.4967963518978840.751601824051058
410.2906285520232770.5812571040465540.709371447976723
420.2539804275322610.5079608550645210.746019572467739
430.2637394519110750.5274789038221490.736260548088925
440.2217730674419020.4435461348838050.778226932558098
450.1865221372170620.3730442744341230.813477862782938
460.1621517071849110.3243034143698220.837848292815089
470.1724106396050710.3448212792101420.827589360394929
480.2732534165099890.5465068330199770.726746583490012
490.2479989523981390.4959979047962780.752001047601861
500.2230800478410070.4461600956820150.776919952158993
510.1871938337720470.3743876675440950.812806166227953
520.1528866009114360.3057732018228730.847113399088564
530.2277371372285140.4554742744570270.772262862771486
540.2200554613298510.4401109226597030.779944538670149
550.2014438432736140.4028876865472290.798556156726386
560.2887933528729190.5775867057458390.71120664712708
570.2475826841808140.4951653683616270.752417315819186
580.2129541254089140.4259082508178270.787045874591086
590.1943571584587520.3887143169175040.805642841541248
600.2169199367875270.4338398735750530.783080063212473
610.2698973974896150.5397947949792310.730102602510385
620.3051640250028020.6103280500056040.694835974997198
630.2624812440654220.5249624881308440.737518755934578
640.2226937430556600.4453874861113210.77730625694434
650.1872335173754580.3744670347509150.812766482624542
660.1724856308925240.3449712617850470.827514369107476
670.1461263618145260.2922527236290510.853873638185474
680.1219953105665220.2439906211330430.878004689433478
690.1339849897832590.2679699795665180.866015010216741
700.1087050523077320.2174101046154640.891294947692268
710.08699157300803430.1739831460160690.913008426991966
720.08924236619813330.1784847323962670.910757633801867
730.07087559098122440.1417511819624490.929124409018776
740.07245922390961610.1449184478192320.927540776090384
750.05987881659380480.1197576331876100.940121183406195
760.04776084726059660.09552169452119330.952239152739403
770.04187450391593610.08374900783187220.958125496084064
780.03201875002304070.06403750004608130.96798124997696
790.02441823958340170.04883647916680330.975581760416598
800.01840518543459440.03681037086918870.981594814565406
810.01390458254445710.02780916508891430.986095417455543
820.06599974399749440.1319994879949890.934000256002506
830.05181384326059530.1036276865211910.948186156739405
840.0403217447356270.0806434894712540.959678255264373
850.03281519434627750.0656303886925550.967184805653723
860.03342417164370870.06684834328741750.966575828356291
870.0285705105235370.0571410210470740.971429489476463
880.02118538549789900.04237077099579790.978814614502101
890.01848966772687070.03697933545374130.98151033227313
900.01444004529735480.02888009059470970.985559954702645
910.01168603573373790.02337207146747580.988313964266262
920.01156854594397980.02313709188795960.98843145405602
930.01761450948505880.03522901897011770.982385490514941
940.01375999981011450.02751999962022910.986240000189885
950.01083373486414210.02166746972828410.989166265135858
960.01182017335113980.02364034670227960.98817982664886
970.0099751705526960.0199503411053920.990024829447304
980.01518251243933210.03036502487866420.984817487560668
990.01782035242236890.03564070484473780.982179647577631
1000.01414808596132250.02829617192264510.985851914038677
1010.06901551423569180.1380310284713840.930984485764308
1020.06206004355454980.1241200871091000.93793995644545
1030.05165274700955280.1033054940191060.948347252990447
1040.05308531693113830.1061706338622770.946914683068862
1050.04453326682593050.0890665336518610.95546673317407
1060.03336501392685540.06673002785371070.966634986073145
1070.02633834728610930.05267669457221850.97366165271389
1080.01909600040531300.03819200081062590.980903999594687
1090.01789819135465070.03579638270930130.98210180864535
1100.02701688948721600.05403377897443190.972983110512784
1110.04154555910315220.08309111820630450.958454440896848
1120.03414268028844130.06828536057688270.965857319711559
1130.03020782380311100.06041564760622190.96979217619689
1140.05397846271964320.1079569254392860.946021537280357
1150.05063609801426870.1012721960285370.949363901985731
1160.0760849190979170.1521698381958340.923915080902083
1170.05807168366097680.1161433673219540.941928316339023
1180.05057874282013640.1011574856402730.949421257179864
1190.03804938845229730.07609877690459470.961950611547703
1200.0787779406595040.1575558813190080.921222059340496
1210.1810570996912350.3621141993824690.818942900308765
1220.3791880545104140.7583761090208280.620811945489586
1230.3309952244982950.661990448996590.669004775501705
1240.2583648799876580.5167297599753150.741635120012342
1250.5027265856563520.9945468286872960.497273414343648
1260.8282096722956130.3435806554087740.171790327704387
1270.7873202591799680.4253594816400640.212679740820032
1280.7046223460026890.5907553079946220.295377653997311
1290.6343596882807210.7312806234385570.365640311719279
1300.5922488779608820.8155022440782360.407751122039118
1310.5692485708965680.8615028582068640.430751429103432
1320.4666227274758530.9332454549517060.533377272524147


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level180.15NOK
10% type I error level330.275NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/10ds1h1290541725.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/10ds1h1290541725.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/26q451290541725.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/26q451290541725.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/36q451290541725.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/36q451290541725.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/46q451290541725.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/46q451290541725.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/82ikw1290541725.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541716awssfspfemeegzc/82ikw1290541725.ps (open in new window)


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


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





Copyright

Creative Commons License

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

Software written by Ed van Stee & Patrick Wessa


Disclaimer

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


Privacy Policy

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

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

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

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

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

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

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

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

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


FreeStatistics.org is powered by