Sie sind auf Seite 1von 3

STATS330

ModelanswersforFinalExam2006,PartB

B1(a)Wedetectdeparturesby(i)plottingresidualsversusfittedvaluesandlookingfor
afunneleffect,or(ii)plottingsquaredresidualsagainstfittedvaluesandsmoothing.

Twowaystodealwiththeproblem:(i)transformtheresponsetostabilisethevariance,
or(ii)useweightedleastsquares.

Consequence:standarderrorsarewrong.

B1(b)Leaveoneoutdiagnosticsare

DFBETAS:standardiseddifferenceincoefficientsmeasureseffectonaparticular
coefficient
CooksD:measuresoveralleffectonthecoefficients
DFFITS:standardiseddifferenceinfittedvaluemeasureseffectonthefittedvalue
COVRATIO:measureseffectonthestandarderrors

NoteHMDsarenotleaveoneoutdiagnostics,theymeasureleverage.

B1(c)Point19:Minoreffectontheconstantterm,coeffoflime,standarderrors.Abig
residual,butnothighleverage.
Point21:Minoreffectonthecow.den,fittedvalue.Asmallresidual,buthighleverage.
Point33:Effectonconstant,prop,fittedvalue.Abigresidual,butlowleverage.
Point42:Slighteffectonprop.Abigresidual,butlowleverage.
Point66:Effectoncow.den.Lowleverage.

Points19,21,33seemtobehavingthebiggesteffects,althoughtheyarenot
catastrophic.However,thereisnoreallystrongreasontoremovethem,unlesstheycan
beshowntobetheresultoftypographicalerrors.Removingthemmakestheregression
appeartobebetterthanitreallyis.

Anotherpossibilityisthattheoutliersmayceasetobeaproblemaftera
transformation.Thereisahintofcurvatureintheresiduals/fittedvalueplot.A
transformationmaymeanthatthepointsarenolongeroutlyingafterthe
transformation.

B2(a)Themodelsurvived~age.gp*pclass*sexseemstofitverywell,asanevensmaller
modelischosenbythestepwisealgorithm.Notethatdataareinungroupedform,so
thepvalueisnotreliable.Itisclearfromtheanovaoutputthatthe3factoractionis
notrequired,andthattheinteractionbetweenageandclassisalsonotsignificant,
althoughitisincludedinthemodelselectedbystep.Thus,eitherofthemodels
survived~av.age.gp+pclass+sex+av.age:pclass+sex:av.age+sex:pclassor
survived~av.age+pclass+sex+sex:av.age+sex:pclass
seemOK.

B2(b)Forafirstclasspassenger,thelogoddsofsurvivalis2.48940+0.01283*av.age,
astheothermaineffectsandinteractiontermsvanishassexandclassareattheir
baselines.Foragegroup3034,thelogoddsofsurvivalisis2.48940+
0.01283*33.84137=2.923585,andtheprobabilityisexp(2.923585)/(1+exp(2.923585))
=0.949.

B2(c)Ifwetreatageasafactor,thentheeffectofageonthelogoddsisnolonger
constrainedtobelinear.Thismeansthattheprobabilitiesarefarlessconstrained.If
ageistreatedasanumericvariable,themodelconsistsof6straightlines,oneforeach
class/sexcombination.Thisisnotasgeneralastreatingageasafactor.Inthecaseof
themodelsurvived~age.gp*pclass*sex,thelogoddsandprobabilitiesarecompletely
unconstrained.

B2(d)Themodeltreatingageasanumericvariablewouldconstrainthetracesinthe
Figuretobestraightlines.Themodeltreatingageafactorallowsthetracestoassume
anyshapesuggestedbythedata.Wecanseethatstraightlinesarenotappropriatefor
someofthetraces,e.g.female1stclass,male2ndclass.

B3(a)FitaPoissonregressionmodelcounts~V*SusingthecountsasresponsesandV
andS(sex)astheexplanatoryvariables.Totestifthemaleandfemalepopulations
differintheirvotingbehaviour,testforazerointeractioninthemodel.

B3(b)FitaPoissonregressionmodelusingthecountsasresponsesandV,IandS(sex)
astheexplanatoryvariables.TotestifthejointdistributionofVandIisthesameinthe
twopopulations,testifthemodelcounts~S+V*Ifitswell(i.e.ifVandIare
independentofS)

B3(c)Partypreferencedoesnotdifferbetweenthesexes,astheaffil:sexinteractionis
notsignificant.

B3(d)Weneedtotestifsupportisindependentofsexandstatusi.e.ifthemodel
count~support+sex*statusfitswell.Theoutputindicatesthatitdoesnt,sosupport
doesdependonsexandstatus.

Das könnte Ihnen auch gefallen