/
2ttest—ttests(mean 2ttest—ttests(mean

2ttest—ttests(mean - PDF document

tatyana-admore
tatyana-admore . @tatyana-admore
Follow
366 views
Uploaded On 2016-08-19

2ttest—ttests(mean - PPT Presentation

MenuttestStatisticsSummariestablesandtestsClassicaltestsofhypothesesttestmeancomparisontestttestiStatisticsSummariestablesandtestsClassicaltestsofhypothesesttestcalculatorDescriptionttest ID: 451925

MenuttestStatisticsSummaries tables andtestsClassicaltestsofhypothesesttest(mean-comparisontest)ttestiStatisticsSummaries tables andtestsClassicaltestsofhypothesesttestcalculatorDescriptionttest

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "2ttest—ttests(mean" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

2ttest—ttests(mean­comparisontests) MenuttestStatistics�Summaries,tables,andtests�Classicaltestsofhypotheses�ttest(mean-comparisontest)ttestiStatistics�Summaries,tables,andtests�Classicaltestsofhypotheses�ttestcalculatorDescriptionttestperformsttestsontheequalityofmeans.Intherstform,ttestteststhatvarnamehasameanof#.Inthesecondform,ttestteststhatvarnamehasthesamemeanwithinthetwogroupsdenedbygroupvar.Inthethirdform,ttestteststhatvarname1andvarname2havethesamemean,assumingunpaireddata.Inthefourthform,ttestteststhatvarname1andvarname2havethesamemean,assumingpaireddata.ttestiistheimmediateformofttest;see[U]19Immediatecommands.Fortheequivalentofatwo-samplettestwithsamplingweights(pweights),usethesvy:meancommandwiththeover()option,andthenuselincom;see[R]meanand[SVY]svypostestimation.Options  � Main �by(groupvar)speciesthegroupvarthatdenesthetwogroupsthatttestwillusetotestthehypothesisthattheirmeansareequal.Specifyingby(groupvar)impliesanunpaired(twosample)ttest.Donotconfusetheby()optionwiththebyprex;youcanspecifyboth.unpairedspeciesthatthedatabetreatedasunpaired.Theunpairedoptionisusedwhenthetwosetsofvaluestobecomparedareindifferentvariables.unequalspeciesthattheunpaireddatanotbeassumedtohaveequalvariances.welchspeciesthattheapproximatedegreesoffreedomforthetestbeobtainedfromWelch'sformula(1947)ratherthanfromSatterthwaite'sapproximationformula(1946),whichisthedefaultwhenunequalisspecied.Specifyingwelchimpliesunequal.level(#)speciesthecondencelevel,asapercentage,forcondenceintervals.Thedefaultislevel(95)orassetbysetlevel;see[U]20.7Specifyingthewidthofcondenceintervals.Remarksandexamplesstata.comRemarksarepresentedunderthefollowingheadings:One-samplettestTwo-samplettestPairedttestTwo-samplettestcomparedwithone-wayANOVAImmediateformVideoexamples 4ttest—ttests(mean­comparisontests) Thetreatedvariableiscodedas1ifthecarreceivedthefueltreatmentand0otherwise.Wecantesttheequalityofmeansofthetreatedanduntreatedgroupbytyping.usehttp://www.stata-press.com/data/r13/fuel3.ttestmpg,by(treated)Two-samplettestwithequalvariances Group ObsMeanStd.Err.Std.Dev.[95%Conf.Interval] 0 1221.78817012.73030119.2652522.734751 1222.75.93844653.25087420.6844924.81551 combined 2421.875.62644763.06895420.5790923.17091 diff -1.751.225518-4.291568.7915684 diff=mean(0)-mean(1)t=-1.4280Ho:diff=0degreesoffreedom=22Ha:diff0Ha:diff!=0Ha:diff&#x-531;0Pr(Tt)=0.0837Pr(|T|&#x-531;|t|)=0.1673Pr(T&#x-531;t)=0.9163Wedonotndastatisticallysignicantdifferenceinthemeans.IfwewerenotwillingtoassumethatthevarianceswereequalandwantedtouseWelch'sformula,wecouldtype.ttestmpg,by(treated)welchTwo-samplettestwithunequalvariances Group ObsMeanStd.Err.Std.Dev.[95%Conf.Interval] 0 1221.78817012.73030119.2652522.734751 1222.75.93844653.25087420.6844924.81551 combined 2421.875.62644763.06895420.5790923.17091 diff -1.751.225518-4.28369.7836902 diff=mean(0)-mean(1)t=-1.4280Ho:diff=0Welch'sdegreesoffreedom=23.2465Ha:diff0Ha:diff!=0Ha:diff&#x-531;0Pr(Tt)=0.0833Pr(|T|&#x-531;|t|)=0.1666Pr(T&#x-531;t)=0.9167 TechnicalnoteIntwo-sampleusinggroupsrandomizeddesigns,subjectswillsometimesrefusetheassignedtreatmentbutstillbemeasuredforanoutcome.Inthiscase,takecaretospecifythegroupproperly.Youmightbetemptedtoletvarnamecontainmissingwherethesubjectrefusedandthusletttestdropsuchobservationsfromtheanalysis.Zelen(1979)arguesthatitwouldbebettertospecifythatthesubjectbelongstothegroupinwhichheorshewasrandomized,eventhoughsuchinclusionwilldilutethemeasuredeffect. ttest—ttests(mean­comparisontests)5 Example3:Two-samplettestusingvariablesThereisasecond,inferiorwaytoorganizethedataintheprecedingexample.Weranateston24cars,12withouttheadditiveand12with.Wenowcreatetwonewvariables,mpg1andmpg2.mpg1mpg2 202423252121252218231718181724282024242723211923Thismethodisinferiorbecauseitsuggestsaconnectionthatisnotthere.Thereisnolinkbetweenthecarwith20mpgandthecarwith24mpgintherstrowofthedata.Eachcolumnofdatacouldbearrangedinanyorder.Nevertheless,ifourdataareorganizedlikethis,ttestcanaccommodateus..usehttp://www.stata-press.com/data/r13/fuel.ttestmpg1==mpg2,unpairedTwo-samplettestwithequalvariances Variable ObsMeanStd.Err.Std.Dev.[95%Conf.Interval] mpg1 1221.78817012.73030119.2652522.73475mpg2 1222.75.93844653.25087420.6844924.81551 combined 2421.875.62644763.06895420.5790923.17091 diff -1.751.225518-4.291568.7915684 diff=mean(mpg1)-mean(mpg2)t=-1.4280Ho:diff=0degreesoffreedom=22Ha:diff0Ha:diff!=0Ha:diff&#x-531;0Pr(Tt)=0.0837Pr(|T|&#x-531;|t|)=0.1673Pr(T&#x-531;t)=0.9163 Pairedttest Example4Supposethattheprecedingdatawereactuallycollectedbyrunningateston12cars.Eachcarwasrunoncewiththefueladditiveandoncewithout.Ourdataarestoredinthesamemannerasinexample3,butthistime,thereismostcertainlyaconnectionbetweenthempgvaluesthatappearinthesamerow.Thesecomefromthesamecar.Thevariablesmpg1andmpg2representmileagewithoutandwiththetreatment,respectively. ttest—ttests(mean­comparisontests)7 Wecouldalsousettest:.ttestmedageifregion==1|region==4,by(region)Two-samplettestwithequalvariances Group ObsMeanStd.Err.Std.Dev.[95%Conf.Interval] NE 931.23333.34115811.02347430.4466232.02005West 1328.28462.49235771.77522127.2118629.35737 combined 2229.49091.44730592.09805128.5606930.42113 diff 2.948718.65903721.573994.323445 diff=mean(NE)-mean(West)t=4.4743Ho:diff=0degreesoffreedom=20Ha:diff0Ha:diff!=0Ha:diff&#x-531;0Pr(Tt)=0.9999Pr(|T|&#x-531;|t|)=0.0002Pr(T&#x-531;t)=0.0001Thesignicancelevelsofbothtestsarethesame. Immediateform Example6ttestiislikettest,exceptthatwespecifysummarystatisticsratherthanvariablesasarguments.Forinstance,wearereadinganarticlethatreportsthemeannumberofsunspotspermonthas62.6withastandarddeviationof15.8.Thereare24monthsofdata.Wewishtotestwhetherthemeanis75:.ttesti2462.615.875One-samplettest ObsMeanStd.Err.Std.Dev.[95%Conf.Interval] x 2462.63.22516115.855.9282569.27175 mean=mean(x)t=-3.8448Ho:mean=75degreesoffreedom=23Ha:mean75Ha:mean!=75Ha:mean&#x-531;75Pr(Tt)=0.0004Pr(|T|&#x-531;|t|)=0.0008Pr(T&#x-531;t)=0.9996 Example7Thereisnoimmediateformofttestwithpaireddatabecausethetestisalsoafunctionofthecovariance,anumberunlikelytobereportedinanypublishedsource.Fornonpaireddata,however,wemighttype 10ttest—ttests(mean­comparisontests) Youcanalsousettestwithouttheunpairedoptioninaregressionsettingbecauseapairedcomparisonincludestheassumptionofconstantvariance.Thettestwithanunequalvarianceassumptiondoesnotlenditselftoaneasyrepresentationinregressionsettingsandisnotdiscussedhere.(xj�yj)= 0+j. � WilliamSealyGosset(1876–1937)wasborninCanterbury,England.HestudiedchemistryandmathematicsatOxfordandworkedasachemistwiththebrewersGuinnessinDublin.Gossetbecameinterestedinstatisticalproblems,whichhediscussedwithKarlPearsonandlaterwithFisherandNeyman.Hepublishedseveralimportantpapersunderthepseudonym“Student”,andhelentthatnametothettestheinvented. ReferencesAcock,A.C.2014.AGentleIntroductiontoStata.4thed.CollegeStation,TX:StataPress.Boland,P.J.2000.WilliamSealyGosset—alias`Student'1876–1937.InCreatorsofMathematics:TheIrishConnection,ed.K.Houston,105–112.Dublin:UniversityCollegeDublinPress.Dixon,W.J.,andF.J.Massey,Jr.1983.IntroductiontoStatisticalAnalysis.4thed.NewYork:McGraw–Hill.Gleason,J.R.1999.sg101:Pairwisecomparisonsofmeans,includingtheTukeywsdmethod.StataTechnicalBulletin47:31–37.ReprintedinStataTechnicalBulletinReprints,vol.8,pp.225–233.CollegeStation,TX:StataPress.Gosset,W.S.1943.“Student's”CollectedPapers.London:BiometrikaOfce,UniversityCollege.Gosset[Student,pseud.],W.S.1908.Theprobableerrorofamean.Biometrika6:1–25.Hamilton,L.C.2013.StatisticswithStata:UpdatedforVersion12.8thed.Boston:Brooks/Cole.Hoel,P.G.1984.IntroductiontoMathematicalStatistics.5thed.NewYork:Wiley.Pearson,E.S.,R.L.Plackett,andG.A.Barnard.1990.`Student':AStatisticalBiographyofWilliamSealyGosset.Oxford:OxfordUniversityPress.Preece,D.A.1982.tisfortrouble(andtextbooks):Acritiqueofsomeexamplesofthepaired-samplest-test.Statistician31:169–195.Satterthwaite,F.E.1946.Anapproximatedistributionofestimatesofvariancecomponents.BiometricsBulletin2:110–114.Senn,S.J.,andW.Richardson.1994.Therstt-test.StatisticsinMedicine13:785–803.Welch,B.L.1947.Thegeneralizationof`student's'problemwhenseveraldifferentpopulationvariancesareinvolved.Biometrika34:28–35.Zelen,M.1979.Anewdesignforrandomizedclinicaltrials.NewEnglandJournalofMedicine300:1242–1245.Alsosee[R]bitest—Binomialprobabilitytest[R]ci—Condenceintervalsformeans,proportions,andcounts[R]esize—Effectsizebasedonmeancomparison[R]mean—Estimatemeans[R]oneway—One-wayanalysisofvariance[R]prtest—Testsofproportions[R]sdtest—Variance-comparisontests[MV]hotelling—Hotelling'sT-squaredgeneralizedmeanstest

Related Contents

Next Show more