Two sample ttest.ppt_第1页
Two sample ttest.ppt_第2页
Two sample ttest.ppt_第3页
Two sample ttest.ppt_第4页
Two sample ttest.ppt_第5页
已阅读5页,还剩37页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

comparisonoftwosamples summerprogrambrianhealy previousclasses hypothesistestingnullandalternativehypothesesteststatisticp valueconclusionconfidenceintervalscomparisonofcitohypothesistestpowerandsamplesize whatarewedoingtoday two samplet testpairedt testindependentsamplesequalvarianceunequalvariancesamplesizefortwosamples bigpicture uptothispoint wehaveonlyconcernedourselveswithonesample oftenwewanttocompareonegrouptoanother whathappenswhenwearecomparingtwosamples variabilityinbothsamples andpotentiallytwosamplesarerelatedmuchofthetheoryisthesame example oneofthefirststudiesianalyzedwasatumorsizestudy havinganaccuratemeasureoftumorsizeisextremelyimportantbecauseitallowsaphysiciantoaccuratelydetermineifatumorisgrowing shrinkingorremainingconstant theproblemisthatoftenthemeasurementsofthetumorsizevaryfromphysiciantophysician inthepast tumorsizewasmeasuredusingthelineardistanceacrossthetumor butthiswasfoundtobeveryvariablebecauseoftheirregularshapeofsometumors anewmethodcalledtherecistcriteriatracestheoutsideofthetumor therecistmethodwasbelievedtogivemoreconsistentmeasuresofthevolumeofthetumor availabledata foraportionofthestudy apairofdoctorswereshownthesamesetoftumorpictures thevolumeofthetumorwasmeasuredbytwoseparatephysiciansundersimilarconditions questionofinterest didthemeasurementsfromthetwophysicianssignificantlydiffer ifnot thentherewouldbenoevidencethatthevolumemeasurementschangebasedonphysician 20scansweremeasuredbyeachphysician 10areshownhere measurementsincm3whatcanyousayaboutthesesamples twomeasurementonthesamepersontheyarerelatedsowemustaccountforthismuchresearchinstatisticsdealswithhowtohandlecorrelateddata butinthiscaseitisprettyeasy dependentsample wecanmeasuretheeffectofthetreatmentineachpersonbytakingthedifferenceinsteadofhavingtwosamples wecanconsiderourdatasettobeonesampleofdifferencesjustliketheonesampleproblem differences volumefromdr 1populationmean samplemean volumefromdr 2populationmean samplemean differencepopulationmean samplemean distributionofdifferences assumingdi sarenormallydistributed canuset distributionwithn 1dofwherenisthenumberofdifferencesstandarddeviationofdifferencesteststatisticactsjustlikeonesample picture wecanseethattheassumptionofnormalityofthedifferencesisreasonableinthiscase pairedt test nullhypothesis nodifferencebetweenphysicianseffecttwodependentsamples alpha 0 05teststatistic t statisticwithdofp value 0 53failtorejectnullhypothesisconclusion thereisnoevidenceofadifferenceintumorvolumemeasurementbasedonphysician confidenceinterval confidenceintervalforpairedt testconstructedinthesamewayasone samplet testforourexample theconfidenceintervalis 1 010 54 notethattheconclusionfromthehypothesistestandtheconfidenceintervalarethesame pairedt testinr usingthehelpmenu determinehowtocompletethepairedt testinr pairedt testinr data read table p pairedscans dat header f dr1 data 1 dr2 data 2 t test dr1 dr2 paired t theoutputprovidesthep valueandtheconfidenceintervalpairedt testdata data 1 anddata 2 t 0 6456 df 19 p value 0 5262alternativehypothesis truedifferenceinmeansisnotequalto095percentconfidenceinterval 1 01802790 5380279sampleestimates meanofthedifferences 0 24 extensions someadditionalexamplesofpairedsamplesare differencesbetweenleftandrighteyedifferencesbetweendominantandrecessivehandmatchedsampleswhenyouhavemorethantwosamples techniquesaccountforthecorrelationbetweenthesamplesmultivariate longitudinaldata unpairedsamples oftenitisimpracticaltodesignstudytousethesamepatientsforbothgroupex comparisonofcholesterolinmalesandfemalesex timeconstraintssincethesamplesarenotpaired wecannotusethedifferencebetweentheindividualsamplesmustadjustpreviousanalysis example anotheraspectofthetumorvolumestudywastryingtocomparethetumorvolumeamongpatientswithdifferentformsofcancer theaveragetumorsizeisimportanttoknowtheeffectoftreatmentcanbedetermined inthisstudy patientswithbrain breastandlivertumors butinitiallywewillonlycomparethebrainandbreastcancers allofthetumorsweremeasuredusingtherecistmethod nullhypothesis thenullhypothesisisthatthereisnodifferencebetweenthevolumeofthetumorinthetwoformsofcancerh0 mbrain mbreast ormbrain mbreast 0moregenerally wecantestifthedifferencebetweentwogroupsisaspecificvalue m1 m2 dthisoccurswhencomparingtwotreatmentgroupsandweareinterestedifthetwogroupsaredifferentbyaspecificamount eachpatientcontributesoneobservationcanestimatefromthesamplemeanandstandarddeviationinbraincancergroupwithmeanandstandarddeviationinbreastcancergroupwitharethetwogroupsthesame h0 m1 m2 orm1 m2 0todeterminethis wearegoingtolookatwealsoneedtoknow differenceinthesamplemeans wearegoingtousethedifferenceofthemeansasourteststatistic butweneedtoestimatethevarianceofthisdifferencetodetermineifthedifferenceissignificantbasicformofteststatistic standarddeviationsknownunknowntheestimateofthestandarddeviationchangeswhenthesampleshaveequalvarianceorthesampleshaveunequalvariance equalvariance sometimeswewillbewillingtoassumethatthevarianceinthetwogroupsisequal ifweknowthisvariance wecanusethez statisticoftenwehavetoestimates2withthesamplevariancefromeachofthesamples sincewehavetwoestimatesofonequantity wepoolthetwoestimates equalvariancecontinued theestimateofsisgivenby thet statisticbasedonthepooledvarianceisverysimilartothez statisticasalways thet statistichasat distributionwithdegreesoffreedom forthetumorvolumestudy therewere20braincancersubjectsand28breastcancersubjectsthesummarystatisticsandhistogramforthedataaregivenherewhatcanyousayaboutthedistributions doestheequalvarianceassumptionseemvalidinthiscase hypothesistest h0 meanbraintumorsize meanbreasttumorsizetwoindependentsampleswithequalvariance alpha 0 05p value 0 046rejectnullhypothesisconclusion thereisasignificantdifferenceinthesizeofbrainandbreastcancertumors rcode ifweonlyhadtheteststatisticsabove wecancalculatetheteststatisticandthencompareittothet distributionusingpt 2 054 df 46 todeterminetheareainthelowertailhowdoweconvertthisintotheappropriatep value withthefulldata wecanusedata read table cancer dat header t gr data 1 size data 2 t test size gr 0 size gr 1 var equal t routput twosamplet testdata size gr 0 andsize gr 1 t 2 054 df 46 p value 0 04568alternativehypothesis truedifferenceinmeansisnotequalto095percentconfidenceinterval 2 65174438 0 02682705sampleestimates meanofxmeanofy16 1500017 48929 unequalvariance often weareunwillingtoassumethatthevariancesareequalwenowwritetheteststatisticas thedistributionofthisstatisticisdifficulttoderiveandweapproximatethedistributionusingat distributionwithndegreesoffreedom thisiscalledthesatterthwaiteorwelchapproximationwhenyoucompleteatwo samplet testinrandthevariancesarenotassumedequal thisapproximationisused example forthecomparisonofthebraincancerstothelivercancers thevariancesaremuchmoredifferent let susetheunequalvariancetwosamplet testinthiscase example h0 meanbraintumorsize meanlivertumorsizetwoindependentsampleswithequalvariance alpha 0 05p value 0 0044rejectnullhypothesisconclusion thereisasignificantdifferenceinthesizeofthebrainandlivertumorsize routput t test size gr 0 size gr 2 welchtwosamplet testdata size gr 0 andsize gr 2 t 3 1666 df 22 48 p value 0 00439alternativehypothesis truedifferenceinmeansisnotequalto095percentconfidenceinterval 5 288291 1 105827sampleestimates meanofxmeanofy16 1500019 34706 practice getthetvdatasetfromthecoursefolderwewanttocomparetheamountoftvtheboysandgirlswatch performthemostappropriatetest boysarecodedas0andgirlsarecodedas1 canwetestifthevariancesareequal sincewecanneverbesureifthevariancesareequal couldwetestiftheyareequal ofcoursewecan but rememberthereiserrorineverystatisticaltestsometimesitisjustpreferredtousetheunequalvarianceunlessthereisagoodreason equalityofvariance h0 s12 s22totestthishypothesis weusethesamplevariances ifoneofthevariancesismuchlargerthantheother thisisevidenceagainstthenullaswediscussedacoupleclassesago testofequality onewaytotestifthetwovariancesareequalistocheckiftheratioisequalto1 h0 ratio 1 underthenull theratiosimplifiestotheratioof2chi squarerandomvariableshasanf distributionthef distributionisdefinedbythenumeratoranddenominatordegreesoffreedomherewehaveanf distributionwithn1 1andn2 1degreesoffreedomthisworksbetterwith f distribution hereisthef distributionwith5and500degreesoffreedomnotetheskewofthedistribution example var test size gr 1 size gr 0 ftesttocomparetwovariancesdata size gr 1 andsize gr 0 f 1 719 numdf 27 denomdf 19 p value 0 2247alternativehypothesis trueratioofvariancesisnotequalto195percentconfidenceinterval 0 7103353 904512sampleestimates ratioofvariances1 719033 var test size gr 2 size gr 0 ftesttocomparetwovariancesdata size gr 2 andsize gr 0 f 4

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论