Home » date » 2010 » Nov » 23 »

WS7 - Minitutorail blog 3

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Nov 2010 19:17:19 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm.htm/, Retrieved Tue, 23 Nov 2010 20:16:55 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
12 6 15 4 7 2 2 2 2 9 11 6 15 3 5 4 1 2 2 9 14 13 14 5 7 7 4 3 4 9 12 8 10 3 3 3 1 2 3 9 21 7 10 6 7 7 5 4 4 9 12 9 12 5 7 2 1 2 3 9 22 5 18 6 7 7 1 2 3 9 11 8 12 6 1 2 1 3 4 9 10 9 14 5 4 1 1 2 3 9 13 11 18 5 5 2 1 2 4 9 10 8 9 3 6 6 2 3 3 9 8 11 11 5 4 1 1 2 2 9 15 12 11 7 7 1 3 3 3 9 10 8 17 5 6 1 1 1 3 9 14 7 8 5 2 2 1 3 3 9 14 9 16 3 2 2 1 1 2 9 11 12 21 5 6 2 1 3 3 9 10 20 24 6 7 1 1 2 2 9 13 7 21 5 5 7 2 3 4 9 7 8 14 2 2 1 4 4 5 9 12 8 7 5 7 2 1 3 3 9 14 16 18 4 4 4 2 3 3 9 11 10 18 6 5 2 1 1 1 9 9 6 13 3 5 1 2 2 4 9 11 8 11 5 5 1 3 1 3 9 15 9 13 4 3 5 1 3 4 9 13 9 13 5 5 2 1 3 3 9 9 11 18 2 1 1 1 2 3 9 15 12 14 2 1 3 1 2 1 9 10 8 12 5 3 1 1 3 4 9 11 7 9 2 2 2 2 2 4 9 13 8 12 2 3 5 1 2 2 9 8 9 8 2 2 2 1 2 2 9 20 4 5 5 5 6 1 1 1 9 12 8 10 5 2 4 1 2 3 9 10 8 11 1 3 1 1 3 4 9 10 8 11 5 4 3 1 1 1 9 9 6 12 2 6 6 1 2 3 9 14 8 12 6 2 7 2 3 3 9 8 4 15 1 7 4 1 2 2 9 14 7 12 4 6 1 2 1 4 9 11 14 16 3 5 5 1 1 3 9 13 10 14 2 3 3 1 3 3 9 11 9 17 5 3 2 2 3 2 9 11 8 10 3 4 2 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'George Udny Yule' @ 72.249.76.132
R Framework
error message
The field 'Names of X columns' contains a hard return which cannot be interpreted.
Please, resubmit your request without hard returns in the 'Names of X columns'.


Multiple Linear Regression - Estimated Regression Equation
Depression[t] = + 3.57528362188804 + 0.0487723304199297CriticParents[t] -0.0653193315455429ExpecParents[t] + 0.583907859497645FutureWorrying[t] + 0.209150813801292SleepDepri[t] + 0.344831674824937ChangesLastYear[t] -0.0957309283109171FreqSmoking[t] + 0.278761636850479FreqHighAlc[t] + 0.219683555262319FreqBeerOrWine[t] + 0.41893516356332`Month `[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)3.575283621888045.1041940.70050.4848460.242423
CriticParents0.04877233041992970.1163240.41930.6756780.337839
ExpecParents-0.06531933154554290.08672-0.75320.452630.226315
FutureWorrying0.5839078594976450.1685173.4650.0007110.000356
SleepDepri0.2091508138012920.1416641.47640.142170.071085
ChangesLastYear0.3448316748249370.1358652.5380.0122830.006142
FreqSmoking-0.09573092831091710.275714-0.34720.7289730.364487
FreqHighAlc0.2787616368504790.315510.88350.3785230.189261
FreqBeerOrWine0.2196835552623190.2934060.74870.4553190.22766
`Month `0.418935163563320.5235450.80020.4250070.212504


Multiple Linear Regression - Regression Statistics
Multiple R0.457575654121686
R-squared0.209375479244889
Adjusted R-squared0.156667177861214
F-TEST (value)3.97234351607735
F-TEST (DF numerator)9
F-TEST (DF denominator)135
p-value0.000162058967582701
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.90350467507246
Sum Squared Residuals1138.09581875263


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11211.95332311514770.0466768848522711
21111.7365079060082-0.736507906008179
31415.1947818840083-1.19478188400829
41211.61719947741050.382800522589452
52115.93036379570815.06963620429189
61213.1949204441149-1.19492044411492
72214.91598136678437.08401863321572
81112.9735962824977-1.97359628249768
91012.0919976647950-2.09199766479502
101312.70193104334130.298068956658741
111013.5274969833744-3.52749698337435
12812.1658167650092-4.16581676500919
131514.31684059131930.683159408680745
141011.9868073304906-1.98680733049057
151412.59166067730131.40833932269875
161410.22162813781823.7783718621818
171112.822974274514-1.82297427451401
181012.9669767295980-2.96697672959802
191314.2180728096892-1.21807280968916
20710.5828977275724-3.58289772757242
211213.7515064082732-1.75150640827319
221412.80574452506911.19425547493091
231112.2992542697815-1.29925426978154
24911.1762877268382-2.17628772683818
251111.9781106493407-0.9781106493407
261513.24203021445421.75796978554582
271312.99006112181730.00993887818272487
2899.5490889795559-0.549088979555896
291510.10943487528324.89056512471677
301012.4631583757777-2.46315837577768
311110.61980875736370.380191242636305
321311.37263274920941.62736725079062
33810.4390365675354-2.43903656753538
342013.65119043715616.34880956284388
351212.9206960574295-0.92069605742949
361010.1928462693326-0.192846269332646
371012.2107179312865-2.21071793128648
38912.4670557598607-3.46705575986066
391414.5914909868504-0.591490986850424
40810.8894491537756-2.88944915377562
411411.80467642525212.19532357474789
421112.3471208110589-1.34712081105886
431311.14832058942111.85167941057892
441111.9950676844593-0.995067684459282
451111.7602802532374-0.76028025323739
461012.022737041715-2.022737041715
471410.49321121516863.5067887848314
481813.59866660367264.40133339632736
491412.38531476969041.61468523030963
501112.8792701052554-1.87927010525538
511211.23992428556050.760075714439515
521312.95783579252300.042164207477042
53913.6333342612761-4.63333426127614
541012.1190206854671-2.11902068546714
551513.37529107495081.62470892504915
562013.92972826907106.07027173092905
571211.49334878667140.506651213328632
581211.84409739689490.155902603105073
591411.1379613641272.86203863587299
601314.7716651111975-1.77166511119747
611114.5449237881039-3.54492378810391
621713.45039208131223.54960791868781
631212.4077588600124-0.407758860012392
641313.0464947493062-0.0464947493062124
651414.0165698714801-0.0165698714801257
661310.92970688130122.07029311869878
671514.05845189330570.94154810669432
681312.11153629280850.888463707191539
691013.7865150405731-3.78651504057308
701111.4674111337216-0.467411133721637
711312.93154899213670.0684510078632942
721714.32135871289942.67864128710062
731313.0819489180606-0.0819489180606048
74912.1870200286794-3.18702002867938
751112.5150377167482-1.51503771674821
761010.4214916885705-0.421491688570493
77910.4375160260926-1.43751602609263
781211.48585234366200.514147656337974
791212.5846485397974-0.584648539797394
801312.48100745748690.518992542513072
811312.54917908884010.45082091115986
822214.67526677788437.32473322211569
831312.08616728403150.913832715968464
841513.86109482205371.13890517794630
851314.2571287471371-1.25712874713711
861511.74152115978773.25847884021226
871011.7572104598007-1.75721045980065
881110.94391917181460.0560808281854015
891614.25458303005281.74541696994719
901112.0969226922594-1.09692269225940
911112.4886531309515-1.48865313095152
921012.7440907661687-2.7440907661687
931014.6275953538625-4.62759535386246
941614.24417913325781.75582086674217
951213.4379495945200-1.43794959451998
961113.9211569602615-2.92115696026154
971614.46684070488521.53315929511485
981915.01359440773713.9864055922629
991114.9549427180191-3.95494271801909
1001512.74674979133972.2532502086603
1012416.56547669236197.4345233076381
1021411.67184406414912.32815593585087
1031513.61786553579851.38213446420149
1041114.9018027041945-3.90180270419452
1051513.49605637842551.50394362157449
1061212.9193610665679-0.91936106656788
1071010.8141552461896-0.814155246189576
1081413.89708225219930.102917747800676
109912.8565796395828-3.85657963958282
1101510.66700239783734.33299760216274
111159.768401177183115.23159882281689
1121413.07338033346390.926619666536133
1131114.1722117496141-3.17221174961414
114814.3678314589529-6.36783145895287
1151114.2391592631075-3.23915926310749
116811.7883536510655-3.7883536510655
1171011.2820620724470-1.28206207244703
1181113.6154650677525-2.61546506775249
1191314.0867271285035-1.08672712850354
1201113.7609378831198-2.76093788311982
1212012.72065240391617.27934759608392
1221012.1998906866310-2.19989068663104
1231210.93008570651901.06991429348097
1241412.53793708066191.46206291933814
1252313.94413181445839.05586818554169
1261412.92740045522641.07259954477358
1271615.20969723086050.790302769139498
1281113.4278088667962-2.42780886679623
1291214.1771717857407-2.17717178574068
1301013.6412497455121-3.64124974551207
1311413.79683178962230.203168210377721
132129.820800972660932.17919902733907
1331213.6239633838582-1.62396338385822
1341110.16955161123810.830448388761868
1351212.3549832889945-0.354983288994520
1361315.7227265786984-2.72272657869835
1371716.29778335280860.702216647191386
1381111.9781106493407-0.9781106493407
1391213.6294305470718-1.62943054707183
1401914.65364000149604.34635999850403
1411513.86109482205371.13890517794630
1421413.41200169396150.587998306038517
1431113.6154650677525-2.61546506775249
144910.5268165962368-1.52681659623684
1451811.75483194548046.2451680545196


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
130.4637201706301410.9274403412602810.53627982936986
140.5952444913459270.8095110173081450.404755508654073
150.5265028486263570.9469943027472860.473497151373643
160.6602717809595140.6794564380809720.339728219040486
170.5726639193870630.8546721612258740.427336080612937
180.479447353841960.958894707683920.52055264615804
190.5784068068151730.8431863863696540.421593193184827
200.5018286167929780.9963427664140430.498171383207022
210.4279419719517810.8558839439035620.572058028048219
220.4707602454431160.9415204908862310.529239754556884
230.5128647640587920.9742704718824150.487135235941208
240.4357604849056630.8715209698113250.564239515094337
250.3735513205951440.7471026411902880.626448679404856
260.3277019447076830.6554038894153660.672298055292317
270.2713629061445810.5427258122891620.728637093855419
280.2303003436266970.4606006872533940.769699656373303
290.2926487078533100.5852974157066190.70735129214669
300.2466761942961360.4933523885922720.753323805703864
310.2045839083742830.4091678167485670.795416091625717
320.1625415434616970.3250830869233940.837458456538303
330.1556483682733350.3112967365466690.844351631726665
340.1750825233617860.3501650467235730.824917476638214
350.1763791338087960.3527582676175920.823620866191204
360.1803738276973400.3607476553946800.81962617230266
370.2224985394582270.4449970789164550.777501460541773
380.276366770286340.552733540572680.72363322971366
390.2998651625891390.5997303251782770.700134837410861
400.2920635343481180.5841270686962350.707936465651882
410.3029350395372970.6058700790745930.697064960462703
420.2703134736789460.5406269473578920.729686526321054
430.268229010048010.536458020096020.73177098995199
440.2300893344797700.4601786689595410.76991066552023
450.1931312189121770.3862624378243540.806868781087823
460.1715187841219480.3430375682438960.828481215878052
470.1760469334091060.3520938668182130.823953066590894
480.2790615801497180.5581231602994360.720938419850282
490.2615657704759280.5231315409518560.738434229524072
500.2332706536926910.4665413073853820.766729346307309
510.1980453493418600.3960906986837190.80195465065814
520.1628703396965520.3257406793931040.837129660303448
530.2408038356936150.4816076713872310.759196164306385
540.2395660507561540.4791321015123080.760433949243846
550.2200516942811340.4401033885622680.779948305718866
560.2994222459943410.5988444919886820.700577754005659
570.2610795472515130.5221590945030250.738920452748487
580.2334301793564080.4668603587128150.766569820643592
590.2086404004822610.4172808009645210.79135959951774
600.2250358916307210.4500717832614420.774964108369279
610.1903703634290960.3807407268581920.809629636570904
620.3137657485431290.6275314970862590.686234251456871
630.2693726411025580.5387452822051170.730627358897442
640.2305632143239470.4611264286478940.769436785676053
650.1952606041545970.3905212083091950.804739395845403
660.1804686586894320.3609373173788630.819531341310568
670.152659433835620.305318867671240.84734056616438
680.1275994423602250.2551988847204490.872400557639775
690.1402131727266770.2804263454533540.859786827273323
700.1139938675258510.2279877350517020.886006132474149
710.09146604001725560.1829320800345110.908533959982744
720.09524699831786970.1904939966357390.90475300168213
730.07571599172908260.1514319834581650.924284008270917
740.0768564707394020.1537129414788040.923143529260598
750.0634036765250130.1268073530500260.936596323474987
760.05059604465794870.1011920893158970.949403955342051
770.04399038702619130.08798077405238260.956009612973809
780.03387350422724360.06774700845448720.966126495772756
790.02567776454748700.05135552909497410.974322235452513
800.01943349832330360.03886699664660710.980566501676696
810.01492666673748990.02985333347497980.98507333326251
820.07444448470947540.1488889694189510.925555515290525
830.05870097275976320.1174019455195260.941299027240237
840.04621591346932740.09243182693865490.953784086530673
850.03732530172833940.07465060345667870.96267469827166
860.03693791414450120.07387582828900240.96306208585550
870.0316240126081120.0632480252162240.968375987391888
880.02348055725333520.04696111450667050.976519442746665
890.02009463699695640.04018927399391280.979905363003044
900.01584518799486060.03169037598972130.98415481200514
910.0130410392144740.0260820784289480.986958960785526
920.01285849724002510.02571699448005010.987141502759975
930.01915086958502570.03830173917005140.980849130414974
940.01507946074647940.03015892149295880.98492053925352
950.01179797367171770.02359594734343540.988202026328282
960.01218914695929230.02437829391858470.987810853040708
970.01070918737764480.02141837475528970.989290812622355
980.01667734671994090.03335469343988180.98332265328006
990.01903697000667880.03807394001335750.98096302999332
1000.01560051308192420.03120102616384840.984399486918076
1010.07606437021256820.1521287404251360.923935629787432
1020.06810505844955270.1362101168991050.931894941550447
1030.05552746853631090.1110549370726220.944472531463689
1040.05747744010703630.1149548802140730.942522559892964
1050.04645803732344650.0929160746468930.953541962676554
1060.03547682425511000.07095364851022010.96452317574489
1070.0300394377221730.0600788754443460.969960562277827
1080.02170561073824370.04341122147648740.978294389261756
1090.01989001787121160.03978003574242320.980109982128788
1100.02865836839145270.05731673678290540.971341631608547
1110.03683109416873650.0736621883374730.963168905831264
1120.02711483349882650.0542296669976530.972885166501174
1130.02602313440957990.05204626881915970.97397686559042
1140.04800504415050550.0960100883010110.951994955849495
1150.04842185331817280.09684370663634560.951578146681827
1160.07648242473866560.1529648494773310.923517575261334
1170.05806998345665780.1161399669133160.941930016543342
1180.04770625947701880.09541251895403770.95229374052298
1190.03392634804303350.0678526960860670.966073651956966
1200.04021469141427250.0804293828285450.959785308585728
1210.1745520494551040.3491040989102080.825447950544896
1220.1960998437506350.3921996875012710.803900156249365
1230.1473951014210450.2947902028420910.852604898578955
1240.125029829657890.250059659315780.87497017034211
1250.5384878300948490.9230243398103020.461512169905151
1260.8921427793204410.2157144413591180.107857220679559
1270.8956196322308920.2087607355382150.104380367769108
1280.8465940786815320.3068118426369360.153405921318468
1290.8389512459979270.3220975080041460.161048754002073
1300.793598623941030.412802752117940.20640137605897
1310.7414002338059570.5171995323880850.258599766194043
1320.5948431350166270.8103137299667450.405156864983373


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level170.141666666666667NOK
10% type I error level360.3NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/10u2yd1290539827.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/10u2yd1290539827.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/2ys041290539827.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/2ys041290539827.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/3ys041290539827.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/3ys041290539827.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/4ys041290539827.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/4ys041290539827.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/71aga1290539827.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/71aga1290539827.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/81aga1290539827.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290539805d25mauq54av2gdm/81aga1290539827.ps (open in new window)


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