Home » date » 2010 » Dec » 02 »

Mini tutorial

*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 13:53:30 +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/t1291299973rxf2r96dt0pjved.htm/, Retrieved Thu, 02 Dec 2010 15:26:24 +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/t1291299973rxf2r96dt0pjved.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:
Extra variable Gender
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 13 13 14 13 3 5 1 3 12 12 8 13 5 6 1 3 15 10 12 16 6 4 1 3 12 9 7 12 6 6 2 3 10 10 10 11 5 3 1 3 12 12 7 12 3 10 1 2 15 13 16 18 8 8 2 3 9 12 11 11 4 3 1 3 12 12 14 14 4 4 1 4 11 6 6 9 4 3 1 3 11 5 16 14 6 5 2 3 11 12 11 12 6 5 2 2 15 11 16 11 5 6 1 3 7 14 12 12 4 5 1 3 11 14 7 13 6 3 1 3 11 12 13 11 4 4 2 3 10 12 11 12 6 8 1 3 14 11 15 16 6 8 2 2 10 11 7 9 4 8 2 4 6 7 9 11 4 5 1 3 11 9 7 13 2 8 2 2 15 11 14 15 7 2 1 3 11 11 15 10 5 0 1 3 12 12 7 11 4 5 2 2 14 12 15 13 6 2 1 2 15 11 17 16 6 7 1 4 9 11 15 15 7 5 1 2 13 8 14 14 5 2 1 3 13 9 14 14 6 12 2 2 16 12 8 14 4 7 1 4 13 10 8 8 4 0 2 3 12 10 14 13 7 2 1 2 14 12 14 15 7 3 1 3 11 8 8 13 4 0 2 3 9 12 11 11 4 9 2 1 16 11 16 15 6 2 2 3 12 12 10 15 6 3 1 3 10 7 8 9 5 1 2 3 13 11 14 13 6 10 2 2 16 11 16 16 7 1 1 3 14 12 13 13 6 4 1 15 9 5 11 3 6 1 5 5 15 8 12 3 6 1 4 8 11 10 12 4 4 2 3 11 11 8 12 6 4 2 2 16 11 13 14 7 7 1 2 17 11 15 14 5 7 2 3 9 15 6 8 4 7 2 4 9 11 12 13 5 0 1 2 13 12 16 16 6 3 2 3 10 12 5 13 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 time10 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
NotPopular[t] = + 0.410809067919239 -0.0103714850389617Popularity[t] + 0.54902968172845FindingFriends[t] + 0.434073395267413KnowingPeople[t] -0.606370476015817Liked[t] -0.0301007884568122Celebrity[t] -0.267226482953949WeightedSum[t] + 1.05529571126129Gender[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.4108090679192391.7995780.22830.8197430.409872
Popularity-0.01037148503896170.113987-0.0910.9276250.463812
FindingFriends0.549029681728450.0702417.816400
KnowingPeople0.4340733952674130.0891094.87133e-061e-06
Liked-0.6063704760158170.084094-7.210600
Celebrity-0.03010078845681220.073612-0.40890.6831940.341597
WeightedSum-0.2672264829539490.129772-2.05920.0412270.020614
Gender1.055295711261290.251444.1974.6e-052.3e-05


Multiple Linear Regression - Regression Statistics
Multiple R0.86112661610235
R-squared0.741539048959883
Adjusted R-squared0.729314544518797
F-TEST (value)60.6600498640721
F-TEST (DF numerator)7
F-TEST (DF denominator)148
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.54591980271415
Sum Squared Residuals959.292730994106


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
125.23643790154167-3.23643790154167
231.765911273380301.23408872661970
331.058271785279821.94172821472018
431.316314231747841.68368576825216
533.57116207142968-0.571162071429684
630.9295039992265452.07049600077346
723.15510166203506-1.15510166203506
835.14376710364973-2.14376710364973
934.32853492333369-1.32853492333369
1040.871220018895673.12877998110433
1132.091713078202040.90828692179796
1234.97729482599576-1.97729482599576
1325.87109525070591-3.87109525070591
1435.55581939052826-2.55581939052826
1533.2118473870138-0.211847387013796
1636.77924015241397-3.77924015241397
1733.13069115091159-0.130691150911585
1832.906282917294960.0937170827050397
1923.77997660433584-1.77997660433584
2041.027133393681642.97286660631836
2130.306265428690342.69373457130966
2223.58617091101000-1.58617091101000
2337.68823716933386-4.68823716933386
2433.89720181281658-0.89720181281658
2525.82248721353326-3.82248721353326
2622.97598899448349-0.975988994483487
2743.280793767649340.719206232350662
2822.62639688883201-0.62639688883201
2931.528356663825451.47164333617455
3020.880929162711511.11907083728849
3146.37808820240532-2.37808820240532
3234.28099663643006-1.28099663643006
3323.87834559482346-1.87834559482346
3432.268919428947270.731080571052733
3534.59570391718733-1.59570391718733
3615.52934271622395-4.52934271622395
3732.192895772288540.807104227711458
3833.85841586491028-0.858415864910283
3933.76723946920606-0.76723946920606
4024.10480222344399-2.10480222344399
4134.41988745709054-1.41988745709054
421510.84695737371654.15304262628347
43511.8105951926742-6.81059519267423
44811.0814494029696-3.08144940296955
45117.715353376219733.28464662378027
461610.89920221696455.10079778303549
471713.99807176076043.00192823923962
4898.07254450072110.927455499278898
49911.3395456111980-2.33954561119796
501314.9189094257961-1.91890942579612
51108.74938099291211.25061900708789
52612.3473497635174-6.34734976351738
531213.5728310593809-1.57283105938086
54810.4636129134974-2.46361291349737
551412.47529682041501.52470317958505
561214.4879948202638-2.48799482026381
571111.3519809312834-0.351980931283416
581616.3327476520419-0.332747652041872
59812.5110140410853-4.51101404108533
601513.75863180461211.24136819538793
6179.73111822526854-2.73111822526854
621614.22768675284481.77231324715519
631414.0426493282646-0.0426493282645574
641613.45734972902442.54265027097560
6598.506728076158190.493271923841813
661412.45556751699711.5444324830029
671112.5131830091708-1.51318300917077
68137.822524262381765.17747573761824
691513.17171923519651.82828076480348
7055.02191166050712-0.0219116605071172
711513.34239674363211.65760325636791
721313.6011655936288-0.601165593628824
731110.89716126486940.102838735130649
741114.6746812161648-3.6746812161648
751211.58813681228470.411863187715291
761213.4251884065898-1.42518840658982
771212.8875803782867-0.88758037828675
781211.56216089971890.437839100281086
791411.92656184472662.07343815527338
80610.7390232474991-4.73902324749911
8178.39879394994077-1.39879394994077
821410.68928332764033.31071667235969
831414.5144116944945-0.514411694494536
841011.3318073651319-1.33180736513191
85139.05270313913143.94729686086859
861211.00622642123050.99377357876948
8799.50287288575902-0.502872885759023
881211.42924156404890.570758435951121
891613.29622387509672.70377612490331
901010.8297469926519-0.829746992651864
911412.83722186085241.16277813914763
921011.7928227591210-1.79282275912104
931613.43416735610252.56583264389747
941513.84445711611211.15554288388787
951211.41173824546340.588261754536615
96109.926574795987480.0734252040125248
9788.10538540725177-0.105385407251773
9888.48417499870718-0.484174998707177
991114.1249354486139-3.12493544861391
100139.69584196626313.3041580337369
1011614.08387088824041.91612911175962
1021613.14883114204362.85116885795643
1031416.5524686224786-2.55246862247861
1041111.7649342561260-0.764934256126018
10546.7558325748484-2.7558325748484
1061411.60373793874282.39626206125718
107912.5608912871929-3.56089128719295
1081414.0860598644796-0.0860598644796395
109813.7684571949471-5.76845719494714
110812.0530499647827-4.05304996478271
1111112.7489838373952-1.74898383739519
1121212.7700015053594-0.770001505359418
113118.852346222021352.14765377797865
1141411.89917381475202.10082618524804
1151511.26814941764553.73185058235445
1161611.81747668021164.18252331978836
1171611.95392852429944.04607147570063
118118.773609397770342.22639060222966
1191412.38623566535791.61376433464206
1201412.56713840320771.43286159679235
1211212.9908403134361-0.9908403134361
1221415.0616784230829-1.06167842308286
123810.6190414734542-2.61904147345418
1241312.79359460555700.206405394443017
1251613.70875785957322.29124214042683
126128.021238217360893.97876178263911
1271612.93553717017523.06446282982483
1281213.2746844643058-1.27468446430576
1291113.5150323835848-2.51503238358484
13044.41866304622886-0.418663046228862
1311611.72973751662984.27026248337018
1321511.46104278657593.53895721342414
133109.568619924563960.431380075436043
1341311.63901377147711.36098622852294
1351512.43377437853282.56622562146724
1361211.25344890288030.746551097119685
1371414.7142234789598-0.714223478959797
138711.1537444396956-4.15374443969556
1391912.88051063753906.11948936246103
1401214.8120365467429-2.81203654674294
1411213.8711277180163-1.87112771801627
1421312.19473483195390.80526516804613
1431516.2959116316725-1.29591163167247
14488.30677578566316-0.306775785663164
1451211.62187385386790.378126146132109
146108.18997982614471.81002017385530
14788.00380029264288-0.00380029264287846
1481012.7891946055085-2.78919460550846
1491512.82523367829812.1747663217019
1501610.89537162084245.1046283791576
151139.705393620770963.29460637922904
1521613.97053417409222.02946582590782
153910.5588398965406-1.55883989654055
1541412.21915790832241.7808420916776
1551412.00462560093811.99537439906190
1561212.5356679621759-0.535667962175926


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
110.002040308709223840.004080617418447680.997959691290776
120.0007041232123881320.001408246424776260.999295876787612
139.11470877084195e-050.0001822941754168390.999908852912292
141.04901895837160e-052.09803791674320e-050.999989509810416
151.26701420902535e-062.53402841805071e-060.99999873298579
162.76734651127936e-075.53469302255872e-070.999999723265349
174.71627724089860e-089.43255448179719e-080.999999952837228
182.48213438723599e-084.96426877447197e-080.999999975178656
196.74172140833907e-081.34834428166781e-070.999999932582786
201.05513699378691e-082.11027398757383e-080.99999998944863
211.82898147117726e-093.65796294235451e-090.999999998171019
221.33154717811144e-092.66309435622289e-090.999999998668453
233.23967597570423e-106.47935195140846e-100.999999999676032
245.97155256761306e-111.19431051352261e-100.999999999940284
251.89803094409970e-113.79606188819941e-110.99999999998102
263.59250774835323e-127.18501549670646e-120.999999999996408
272.90803398368766e-125.81606796737532e-120.999999999997092
284.65818297966566e-129.31636595933131e-120.999999999995342
291.10617596213715e-122.21235192427430e-120.999999999998894
302.14680073418647e-134.29360146837294e-130.999999999999785
311.03079158423742e-122.06158316847484e-120.99999999999897
322.15887551578811e-134.31775103157622e-130.999999999999784
337.70242086991453e-141.54048417398291e-130.999999999999923
342.13433849214609e-144.26867698429217e-140.999999999999979
354.06818996302778e-158.13637992605556e-150.999999999999996
361.49029312026209e-142.98058624052418e-140.999999999999985
373.42727782299467e-156.85455564598934e-150.999999999999997
381.33602555057221e-152.67205110114441e-150.999999999999999
394.87772594681312e-169.75545189362624e-161
401.07842513679661e-152.15685027359323e-150.999999999999999
412.02513063197858e-144.05026126395715e-140.99999999999998
420.001039119497209720.002078238994419440.99896088050279
430.005952007149160370.01190401429832070.99404799285084
440.006635850717226440.01327170143445290.993364149282774
450.08922089667846390.1784417933569280.910779103321536
460.79802313263720.4039537347255990.201976867362800
470.9354047025837580.1291905948324840.064595297416242
480.9182741461101740.1634517077796520.0817258538898261
490.9280531718164120.1438936563671760.0719468281835878
500.935004166940740.1299916661185190.0649958330592597
510.9181237224220.1637525551559990.0818762775779993
520.9905281033151610.01894379336967710.00947189668483856
530.98709302700780.02581394598440160.0129069729922008
540.9881652750543020.02366944989139620.0118347249456981
550.991620487811890.01675902437622060.00837951218811032
560.9889352311229860.02212953775402830.0110647688770142
570.9857505033130120.02849899337397690.0142494966869885
580.9856109339634210.0287781320731580.014389066036579
590.9858826382696840.02823472346063280.0141173617303164
600.9865615610597780.02687687788044380.0134384389402219
610.984097447847530.03180510430493870.0159025521524694
620.9890293413905410.02194131721891760.0109706586094588
630.9868985899184220.02620282016315630.0131014100815782
640.9909576105129940.01808477897401290.00904238948700645
650.9875794055791170.02484118884176520.0124205944208826
660.9877499915284430.02450001694311430.0122500084715571
670.9875948400424520.02481031991509650.0124051599575483
680.9962068536116930.007586292776614650.00379314638830732
690.9958770306541230.00824593869175480.0041229693458774
700.9941582722350930.01168345552981450.00584172776490724
710.9948801080050520.01023978398989510.00511989199494755
720.9928613711176370.01427725776472640.0071386288823632
730.9905313858024150.01893722839517010.00946861419758507
740.9931297941011940.01374041179761210.00687020589880606
750.9907590396457980.01848192070840420.00924096035420208
760.9894737300480210.02105253990395730.0105262699519787
770.9859284327546040.02814313449079140.0140715672453957
780.9817972590912130.03640548181757410.0182027409087870
790.9850608459630640.02987830807387120.0149391540369356
800.9918200241848260.01635995163034820.00817997581517408
810.9911803924463330.01763921510733320.0088196075536666
820.9945172350963380.01096552980732340.0054827649036617
830.9923374259609070.01532514807818640.0076625740390932
840.9901873986545970.01962520269080590.00981260134540294
850.9973448794215480.005310241156903570.00265512057845179
860.9966072640836440.006785471832712160.00339273591635608
870.9952063720154260.009587255969148530.00479362798457426
880.994370716648330.01125856670334060.00562928335167032
890.9935998617072940.01280027658541240.00640013829270622
900.991067891076280.01786421784744140.00893210892372069
910.9884311048119170.02313779037616620.0115688951880831
920.9917433822871530.01651323542569370.00825661771284684
930.9924479822136850.01510403557262950.00755201778631473
940.9908409359711680.01831812805766390.00915906402883193
950.9877292153244240.02454156935115280.0122707846755764
960.9832824806915110.03343503861697740.0167175193084887
970.9799329368557620.04013412628847610.0200670631442380
980.9728492177392670.05430156452146640.0271507822607332
990.9748363265688870.05032734686222580.0251636734311129
1000.9743491559253440.05130168814931230.0256508440746561
1010.9712131964458380.0575736071083240.028786803554162
1020.9671988443748060.06560231125038810.0328011556251941
1030.9730869654662960.05382606906740810.0269130345337041
1040.9757590191604320.04848196167913630.0242409808395681
1050.9731441859236170.05371162815276540.0268558140763827
1060.9691188693599740.0617622612800510.0308811306400255
1070.9669998097759150.06600038044817050.0330001902240852
1080.9684757587882680.06304848242346440.0315242412117322
1090.9792212871576580.04155742568468450.0207787128423422
1100.9823113570168160.03537728596636850.0176886429831842
1110.9791180539910360.04176389201792850.0208819460089643
1120.9836998470551420.03260030588971630.0163001529448582
1130.9787082367641460.04258352647170740.0212917632358537
1140.9736869298651170.05262614026976680.0263130701348834
1150.9717976074055850.0564047851888290.0282023925944145
1160.9764563399805490.04708732003890210.0235436600194510
1170.9845926265461720.03081474690765550.0154073734538278
1180.9815110834113020.03697783317739680.0184889165886984
1190.9740598655014670.05188026899706680.0259401344985334
1200.9777951747530130.04440965049397370.0222048252469868
1210.9686361921276280.06272761574474450.0313638078723723
1220.956756936002770.08648612799445810.0432430639972291
1230.9500938326538470.09981233469230580.0499061673461529
1240.9321240176834330.1357519646331330.0678759823165665
1250.9271762561193420.1456474877613160.072823743880658
1260.9279717076325830.1440565847348340.0720282923674172
1270.9081180319181310.1837639361637380.0918819680818689
1280.895320635196190.2093587296076210.104679364803810
1290.949166442570130.1016671148597420.0508335574298711
1300.944298102083150.11140379583370.05570189791685
1310.9283693441720110.1432613116559780.071630655827989
1320.9055249744119160.1889500511761690.0944750255880843
1330.8723062960190670.2553874079618660.127693703980933
1340.8246570947424170.3506858105151670.175342905257583
1350.7718558304762310.4562883390475380.228144169523769
1360.735076971457720.5298460570845590.264923028542280
1370.6779167389953880.6441665220092240.322083261004612
1380.6787175017891950.6425649964216090.321282498210805
1390.9182341148600240.1635317702799520.0817658851399762
1400.9795592005842460.04088159883150870.0204407994157543
1410.962011427555070.07597714488986170.0379885724449309
1420.9346055148085010.1307889703829990.0653944851914993
1430.8801378781296480.2397242437407050.119862121870352
1440.7770200725642490.4459598548715020.222979927435751
1450.6778297319440750.644340536111850.322170268055925


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level370.274074074074074NOK
5% type I error level910.674074074074074NOK
10% type I error level1080.8NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/10tm5v1291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/10tm5v1291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/1m3811291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/1m3811291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/2xu741291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/2xu741291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/3xu741291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/3xu741291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/4xu741291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/4xu741291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/5847p1291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/5847p1291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/6847p1291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/6847p1291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/70voa1291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/70voa1291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/80voa1291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/80voa1291297999.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/9tm5v1291297999.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291299973rxf2r96dt0pjved/9tm5v1291297999.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