Home » date » 2010 » Nov » 24 »

Multiple Regression Minitutorial Gender

*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 23:09:01 +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/24/t12905538855tpnkmiiwv11coy.htm/, Retrieved Wed, 24 Nov 2010 00:11: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/24/t12905538855tpnkmiiwv11coy.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
7 7 1 7 7 1 7 7 1 5 6 1 5 5 1 5 5 1 6 6 2 5 6 1 4 5 1 4 5 2 5 6 2 5 6 2 5 6 2 5 6 2 5 6 1 6 7 1 7 5 1 6 7 1 7 7 1 7 7 1 7 6 2 6 7 1 5 6 1 5 7 1 6 7 1 3 7 2 7 7 1 6 6 1 6 6 1 5 6 1 5 4 1 7 7 1 4 7 2 5 6 1 6 7 1 6 7 2 4 6 1 5 6 1 4 5 1 6 7 1 3 6 1 6 6 1 6 6 1 7 7 1 7 7 1 5 6 2 5 6 3 6 6 2 3 4 1 7 7 1 4 7 1 7 7 1 7 7 1 6 7 2 3 7 1 7 7 1 6 7 2 5 6 2 6 7 2 6 6 1 3 3 1 5 5 1 4 4 2 5 7 1 7 7 NA 5 7 1 2 5 1 4 5 1 2 6 1 6 7 1 7 6 1 6 7 2 3 6 1 7 7 2 5 7 1 6 5 1 7 6 1 6 5 1 6 5 1 7 6 1 6 5 1 5 6 1 3 6 1 5 7 1 5 5 1 7 6 1 5 6 2 7 6 1 5 6 1 5 6 1 6 6 1 7 6 1 6 6 2 5 5 1 5 5 1 6 6 1 5 4 4 5 3 6 5 1 1 4 5 3 4 3 3 4 5 2 4 4 1 5 5 1 6 7 2 6 6 2 6 6 2 5 5 2 5 6 1 7 7 1 5 7 1 5 7 1 5 7 1 5 5 2 7 7 1 7 7 1 7 7 2 5 7 1 7 6 1 5 6 1 5 7 1 6 7 1 5 7 1 6 5 1 6 7 1 7 6 1 5 6 2 7 6 2 5 6 1 6 6 1 7 6 2 7 5 2 7 3 1 6 5 1 6 6 2 5 6 4 6 6 4 3 6 1 5 5 1 4 6 2 4 5 2 5 4 3 7 7 3 6 7 2 6 6 2 5 6 2 5 6 1 2 6 3 6 7 2 4 7 2 4 6 2 5 6 2 4 5 1 4 5 1 3 5 1 6 5 1 6 6 2 7 7 1 5 7 1 3 5 1 6 4 1 4 3 etc...
 
Output produced by software:

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


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time11 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Q1_2[t] = + 1.47989704422343 + 0.211536296316238Q1_3[t] -0.226959234717235Q1_5[t] + 0.142272613689836Q1_7[t] -0.173251587312293Q1_8[t] + 0.0994300625037737Q1_12[t] + 0.53567045852253Q1_16[t] + 0.000956764440532458Q1_22[t] -0.0478595993824866GENDER[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.479897044223430.7848611.88560.0612510.030625
Q1_30.2115362963162380.0808262.61720.0097560.004878
Q1_5-0.2269592347172350.118389-1.91710.0570940.028547
Q1_70.1422726136898360.0743751.91290.0576290.028814
Q1_8-0.1732515873122930.115132-1.50480.1344340.067217
Q1_120.09943006250377370.0985051.00940.314380.15719
Q1_160.535670458522530.0868796.165700
Q1_220.0009567644405324580.1001310.00960.9923890.496194
GENDER-0.04785959938248660.165571-0.28910.7729290.386464


Multiple Linear Regression - Regression Statistics
Multiple R0.589970343960876
R-squared0.348065006753315
Adjusted R-squared0.313976902531266
F-TEST (value)10.2107469657459
F-TEST (DF numerator)8
F-TEST (DF denominator)153
p-value2.23783214181594e-11
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.990510676830705
Sum Squared Residuals150.110044340090


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
176.324800092225370.675199907774634
255.10196729722794-0.101967297227940
364.166086016675881.83391398332412
444.54274740644399-0.542747406443987
554.802143302142710.197856697857290
666.13563280832744-0.13563280832744
776.275983728402370.724016271597629
865.142165535112940.857834464887056
965.855139699969810.144860300030186
1065.071945088046010.928054911953991
1154.035320228326590.96467977167341
1255.38746112431429-0.387461124314292
1344.39304525139311-0.39304525139311
1465.392334001815270.60766599818473
1566.11326379590915-0.113263795909145
1655.38938422378653-0.38938422378653
1734.08317982770908-1.08317982770908
1875.741270034320371.25872996567963
1935.74127003432037-2.74127003432037
2055.30683478704278-0.306834787042785
2133.88287158593367-0.882871585933669
2256.1421037760948-1.1421037760948
2321.914521621632660.0854783783673403
2468.14135294136786-2.14135294136786
2532.537395099501600.462604900498395
2665.53739509950160.462604900498395
2765.646084011417030.353915988582967
2854.954821806037120.0451781939628805
2952.929672474356172.07032752564383
3076.702028560875890.297971439124111
3166.42705822387476-0.427058223874759
3254.837843429825080.162156570174922
3355.25607315951451-0.256073159514507
3445.16861909261657-1.16861909261657
3542.895599552009531.10440044799047
3666.04192287886408-0.0419228788640837
3754.91914081953710.0808591804629012
3854.27694049284290.723059507157103
3977.42575399805208-0.425753998052083
4055.11118656149049-0.111186561490486
4154.758498121462540.241501878537462
4266.08668852952238-0.0866885295223836
4355.33617231746166-0.336172317461661
4464.098398645549631.90160135445037
4575.618016654360561.38198334563944
4654.090806804508320.909193195491678
4754.851602800944730.148397199055271
4853.802143302142711.19785669785729
4967.96163180033853-1.96163180033853
5022.26551607917965-0.265516079179649
5145.14155623205455-1.14155623205455
5242.814963644146851.18503635585315
5367.66837121451023-1.66837121451023
5432.598040656190.401959343810002
5565.202354124172240.79764587582776
5665.928715709915640.0712842900843596
5754.788172869262320.211827130737680
58610.1057043809311-4.10570438093112
5910.6681656143381780.331834385661822
6052.476577672541772.52342232745823
6177.19495402597906-0.194954025979062
6244.00172464097907-0.00172464097907366
6353.741371980839821.25862801916018
6466.35696090937731-0.356960909377314
6543.377894398669600.622105601330403
6665.659186009689830.340813990310173
6766.24518851062446-0.245188510624456
6854.898693500733720.101306499266285
6956.85680771398819-1.85680771398819
7032.968913947800650.0310860521993497
7154.387461124314290.612538875685708
7266.65918600968983-0.659186009689827
7354.978770494447850.0212295055521520
7465.888559696206630.111440303793373
7566.36950398386554-0.369503983865540
7644.01569507385947-0.015695073859465
7743.304072873861080.695927126138923
7864.741270034320371.25872996567963
7977.64288062754604-0.642880627546036
8045.44732178683359-1.44732178683359
8154.070988323605480.929011676394524
8265.39607925025230.603920749747699
8366.96142445657461-0.961424456574614
8457.06980790376235-2.06980790376235
8531.490492264559651.50950773544035
8676.677023399890390.322976600109612
8765.874656492126070.125343507873927
8844.86555077201281-0.865550772012814
8943.945372680273080.0546273197269198
9055.85955397380869-0.859553973808687
9131.740660731261981.25933926873802
9276.844760380580030.155239619419968
9365.645900255572480.354099744427515
9466.52085169112248-0.520851691122482
9544.25345917518032-0.253459175180322
9654.558799182745520.44120081725448
9765.80574437988430.194255620115704
9853.661666617453281.33833338254672
9965.883210612467720.116789387532276
10067.39703601469283-1.39703601469283
10144.09143564240886-0.0914356424088597
10254.126277464349000.873722535650996
10366.60761554656854-0.60761554656854
10454.984844015219040.0151559847809555
10556.00460450489184-1.00460450489184
10644.71504222931575-0.715042229315748
10742.786587266921251.21341273307875
10866.89798225115588-0.897982251155876
10954.607615546568540.392384453431461
11067.32480009222538-1.32480009222538
11154.677023399890390.322976600109612
11266.06368258822399-0.0636825882239886
11355.22818813461624-0.228188134616236
11443.789129633702850.210870366297147
11565.98873242870350.0112675712965032
11642.631516493289321.36848350671068
11755.21349648790703-0.213496487907030
11854.015010395096420.984989604903584
11966.89580952781846-0.895809527818462
12033.73287961951631-0.732879619516309
12154.701756475198410.298243524801594
12242.329766769340991.67023323065901
12354.324800092225380.675199907774616
12455.54528977322559-0.545289773225589
12575.365100276629841.63489972337016
12654.278150533584150.721849466415853
12776.884785114814730.115214885185267
12854.559755947186050.440244052813947
12943.970249926276540.0297500737234563
13067.04743889134406-1.04743889134406
13143.443607268918700.556392731081304
13244.63929760503499-0.63929760503499
13343.266744929297660.733255070702336
13443.294971209479180.705028790520819
13565.544482361318930.455517638681069
13667.54514671215415-1.54514671215415
13754.598040656190.401959343810002
13833.30683478704278-0.306834787042785
13966.60324146023097-0.603241460230972
14055.1240164740858-0.124016474085796
14145.74396433323544-1.74396433323544
14255.20594703717998-0.205947037179979
14320.9023046563382771.09769534366172
14455.85945202728924-0.859452027289238
14578.21708940091477-1.21708940091477
14643.405436000088060.594563999911937
14743.197337075975820.802662924024185
14877.12999649282165-0.129996492821651
14965.856807713988190.143192286011814
15055.74628708251679-0.746287082516791
15154.457853441652670.542146558347333
15255.2769404928429-0.276940492842897
15376.771292243502290.228707756497709
15465.970377841258580.0296221587414193
15569.48008637435508-3.48008637435508
15654.700592311068690.299407688931307
15721.844760380580030.155239619419968
15844.46438616843817-0.464386168438171
15965.095364646690440.904635353309561
16054.71717941359940.282820586400598
16155.96160821241916-0.961608212419163
16254.967273577433010.0327264225669863
1634NANA
1644NANA


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.1189727149568540.2379454299137080.881027285043146
130.3291798260928590.6583596521857190.67082017390714
140.2018837861349710.4037675722699430.798116213865029
150.1883128900326310.3766257800652610.81168710996737
160.1374475374920150.274895074984030.862552462507985
170.1759206320995290.3518412641990590.82407936790047
180.1178055400318680.2356110800637370.882194459968132
190.8607809317936740.2784381364126510.139219068206326
200.8214119501947350.3571760996105300.178588049805265
210.7737723832462280.4524552335075430.226227616753772
220.7613784319492410.4772431361015190.238621568050759
230.6971984525862720.6056030948274560.302801547413728
240.6899146693598450.620170661280310.310085330640155
250.6402205575722720.7195588848554560.359779442427728
260.5793615408264910.8412769183470170.420638459173509
270.5087983283773290.9824033432453420.491201671622671
280.4475726880013340.8951453760026690.552427311998666
290.6307140900873620.7385718198252750.369285909912638
300.5700379074139340.8599241851721310.429962092586066
310.5395357466250760.9209285067498490.460464253374924
320.5387509496732420.9224981006535160.461249050326758
330.4829038808879670.9658077617759350.517096119112033
340.4524226613772080.9048453227544160.547577338622792
350.4264062202291320.8528124404582640.573593779770868
360.367138883441140.734277766882280.63286111655886
370.3308238560061820.6616477120123650.669176143993818
380.2958637972525170.5917275945050330.704136202747483
390.2647881668640440.5295763337280880.735211833135956
400.2200502601150080.4401005202300150.779949739884992
410.1815435886395010.3630871772790030.818456411360499
420.1485535201835780.2971070403671560.851446479816422
430.1180432606907350.236086521381470.881956739309265
440.2490457430795820.4980914861591640.750954256920418
450.2640692323891050.528138464778210.735930767610895
460.334199440246890.668398880493780.66580055975311
470.2899804043970620.5799608087941230.710019595602938
480.2847381414570050.5694762829140110.715261858542995
490.5429790012753190.9140419974493630.457020998724681
500.504152770353080.991694459293840.49584722964692
510.5729307623350050.854138475329990.427069237664995
520.5616390528286780.8767218943426450.438360947171322
530.656693258171820.686613483656360.34330674182818
540.6138916769477140.7722166461045710.386108323052286
550.6180293634727670.7639412730544660.381970636527233
560.5698326081819470.8603347836361050.430167391818053
570.5218962741974070.9562074516051860.478103725802593
580.9679440063692730.06411198726145320.0320559936307266
590.9601610281737640.07967794365247190.0398389718262359
600.9914115649569540.01717687008609280.0085884350430464
610.9893789641720120.02124207165597540.0106210358279877
620.985489322373160.02902135525368210.0145106776268411
630.9887094442575480.02258111148490470.0112905557424523
640.985466801502160.02906639699567810.0145331984978390
650.9828243270728030.03435134585439440.0171756729271972
660.977990587580960.04401882483808150.0220094124190407
670.9714901943578070.0570196112843860.028509805642193
680.9630751997625590.07384960047488260.0369248002374413
690.9794410505717040.04111789885659210.0205589494282961
700.9728900060281670.05421998794366670.0271099939718333
710.9676011226661930.06479775466761350.0323988773338068
720.9617655084476930.0764689831046130.0382344915523065
730.9513023939116880.09739521217662320.0486976060883116
740.9384832188456660.1230335623086670.0615167811543336
750.9247172286059940.1505655427880110.0752827713940055
760.906413061535280.1871738769294390.0935869384647195
770.8980981129618280.2038037740763430.101901887038172
780.9093658785207030.1812682429585930.0906341214792965
790.897436548974520.2051269020509590.102563451025479
800.922108224935980.1557835501280410.0778917750640206
810.9199382341833530.1601235316332940.080061765816647
820.9081352794957720.1837294410084560.091864720504228
830.9068962176296350.1862075647407290.0931037823703647
840.9603648133528970.07927037329420680.0396351866471034
850.9718727626443270.05625447471134520.0281272373556726
860.9649014828164840.07019703436703250.0350985171835162
870.9545668871912430.09086622561751330.0454331128087567
880.9519507985979410.09609840280411740.0480492014020587
890.938796898075970.1224062038480590.0612031019240296
900.9387168399010040.1225663201979930.0612831600989965
910.9462872438112350.1074255123775290.0537127561887646
920.9324939788800310.1350120422399370.0675060211199685
930.9198724711736360.1602550576527280.0801275288263639
940.906127000902820.1877459981943590.0938729990971796
950.8850437678446630.2299124643106740.114956232155337
960.8649281652126790.2701436695746420.135071834787321
970.8368596212565270.3262807574869450.163140378743473
980.858731353435330.2825372931293420.141268646564671
990.8297048388202980.3405903223594030.170295161179702
1000.8531997603593970.2936004792812060.146800239640603
1010.8230431261649340.3539137476701310.176956873835066
1020.8166383173218230.3667233653563550.183361682678177
1030.7933968521260590.4132062957478820.206603147873941
1040.7558881990454570.4882236019090850.244111800954543
1050.772432729612020.4551345407759610.227567270387981
1060.7611180846918070.4777638306163850.238881915308193
1070.7892084461460940.4215831077078110.210791553853906
1080.7702199720832090.4595600558335820.229780027916791
1090.7371494839349590.5257010321300830.262850516065041
1100.7544485572228040.4911028855543910.245551442777196
1110.7197591666867280.5604816666265450.280240833313272
1120.6810388951697420.6379222096605150.318961104830258
1130.6405352295019360.7189295409961280.359464770498064
1140.5974697787191170.8050604425617660.402530221280883
1150.5508825810194620.8982348379610750.449117418980538
1160.6538027610037580.6923944779924840.346197238996242
1170.6059709653862210.7880580692275590.394029034613779
1180.5869887818784820.8260224362430360.413011218121518
1190.549059200455060.9018815990898790.450940799544940
1200.5210220624036360.9579558751927270.478977937596364
1210.4689057264617810.9378114529235620.531094273538219
1220.5060775676289060.9878448647421880.493922432371094
1230.4891673033625230.9783346067250460.510832696637477
1240.441803694208410.883607388416820.55819630579159
1250.6347214925653750.730557014869250.365278507434625
1260.6094718736006680.7810562527986650.390528126399332
1270.5587093447277440.8825813105445120.441290655272256
1280.5127791141842090.9744417716315830.487220885815791
1290.4614673997347770.9229347994695530.538532600265223
1300.4527970053593850.905594010718770.547202994640615
1310.3903244064097270.7806488128194530.609675593590273
1320.3361030474506350.672206094901270.663896952549365
1330.3397764306860650.679552861372130.660223569313935
1340.2988722389596410.5977444779192820.701127761040359
1350.2798437852308440.5596875704616870.720156214769156
1360.37504950064610.75009900129220.6249504993539
1370.331528652974380.663057305948760.66847134702562
1380.2692925881843080.5385851763686160.730707411815692
1390.2126189322181210.4252378644362410.78738106778188
1400.1900277888422900.3800555776845810.80997221115771
1410.2287332674669300.4574665349338590.77126673253307
1420.1705392879190540.3410785758381080.829460712080946
1430.1658474416417090.3316948832834170.834152558358291
1440.1563514929020470.3127029858040940.843648507097953
1450.1595495213110120.3190990426220250.840450478688988
1460.1099165343337840.2198330686675670.890083465666216
1470.0824143549321070.1648287098642140.917585645067893
1480.06109856344757870.1221971268951570.938901436552421
1490.03697414333606380.07394828667212760.963025856663936
1500.01763888033447630.03527776066895260.982361119665524
1510.579734736540830.840530526918340.42026526345917
1520.5062145404537360.9875709190925270.493785459546264


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level90.0638297872340425NOK
10% type I error level230.163120567375887NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/102mna1290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/102mna1290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/1lcrd1290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/1lcrd1290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/2elqg1290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/2elqg1290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/3elqg1290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/3elqg1290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/4pcpj1290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/4pcpj1290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/5pcpj1290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/5pcpj1290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/6pcpj1290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/6pcpj1290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/7hmo41290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/7hmo41290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/8sv671290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/8sv671290553729.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/9sv671290553729.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905538855tpnkmiiwv11coy/9sv671290553729.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