Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year...

50
Stat 13, Intro. to Statistical Methods for the Life and Health Sciences. 1. Comparing two proportions using numerical and visual summaries, good or bad year example. 2. Comparing 2 proportions with CIs + testing using simulation, dolphin example. 3. Comparing 2 props. with theory-based testing, smoking and gender example. Read ch5. http://www.stat.ucla.edu/~frederic/13/F18 . Bring a PENCIL and CALCULATOR and any books or notes you want to the exams. The midterm is Tue Nov 6. There is no lecture Thu Nov1 because of faculty retreat. The first exam will be on everything through today. We will do review next class. For gradegrubbing, see syllabus. If you would like a question reevaluated, submit your work and a WRITTEN explanation of why you think you deserve more points and how many more points you think you deserve to your TA. The TA will then give it to me, and I will consider it, and then give it back to the TA to give back to you. 1

Transcript of Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year...

Page 1: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Stat 13, Intro. to Statistical Methods for the Life and Health Sciences.

1. Comparing two proportions using numerical and visual summaries, good or bad year example.

2. Comparing 2 proportions with CIs + testing using simulation, dolphin example.3. Comparing 2 props. with theory-based testing, smoking and gender example.

Read ch5. http://www.stat.ucla.edu/~frederic/13/F18 .Bring a PENCIL and CALCULATOR and any books or notes you want to the exams. The midterm is Tue Nov 6. There is no lecture Thu Nov1 because of faculty retreat. The first exam will be on everything through today. We will do review next class.

For gradegrubbing, see syllabus. If you would like a question reevaluated, submit your work and a WRITTEN explanation of why you think you

deserve more points and how many more points you think you deserve to your TA. The TA will then give it to me, and I will consider it, and then give it back to the TA

to give back to you.

1

Page 2: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Moreaboutconfoundingfactors.

• Aconfoundingfactoristheageofthetwopopulationsingeneral.Leftiesinthe1980swereonaverageyoungerthanrighties.Manyoldleftieswereconvertedtorightiesatinfancy,intheearly20thcentury,butthispracticehassubsided.Thusinthe1980sand1990s,therewererelativelyfewoldleftiesbutmanyyoungleftiesintheoverallpopulation.Thisaloneexplainsthediscrepancy.

Page 3: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Unit2:ComparingTwoGroups

• InUnit1,welearnedthebasicprocessofstatisticalinferenceusingtestsandconfidenceintervals.Wedidallthisbyfocusingonasingleproportion.

• InUnit2,wewilltaketheseideasandextendthemtocomparingtwogroups.Wewillcomparetwoproportions,twoindependentmeans,andpaireddata.

Page 4: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Chapter5:ComparingTwoProportions

5.1:ComparingTwoGroups:CategoricalResponse5.2:ComparingTwoProportions:Simulation-BasedApproach5.3:ComparingTwoProportions:Theory-BasedApproach

Page 5: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

3.Comparingtwoproportionsusingnumericalandvisualsummaries,andthegoodorbadyearexample.

Section5.1

Page 6: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Example5.1:PositiveandNegativePerceptions

• Considerthesetwoquestions:– Areyouhavingagoodyear?– Areyouhavingabadyear?

• Dopeopleanswereachquestioninsuchawaythatwouldindicatethesameanswer?(e.g.YesforthefirstoneandNoforthesecond.)

Page 7: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

PositiveandNegativePerceptions

• Researchersquestioned30students(randomlygivingthemoneofthetwoquestions).

• Theythenrecordedifapositiveornegativeresponsewasgiven.

• Theywantedtoseeifthewordingofthequestioninfluencedtheanswers.

Page 8: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Positiveandnegativeperceptions

• Observationalunits– The30students

• Variables– Questionwording(goodyearorbadyear)– Perceptionoftheiryear(positiveornegative)

• Whichistheexplanatoryvariableandwhichistheresponse variable?

• Isthisanobservationalstudyorexperiment?

Page 9: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Individual TypeofQuestion

Response Individual TypeofQuestion

Response

1 GoodYear Positive 16 GoodYear Positive2 GoodYear Negative 17 BadYear Positive3 BadYear Positive 18 GoodYear Positive4 GoodYear Positive 19 GoodYear Positive5 GoodYear Negative 20 GoodYear Positive6 BadYear Positive 21 BadYear Negative7 GoodYear Positive 22 GoodYear Positive8 GoodYear Positive 23 BadYear Negative9 GoodYear Positive 24 GoodYear Positive10 BadYear Negative 25 BadYear Negative11 GoodYear Negative 26 GoodYear Positive12 BadYear Negative 27 BadYear Negative13 GoodYear Positive 28 GoodYear Positive14 BadYear Negative 29 BadYear Positive15 GoodYear Positive 30 BadYear Negative

RawDatainaSpreadsheet

Page 10: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Two-WayTables

• Atwo-waytableorganizesdata– Summarizestwo categoricalvariables– Alsocalledcontingencytable

• Arestudentsmorelikelytogiveapositiveresponseiftheyweregiventhegoodyearquestion?

GoodYear BadYear TotalPositiveresponse 15 4 19Negativeresponse 3 8 11Total 18 12 30

Page 11: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Two-WayTables

• Conditionalproportionswillhelpusbetterdetermineifthereisanassociationbetweenthequestionaskedandthetypeofresponse.

• Wecanseethatthesubjectswiththepositivequestionweremorelikely torespondpositively.

GoodYear BadYear TotalPositiveresponse 15/18 ≈0.83 4/12≈0.33 19Negativeresponse 3 8 11Total 18 12 30

Page 12: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SegmentedBarGraphs

• Wecanalsousesegmentedbargraphstoseethisassociation betweenthe"goodyear"questionandapositiveresponse.

Page 13: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Statistic

GoodYear BadYear TotalPositiveresponse 15(83%) 4(33%) 19Negativeresponse 3 8 11Total 18 12 30

� Thestatisticwewillmainlyusetosummarizethistableisthedifferenceinproportionsofpositiveresponsesis0.83− 0.33=0.50.

Page 14: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

AnotherStatistic

GoodYear BadYear TotalPositiveresponse 15(83%) 4(33%) 19Negativeresponse 3 8 11Total 18 12 30

� Anotherstatisticthatisoftenused,calledrelativerisk,istheratiooftheproportions:0.83/0.33=2.5.

� Wecansaythatthosewhoweregiventhegoodyearquestionwere2.5timesaslikelytogiveapositiveresponse.

Page 15: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Comparing 2 proportions with CIs and testing using simulation, dolphin example.

Section5.2

Page 16: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins

Example5.2

Page 17: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphinsIsswimmingwithdolphinstherapeuticforpatientssufferingfromclinicaldepression?

• ResearchersAntonioli andReveley (2005),inBritishMedicalJournal,recruited30subjectsaged18-65withaclinicaldiagnosisofmildtomoderatedepression

• Discontinuedantidepressantsandpsychotherapy4weekspriortoandthroughouttheexperiment

• 30subjectswenttoanislandnearHonduraswheretheywererandomlyassignedtotwotreatmentgroups

Page 18: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins• Bothgroupsengagedinonehourofswimmingandsnorkeling

eachday• Onegroupswaminthepresenceofdolphinsandtheother

groupdidnot• Participantsinbothgroupshadidenticalconditionsexceptfor

thedolphins• Aftertwoweeks,eachsubjects’levelofdepressionwas

evaluated,asithadbeenatthebeginningofthestudy• Theresponsevariableiswhetherornotthesubjectachieved

substantialreductionindepression

Page 19: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins

Nullhypothesis:Dolphinsdonothelp.– Swimmingwithdolphinsisnotassociatedwithsubstantialimprovementindepression

Alternativehypothesis:Dolphinshelp.– Swimmingwithdolphinsincreases theprobabilityofsubstantialimprovementindepressionsymptoms

Page 20: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins• Theparameteristhe(long-run)differencebetweenthe

probabilityofimprovingwhenreceivingdolphintherapyandtheprob.ofimprovingwiththecontrol(𝜋dolphins - 𝜋control)

• Sowecanwriteourhypothesesas:H0:𝜋dolphins - 𝜋control=0.Ha:𝜋dolphins- 𝜋control>0.or

H0: 𝜋dolphins= 𝜋control

Ha:𝜋dolphins> 𝜋control

(Note:wearenotsayingourparametersequalanycertainnumber.)

Page 21: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins

Results:

Dolphingroup

Controlgroup

Total

Improved 10(66.7%) 3(20%) 13

DidNot Improve 5 12 17Total 15 15 30

Thedifferenceinproportionsofimproversis:𝒑$𝒅 − 𝒑$𝒄 =0.667– 0.20=0.467.

Page 22: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins

• Therearetwopossibleexplanationsforanobserveddifferenceof0.467.– Atendencytobemorelikelytoimprovewithdolphins(alternativehypothesis).

– The13subjectsweregoingtoshowimprovementwithorwithoutdolphinsandrandomchanceassignedmoreimproverstothedolphins(nullhypothesis).

Page 23: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins

• Ifthenullhypothesisistrue(noassociationbetweendolphintherapyandimprovement)wewouldhavehad13improversand17non-improversregardlessofthegrouptowhichtheywereassigned.

• Underthenullhypothesis,theassignmentdoesn’tmatterandwemightaswellhavejustrandomlyassignedthesubjectstothetwogroups.Thuswecansimulatedatabyrandomlyassigningeachpersontodolphinorcontrol.

Page 24: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins• Wecansimulatethiswithcards– 13cardstorepresenttheimprovers– 17cardsrepresentthenon-improvers

• Shufflethecards– put15inonepile(dolphintherapy)– put15inanother(controlgroup)

Page 25: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins• ComputetheproportionofimproversintheDolphinTherapygroup

• ComputetheproportionofimproversintheControlgroup

• Thedifferenceinthesetwoproportionsiswhatcouldjustaswellhavehappenedundertheassumptionthereisnoassociationbetweenswimmingwithdolphinsandsubstantialimprovementindepression.

Page 26: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

20.0%Improvers66.7%Improvers

DolphinTherapyControlNon-

improver

Improver

Improver

Improver

Improver

Improver

Improver

Improver

ImproverImprover

Improver

Improver

Improver

ImproverNon-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

40.0%Improvers 46.7%Improvers0.400– 0.467=-0.067

DifferenceinSimulatedProportions

Page 27: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

33.3%Improvers53.3%Improvers 46.7%Improvers40.0%Improvers

Non-improver

Improver

Non-improver

Improver

Improver

Non-improver

Improver

Improver

ImproverNon-improver

Non-improver

Non-improver

Non-improver

ImproverNon-improver

Non-improver

Improver

Improver

Non-improver

Non-improver

Non-improver

Improver

ImproverImprover

Improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

0.533– 0.333=0.200

DifferenceinSimulatedProportions

DolphinTherapy Control

Page 28: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

53.3%Improvers 33.3%Improvers40.0%Improvers46.7%Improvers

Non-improver

Improver

Non-improver

Improver

Improver

Non-improver

Improver

Improver

ImproverNon-improver

Non-improver

Non-improver

Non-improver

ImproverNon-improver

Non-improver

Improver

Improver

Non-improver

Non-improver

Non-improver

Improver

ImproverImprover

Improver

Non-improver

Non-improver

Non-improver

Non-improver

Non-improver

0.467– 0.400=0.067

DifferenceinSimulatedProportions

DolphinTherapyControl

Page 29: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

MoreSimulations-0.067-0.333 -0.200

0.067 0.2000.333

0.467-0.200

-0.200

-0.200-0.067 -0.067

-0.067

-0.067 -0.067-0.067

0.067

0.067

0.067

0.067

0.067

0.0670.200

0.200

0.200

0.3330.333Onlyonesimulatedstatisticsoutof30wasas

largeorlargerthanourobserveddifferenceinproportionsof0.467,henceourp-valueforthisnulldistributionis1/30≈0.03.

DifferenceinSimulatedProportions

Page 30: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins• Wedid1000repetitionstodevelopanulldistribution.

Page 31: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins

• 13outof1000resultshadadifferenceof0.467orhigher(p-value=0.013).

• 0.467is(.*+,-((../0

≈ 2.52 SEsabovezero.� Usingeitherthep-valueorstandardizedstatistic,wehavestrongevidenceagainstthenullandcanconcludethattheimprovementduetoswimmingwithdolphinswasstatisticallysignificant.

Page 32: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins

� A95%confidenceintervalforthedifferenceintheprobabilityusingthestandarderrorof0.185fromthesimulationsis0.467+ 1.96(0.185)=0.467+0.363or(0.104to0.830)

• Weare95%confidentthatwhenallowedtoswimwithdolphins,theprobabilityofimprovingisbetween0.104and0.830higherthanwhennodolphinsarepresent.

• Howdoesthisintervalbackupourconclusionfromthetestofsignificance?

• Seeif0isintheinterval.

Page 33: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SwimmingwithDolphins

• Canwesaythatthepresenceofdolphinscaused thisimprovement?– Sincethiswasarandomizedexperiment,andassumingeverythingwasidenticalbetweenthegroups,wehavestrongevidencethatdolphinswerethecause

• Canwegeneralizetoalargerpopulation?– Maybemildtomoderatelydepressed18-65yearoldpatientswillingtovolunteerforthisstudy

– Wehavenoevidencethatrandomselectionwasusedtofindthe30subjects."Outpatients,recruitedthroughannouncementsontheinternet,radio,newspapers,andhospitals."

Page 34: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Comparing TwoProportions:Theory-BasedApproach,andsmokingandgenderexample.

Section5.3

Page 35: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Introduction

• Justaswithasingleproportion,wecanoftenpredictresultsofasimulationusingatheory-basedapproach.

• Thetheory-basedapproachalsogivesasimplerwaytogenerateconfidenceintervals.

• ThemainnewmathematicalfacttouseistheSEforthedifferencebetweentwoproportionsis45(.-45)89

+ 45(.-45)8;

� fortesting

or 459(.-459)89

+ 45;(.-45;)8;

� forCIs.

Page 36: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Aclarificationonthenewformula• Themarginoferrorforthedifferenceinproportionsis

𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑒𝑟 ⨯ SE,whereSE = 459(.-459)89

+ 45;(.-45;)8;

� .

Intesting,thenullhypothesisisnodifferencebetweenthetwogroups,soweusetheSE

�̂�(1 − �̂�)𝑛.

+�̂�(1 − �̂�)

𝑛Q

where�̂� isthepooledproportioninbothgroupscombined.

ButinCIs,weusetheformula 459(.-459)89

+ 45;(.-45;)8;

becausewearenotassuming�̂�. =�̂�QwithCIs.

Page 37: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Parents’SmokingStatusandtheirBabies’Gender

Example5.3

Page 38: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender

• Howdoesparents’behavioraffectthegenderoftheirchildren?

• Fukudaetal.(2002)foundthefollowinginJapan.– Outof565birthswherebothparentssmokedmorethan

apackaday,255wereboys.Thisis45.1%boys.– Outof3602birthswherebothparentsdidnotsmoke,

1975wereboys.This54.8%boys.– Intotal,outof4170births,2230wereboys,whichis

53.5%.• Otherstudieshaveshownareducedmaletofemale

birthratiowherehighconcentrationsofotherenvironmentalchemicalsarepresent(e.g.industrialpollution,pesticides)

Page 39: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender• A segmentedbargraphand2-waytable• Wewillcomparetheproportionstoseeifthedifference

isstatisticallysignificant.

BothSmoked Neither Smoked

Boy 255(45.1%) 1,975(54.8%)

Girl 310 1,627

Total 565 3,602

Page 40: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender

NullHypothesis:• Thereisnoassociationbetween

smokingstatusofparentsandsexofchild.

• Theprobabilityofhavingaboyisthesameforparentswhosmokeanddon’tsmoke.

• 𝜋smoking - 𝜋nonsmoking =0

Page 41: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender

AlternativeHypothesis:• Thereisanassociationbetweensmokingstatusofparentsandsexofchild.

• Theprobabilityofhavingaboyisnotthesameforparentswhosmokeanddon’tsmoke

• 𝜋smoking - 𝜋nonsmoking ≠0

Page 42: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender

• Whataretheobservationalunitsinthestudy?• Whatarethevariablesinthisstudy?• Whichvariableshouldbeconsideredtheexplanatoryvariableandwhichtheresponsevariable?

• Whatistheparameterofinterest?• Canyoudrawcause-and-effectconclusionsforthisstudy?

Page 43: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender

Usingthe3SStrategytoassesthestrength1.Statistic:• Theproportionofboysborntononsmokersminustheproportionofboysborntosmokersis0.548– 0.451=0.097.

Page 44: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender

2.Simulate:• Simulatemanyrepetitionsofrandomlyshufflingthe2230boysand1937girlstothe565smokingand3602nonsmokingparents

• Calculatethedifferenceinproportionsofboysbetweenthegroupsforeachrepetition.

• Shufflingsimulatesthenullhypothesisofnoassociation

Page 45: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender3.Strengthofevidence:• Nothingasextremeas

ourobservedstatistic(≥0.097or≤−0.097)occurredin5000repetitions,

• HowmanySEsis0.097abovethemean?Z=0.097/0.023=4.22usingsimulations.Whataboutusingthetheory-basedapproach?

Page 46: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender

• Noticethenulldistributioniscenteredatzeroandisbell-shaped.

• Thiscanbeapproximatedbythenormaldistribution.

Page 47: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Formulas

• Thetheory-basedapproachyieldsz=4.30.

𝑧 =�̂�. − �̂�Q

�̂�(1 − �̂�) 1𝑛.+ 1𝑛Q

• Here𝑧 = .0*/-.*0.

.0X0(.-.0X0) 9YZ[;\

9]Z]

�=4.30.

• Thep-valueis2*(1-pnorm(4.30))=0.00171%.

Page 48: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender

• Fukudaetal.(2002)foundthefollowinginJapan.– Outof3602birthswherebothparentsdidnotsmoke,

1975wereboys.This54.8%boys.– Outof565birthswherebothparentssmokedmorethan

apackaday,255wereboys.Thisis45.1%boys.– Intotal,outof4170births,2230wereboys,whichis

53.5%boys.

Page 49: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

Formulas• Howdowefindthemarginoferrorforthedifferencein

proportions?

𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑒𝑟 ⨯�̂�.(1 − �̂�.)

𝑛.+�̂�Q(1 − �̂�Q)

𝑛Q

• Herenislargeandobs.areiid,soweusethemultipliersfromthenormaldistribution.1.645for90%confidence1.96for95%confidence2.576for99%confidence

• Wecanwritetheconfidenceintervalintheform:– statistic± marginoferror.

Page 50: Stat 13, Intro. to Statistical Methods for the Life and ...frederic/13/F18/13day09.pdf · Good Year Bad Year Total Positive response 15/18 ≈ 0.83 4/12 ≈ 0.33 19 Negative response

SmokingandGender• Ourstatisticistheobservedsampledifferenceinproportions,

0.097.

• Pluggingin1.96 ⨯ 459(.-459)89

+ 45;(.-45;)8;

� =0.044,

weget0.097± 0.044asour95%CI.• Wecouldalsowritethisintervalas(0.053,0.141).• Weare95%confidentthattheprobabilityofaboybaby

whereneitherfamilysmokesminustheprobabilityofaboybabywherebothparentssmokeisbetween0.053and0.141.