Home » date » 2010 » Dec » 14 »

multiple regression - interaction effects

*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, 14 Dec 2010 09:53:37 +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/14/t1292320432xov6rgjuuokwcyc.htm/, Retrieved Tue, 14 Dec 2010 10:56:06 +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/14/t1292320432xov6rgjuuokwcyc.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 «
1 12 12 18 18 9 9 51 15 15 1 15 15 11 11 9 9 42 14 14 1 12 12 16 16 8 8 46 10 10 1 15 15 15 15 15 15 47 18 18 1 9 9 19 19 11 11 33 11 11 1 11 11 18 18 8 8 47 12 12 1 11 11 14 14 9 9 32 15 15 1 15 15 18 18 6 6 53 17 17 1 11 11 14 14 11 11 33 7 7 1 10 10 12 12 16 16 37 18 18 1 11 11 16 16 7 7 49 18 18 1 11 11 9 9 15 15 43 11 11 1 14 14 17 17 10 10 43 12 12 1 13 13 17 17 6 6 46 11 11 1 16 16 12 12 12 12 42 16 16 1 13 13 11 11 14 14 40 14 14 1 14 14 17 17 9 9 42 13 13 1 9 9 16 16 14 14 44 17 17 1 12 12 12 12 14 14 46 13 13 1 13 13 16 16 8 8 45 12 12 1 16 16 14 14 10 10 49 12 12 1 15 15 12 12 9 9 43 9 9 1 5 5 14 14 11 11 37 18 18 1 11 11 15 15 9 9 45 14 14 1 17 17 11 11 10 10 45 12 12 1 9 9 14 14 8 8 31 12 12 1 13 13 15 15 14 14 33 9 9 1 10 10 16 16 10 10 44 12 12 1 12 12 15 15 14 14 38 11 11 1 11 11 16 16 15 15 33 13 13 1 16 16 9 9 11 11 47 13 13 1 15 15 15 15 8 8 48 6 6 1 14 14 17 17 10 10 54 21 21 1 16 16 17 17 10 10 43 11 11 1 9 9 15 15 9 9 54 9 9 1 14 14 13 13 13 13 44 18 18 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'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
belonging[t] = + 27.1549127461159 + 11.0419253322257gender[t] + 0.711931817315218popularity[t] -0.26228362100035popularity_g[t] + 0.445659792121529hapiness[t] -0.107179522084186hapiness_g[t] -0.121412841291265doubsaboutactions[t] -0.656061525985646doubtsaboutactions_g[t] + 0.123162078539735parentalexpectations[t] + 0.176354302880337parentalexpectations_g[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)27.15491274611598.1716563.32310.001150.000575
gender11.041925332225712.4088570.88980.3751570.187579
popularity0.7119318173152180.3069652.31930.0219050.010952
popularity_g-0.262283621000350.40884-0.64150.5222820.261141
hapiness0.4456597921215290.4070421.09490.2755510.137775
hapiness_g-0.1071795220841860.548552-0.19540.8453890.422694
doubsaboutactions-0.1214128412912650.328667-0.36940.712410.356205
doubtsaboutactions_g-0.6560615259856460.467712-1.40270.1630350.081518
parentalexpectations0.1231620785397350.2868350.42940.668340.33417
parentalexpectations_g0.1763543028803370.3678180.47950.6323990.316199


Multiple Linear Regression - Regression Statistics
Multiple R0.435982056995364
R-squared0.190080354021909
Adjusted R-squared0.135273761436925
F-TEST (value)3.46820236501965
F-TEST (DF numerator)9
F-TEST (DF denominator)133
p-value0.000711537672054341
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation6.84167943760142
Sum Squared Residuals6225.54081107744


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
15147.18073771060073.81926228939927
24245.8608040278641-3.8608040278641
34645.78366963070290.216330369297065
44743.74794443003243.25205556996761
53343.4172591314597-10.4172591314597
64746.61001473730290.389985262697105
73245.3771684341368-13.3771684341368
85351.46113816421661.53886183578344
93341.4260886482224-8.42608864822242
103739.7067882710691-2.70678827106911
114948.50762685302560.492373146974442
124337.82185535460845.17814464539164
134346.0655303216563-3.06553032165634
144648.4262632130290-2.42626321302905
154244.9155421552258-2.91554215522582
164041.0741357988499-1.07413579884991
174247.1425210703533-5.14252107035332
184441.86649350803742.13350649196263
194640.66345149115235.33654850884769
204546.832350589858-1.83235058985795
214945.94938590417403.05061409582596
224344.7017023908012-1.70170239080119
233742.022879665954-5.02287966595402
244545.4161323227541-0.416132322754103
254545.3835932903769-0.383593290376883
263144.3567972645238-13.3567972645238
273340.9304749718989-7.93047497189892
284443.92845726635950.0715427336404779
293841.0798595384242-3.07985953842419
303340.7902500077099-7.7902500077099
314743.77902656813053.22097343186951
324845.59606842392992.40393157607009
335448.7611777544375.23882224556301
344346.665310332866-3.665310332866
355443.01925402302410.980745976976
364444.1762844281967-0.176284428196661
374546.7367671221567-1.73676712215674
384444.7612272291995-0.761227229199535
394745.19947407806961.80052592193042
404337.11658502499175.8834149750083
413345.7241447923046-12.7241447923046
424643.41228264025492.58771735974507
434743.09929367949973.90070632050032
444744.10540437405732.89459562594275
454343.8951709856128-0.895170985612782
464442.89536076578081.10463923421918
474747.3648569229084-0.364856922908372
484743.17722145673423.82277854326578
494645.82188627095070.178113729049310
504746.62634644424870.373653555751269
514647.9532355866732-1.95323558667322
523645.8466303318633-9.84663033186326
533041.4825783614389-11.4825783614389
544945.8374707295273.162529270473
555547.8859619085147.11403809148603
565247.13111972290854.8688802770915
574748.8575084705077-1.85750847050772
583337.8374859448884-4.83748594488842
594443.61621555397380.383784446026212
604240.01977723182441.98022276817564
615544.506181831049110.4938181689509
624244.8170995599140-2.81709955991396
634645.76944980299820.230550197001763
644647.6636260559589-1.66362605595892
653341.8630115135716-8.86301151357164
665349.67469397477143.32530602522858
674443.7117990216750.288200978324997
685346.50377717052646.49622282947361
694446.1221499007403-2.12214990074028
703540.1748394062202-5.17483940622017
714040.5352046095594-0.535204609559434
724445.1760946480286-1.17609464802862
734647.1510171584837-1.15101715848373
744540.80015685841574.19984314158432
755345.85587366836327.14412633163681
764841.99681162152066.0031883784794
775541.923113087121313.0768869128787
784749.3517981633104-2.35179816331039
794341.87573684453731.1242631554627
804741.47988974704655.52011025295351
814742.43505847039074.56494152960935
824444.3165093923857-0.316509392385678
834243.8845168865375-1.88451688653748
845143.2784825323067.72151746769404
855443.618286785864210.3817132141359
865145.66677796485115.33322203514888
874243.4801526238921-1.48015262389209
884139.15398943204601.84601056795396
894942.68298994874446.3170100512556
904239.09776374365792.90223625634206
914140.18480104698850.81519895301149
924143.2099869809082-2.20998698090821
934344.2717564722066-1.27175647220657
943337.3659831103569-4.36598311035691
954244.458356466401-2.45835646640099
963738.3822376150307-1.38223761503068
974243.2824703892834-1.2824703892834
984340.02186267367792.97813732632205
993344.9023628580891-11.9023628580891
1004442.23558091937441.76441908062561
1015243.07951683828688.9204831617132
1024544.35689149322390.643108506776054
1033640.0056285583334-4.00562855833337
1044342.85510506484270.144894935157284
1053235.456587552019-3.45658755201902
1064545.6629365978752-0.662936597875154
1074540.47832900437814.5216709956219
1084935.656019023876213.3439809761238
1094441.10874371663052.89125628336951
1104137.97295147999813.02704852000186
1114443.01444912684120.985550873158757
1123738.2610164473696-1.26101644736961
1134038.83557700988461.16442299011537
1145044.72637772884325.27362227115685
1154741.44397707105995.55602292894009
1163342.3407596453211-9.34075964532109
1173334.5798486826872-1.57984868268716
1184541.45272325730233.54727674269774
1194341.76647478464171.23352521535829
120039.5310594335826-39.5310594335826
1214642.99275202147863.00724797852144
1223640.4943714460925-4.49437144609248
1234238.48379842502283.51620157497717
1244138.91847181354522.08152818645481
1254643.01104648915942.9889535108406
1264840.81006388431067.18993611568942
1274541.44922478280533.55077521719468
1281142.8965347600469-31.8965347600469
1293335.0490506542349-2.04905065423494
1304745.02542909981381.97457090018621
1314242.6884529387625-0.688452938762508
1325544.838829105619410.1611708943806
1334036.14682226397163.85317773602845
1344645.49453523454650.505464765453524
1354544.06668214531080.933317854689244
1364644.44190707278371.55809292721628
1373839.7662055134327-1.76620551343269
1384039.35342090390320.6465790960968
1394239.84781845531062.15218154468939
1405341.666854885528211.3331451144718
1414344.2717564722066-1.27175647220657
1424143.0631868861271-2.06318688612712
1435143.90751794833287.09248205166723


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
130.9050053744787760.1899892510424470.0949946255212236
140.8263226978074020.3473546043851950.173677302192598
150.7620001485237670.4759997029524670.237999851476233
160.6552054108569420.6895891782861170.344794589143058
170.5735102584528930.8529794830942140.426489741547107
180.4911596757430880.9823193514861760.508840324256912
190.4797080832365820.9594161664731640.520291916763418
200.3845469822191450.769093964438290.615453017780855
210.3190842694647530.6381685389295070.680915730535247
220.2413314799991740.4826629599983480.758668520000826
230.1798576085760770.3597152171521530.820142391423923
240.1340050954934910.2680101909869830.865994904506509
250.09306788639282450.1861357727856490.906932113607176
260.1252179445730740.2504358891461480.874782055426926
270.1310978429752210.2621956859504420.868902157024779
280.1095624776100280.2191249552200560.890437522389972
290.07955894360308750.1591178872061750.920441056396913
300.08073196243488120.1614639248697620.919268037565119
310.06116147996571410.1223229599314280.938838520034286
320.0569838157060540.1139676314121080.943016184293946
330.04437602956669050.0887520591333810.95562397043331
340.03466511809389930.06933023618779870.9653348819061
350.1565422353262830.3130844706525660.843457764673717
360.1205620926807290.2411241853614590.879437907319271
370.09272409953789240.1854481990757850.907275900462108
380.06907076206259280.1381415241251860.930929237937407
390.05278371557760310.1055674311552060.947216284422397
400.05082789162074480.1016557832414900.949172108379255
410.08811494505384240.1762298901076850.911885054946158
420.0755231928991280.1510463857982560.924476807100872
430.06080233531846780.1216046706369360.939197664681532
440.05676725765732440.1135345153146490.943232742342676
450.04185868677669610.08371737355339210.958141313223304
460.03109041498114010.06218082996228020.96890958501886
470.02218196988666290.04436393977332580.977818030113337
480.01738960755065880.03477921510131760.982610392449341
490.01355126529150750.0271025305830150.986448734708492
500.009364255020262920.01872851004052580.990635744979737
510.006590941989607240.01318188397921450.993409058010393
520.01153419389672550.02306838779345100.988465806103275
530.02149643286446870.04299286572893730.978503567135531
540.01730056708711690.03460113417423380.982699432912883
550.01785875373537650.03571750747075290.982141246264624
560.01729339241876910.03458678483753820.98270660758123
570.01307991390575950.0261598278115190.98692008609424
580.01047251240147250.0209450248029450.989527487598527
590.007255555682847610.01451111136569520.992744444317152
600.00597848203364130.01195696406728260.994021517966359
610.01332870017811530.02665740035623060.986671299821885
620.01040935810383550.02081871620767110.989590641896164
630.007323778859631960.01464755771926390.992676221140368
640.005344174996581610.01068834999316320.994655825003418
650.007031118337029920.01406223667405980.99296888166297
660.00529954651681690.01059909303363380.994700453483183
670.003767358785562140.007534717571124270.996232641214438
680.003610676946608580.007221353893217150.996389323053391
690.002841942427704160.005683884855408320.997158057572296
700.002438616879998440.004877233759996880.997561383120002
710.002322363784599490.004644727569198970.9976776362154
720.001577203130430530.003154406260861060.99842279686957
730.001071590721189960.002143181442379930.99892840927881
740.0009347823317248270.001869564663449650.999065217668275
750.0009975795330832870.001995159066166570.999002420466917
760.0008982382323634970.001796476464726990.999101761767637
770.001995678188068840.003991356376137670.998004321811931
780.001604441745290340.003208883490580680.99839555825471
790.001132679679815460.002265359359630920.998867320320185
800.0009068941474486660.001813788294897330.999093105852551
810.000695484112804170.001390968225608340.999304515887196
820.0004412371480262610.0008824742960525210.999558762851974
830.000278996028143930.000557992056287860.999721003971856
840.0002509912579545710.0005019825159091430.999749008742045
850.0003129160108738470.0006258320217476930.999687083989126
860.0002302482879821750.0004604965759643490.999769751712018
870.0001416265715307270.0002832531430614530.99985837342847
888.61643252772307e-050.0001723286505544610.999913835674723
896.13124823159712e-050.0001226249646319420.999938687517684
903.72037652550894e-057.44075305101788e-050.999962796234745
912.15587383948825e-054.31174767897651e-050.999978441261605
921.26591860769124e-052.53183721538249e-050.999987340813923
937.7567806640116e-061.55135613280232e-050.999992243219336
944.76758459534297e-069.53516919068594e-060.999995232415405
952.67525187449432e-065.35050374898865e-060.999997324748126
961.61987271482474e-063.23974542964949e-060.999998380127285
979.97627442262175e-071.99525488452435e-060.999999002372558
985.8492960533268e-071.16985921066536e-060.999999415070395
991.02787318424971e-062.05574636849942e-060.999998972126816
1005.51563828503417e-071.10312765700683e-060.999999448436172
1015.24598184462626e-071.04919636892525e-060.999999475401816
1022.79064637810829e-075.58129275621658e-070.999999720935362
1031.89404356814963e-073.78808713629926e-070.999999810595643
1041.05184700900442e-072.10369401800884e-070.9999998948153
1055.52017852536342e-081.10403570507268e-070.999999944798215
1062.69002073974219e-085.38004147948439e-080.999999973099793
1072.38182254060788e-084.76364508121576e-080.999999976181775
1081.72165404015729e-073.44330808031457e-070.999999827834596
1099.09569860658574e-081.81913972131715e-070.999999909043014
1104.7835551866908e-089.5671103733816e-080.999999952164448
1112.14388929272571e-084.28777858545142e-080.999999978561107
1129.54739917522224e-091.90947983504445e-080.9999999904526
1134.15281936940829e-098.30563873881658e-090.99999999584718
1142.48698076144857e-094.97396152289713e-090.99999999751302
1151.62082236621088e-093.24164473242177e-090.999999998379178
1162.86491619292225e-095.7298323858445e-090.999999997135084
1171.33050756566045e-092.66101513132091e-090.999999998669492
1181.01824782829770e-092.03649565659539e-090.999999998981752
1193.91524242288586e-107.83048484577172e-100.999999999608476
1200.02579013696119930.05158027392239850.9742098630388
1210.01683668941371040.03367337882742090.98316331058629
1220.01482452484648410.02964904969296810.985175475153516
1230.008923879375050640.01784775875010130.99107612062495
1240.004906526805332820.009813053610665640.995093473194667
1250.00355480777382540.00710961554765080.996445192226175
1260.002321405225807530.004642810451615070.997678594774192
1270.00171530894048850.0034306178809770.998284691059512
1280.6491850179521720.7016299640956550.350814982047828
1290.5585689546083680.8828620907832640.441431045391632
1300.3912830745281230.7825661490562460.608716925471877


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level570.483050847457627NOK
5% type I error level800.677966101694915NOK
10% type I error level850.720338983050847NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/10k4vq1292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/10k4vq1292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/1w3yx1292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/1w3yx1292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/2w3yx1292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/2w3yx1292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/37cxi1292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/37cxi1292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/47cxi1292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/47cxi1292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/57cxi1292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/57cxi1292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/6z3w31292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/6z3w31292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/7z3w31292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/7z3w31292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/8sceo1292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/8sceo1292320405.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/9sceo1292320405.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292320432xov6rgjuuokwcyc/9sceo1292320405.ps (open in new window)


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