0.1666169pp

169pp com  时间:2021-03-03  阅读:()
Titlestata.
comttest—ttests(mean-comparisontests)SyntaxMenuDescriptionOptionsRemarksandexamplesStoredresultsMethodsandformulasReferencesAlsoseeSyntaxOne-samplettestttestvarname==#ifin,level(#)Two-samplettestusinggroupsttestvarnameifin,by(groupvar)options1Two-samplettestusingvariablesttestvarname1==varname2ifin,unpairedunequalwelchlevel(#)Pairedttestttestvarname1==varname2ifin,level(#)Immediateformofone-samplettestttesti#obs#mean#sd#val,level(#)Immediateformoftwo-samplettestttesti#obs1#mean1#sd1#obs2#mean2#sd2,options2options1DescriptionMainby(groupvar)variabledeningthegroupsunequalunpaireddatahaveunequalvarianceswelchuseWelch'sapproximationlevel(#)setcondencelevel;defaultislevel(95)by(groupvar)isrequired.
options2DescriptionMainunequalunpaireddatahaveunequalvarianceswelchuseWelch'sapproximationlevel(#)setcondencelevel;defaultislevel(95)byisallowedwithttest;see[D]by.
12ttest—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.
OptionsMainby(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-wayANOVAImmediateformVideoexamplesttest—ttests(mean-comparisontests)3One-samplettestExample1Intherstform,ttesttestswhetherthemeanofthesampleisequaltoaknownconstantundertheassumptionofunknownvariance.
Assumethatwehaveasampleof74automobiles.
Weknoweachautomobile'saveragemileageratingandwishtotestwhethertheoverallaverageforthesampleis20milespergallon.
.
usehttp://www.
stata-press.
com/data/r13/auto(1978AutomobileData).
ttestmpg==20One-samplettestVariableObsMeanStd.
Err.
Std.
Dev.
[95%Conf.
Interval]mpg7421.
2973.
67255115.
78550319.
956922.
63769mean=mean(mpg)t=1.
9289Ho:mean=20degreesoffreedom=73Ha:mean20Pr(T|t|)=0.
0576Pr(T>t)=0.
0288Thetestindicatesthattheunderlyingmeanisnot20withasignicancelevelof5.
8%.
Two-samplettestExample2:Two-samplettestusinggroupsWearetestingtheeffectivenessofanewfueladditive.
Werunanexperimentinwhich12carsaregiventhefueltreatmentand12carsarenot.
Theresultsoftheexperimentareasfollows:treatedmpg0200230210250180170180240200240230191241251211221231181171281241271211234ttest—ttests(mean-comparisontests)Thetreatedvariableiscodedas1ifthecarreceivedthefueltreatmentand0otherwise.
Wecantesttheequalityofmeansofthetreatedanduntreatedgroupbytyping.
usehttp://www.
stata-press.
com/data/r13/fuel3.
ttestmpg,by(treated)Two-samplettestwithequalvariancesGroupObsMeanStd.
Err.
Std.
Dev.
[95%Conf.
Interval]01221.
78817012.
73030119.
2652522.
7347511222.
75.
93844653.
25087420.
6844924.
81551combined2421.
875.
62644763.
06895420.
5790923.
17091diff-1.
751.
225518-4.
291568.
7915684diff=mean(0)-mean(1)t=-1.
4280Ho:diff=0degreesoffreedom=22Ha:diff0Pr(T|t|)=0.
1673Pr(T>t)=0.
9163Wedonotndastatisticallysignicantdifferenceinthemeans.
IfwewerenotwillingtoassumethatthevarianceswereequalandwantedtouseWelch'sformula,wecouldtype.
ttestmpg,by(treated)welchTwo-samplettestwithunequalvariancesGroupObsMeanStd.
Err.
Std.
Dev.
[95%Conf.
Interval]01221.
78817012.
73030119.
2652522.
7347511222.
75.
93844653.
25087420.
6844924.
81551combined2421.
875.
62644763.
06895420.
5790923.
17091diff-1.
751.
225518-4.
28369.
7836902diff=mean(0)-mean(1)t=-1.
4280Ho:diff=0Welch'sdegreesoffreedom=23.
2465Ha:diff0Pr(T|t|)=0.
1666Pr(T>t)=0.
9167TechnicalnoteIntwo-sampleusinggroupsrandomizeddesigns,subjectswillsometimesrefusetheassignedtreatmentbutstillbemeasuredforanoutcome.
Inthiscase,takecaretospecifythegroupproperly.
Youmightbetemptedtoletvarnamecontainmissingwherethesubjectrefusedandthusletttestdropsuchobservationsfromtheanalysis.
Zelen(1979)arguesthatitwouldbebettertospecifythatthesubjectbelongstothegroupinwhichheorshewasrandomized,eventhoughsuchinclusionwilldilutethemeasuredeffect.
ttest—ttests(mean-comparisontests)5Example3:Two-samplettestusingvariablesThereisasecond,inferiorwaytoorganizethedataintheprecedingexample.
Weranateston24cars,12withouttheadditiveand12with.
Wenowcreatetwonewvariables,mpg1andmpg2.
mpg1mpg2202423252121252218231718181724282024242723211923Thismethodisinferiorbecauseitsuggestsaconnectionthatisnotthere.
Thereisnolinkbetweenthecarwith20mpgandthecarwith24mpgintherstrowofthedata.
Eachcolumnofdatacouldbearrangedinanyorder.
Nevertheless,ifourdataareorganizedlikethis,ttestcanaccommodateus.
.
usehttp://www.
stata-press.
com/data/r13/fuel.
ttestmpg1==mpg2,unpairedTwo-samplettestwithequalvariancesVariableObsMeanStd.
Err.
Std.
Dev.
[95%Conf.
Interval]mpg11221.
78817012.
73030119.
2652522.
73475mpg21222.
75.
93844653.
25087420.
6844924.
81551combined2421.
875.
62644763.
06895420.
5790923.
17091diff-1.
751.
225518-4.
291568.
7915684diff=mean(mpg1)-mean(mpg2)t=-1.
4280Ho:diff=0degreesoffreedom=22Ha:diff0Pr(T|t|)=0.
1673Pr(T>t)=0.
9163PairedttestExample4Supposethattheprecedingdatawereactuallycollectedbyrunningateston12cars.
Eachcarwasrunoncewiththefueladditiveandoncewithout.
Ourdataarestoredinthesamemannerasinexample3,butthistime,thereismostcertainlyaconnectionbetweenthempgvaluesthatappearinthesamerow.
Thesecomefromthesamecar.
Thevariablesmpg1andmpg2representmileagewithoutandwiththetreatment,respectively.
6ttest—ttests(mean-comparisontests).
usehttp://www.
stata-press.
com/data/r13/fuel.
ttestmpg1==mpg2PairedttestVariableObsMeanStd.
Err.
Std.
Dev.
[95%Conf.
Interval]mpg11221.
78817012.
73030119.
2652522.
73475mpg21222.
75.
93844653.
25087420.
6844924.
81551diff12-1.
75.
77971442.
70101-3.
46614-.
0338602mean(diff)=mean(mpg1-mpg2)t=-2.
2444Ho:mean(diff)=0degreesoffreedom=11Ha:mean(diff)0Pr(T|t|)=0.
0463Pr(T>t)=0.
9768Wendthatthemeansarestatisticallydifferentfromeachotheratanylevelgreaterthan4.
6%.
Two-samplettestcomparedwithone-wayANOVAExample5Inexample2,wesawthatttestcanbeusedtotesttheequalityofapairofmeans;see[R]onewayforanextensionthatallowstestingtheequalityofmorethantwomeans.
Supposethatwehavedataonthe50states.
Thedatasetcontainsthemedianageofthepopulation(medage)andtheregionofthecountry(region)foreachstate.
Region1referstotheNortheast,region2totheNorthCentral,region3totheSouth,andregion4totheWest.
Usingoneway,wecantesttheequalityofallfourmeans.
.
usehttp://www.
stata-press.
com/data/r13/census(1980Censusdatabystate).
onewaymedageregionAnalysisofVarianceSourceSSdfMSFProb>FBetweengroups46.
3961903315.
46539687.
560.
0003Withingroups94.
1237947462.
04616945Total140.
519985492.
8677548Bartlett'stestforequalvariances:chi2(3)=10.
5757Prob>chi2=0.
014Wendthatthemeansaredifferent,butweareinterestedonlyintestingwhetherthemeansfortheNortheast(region==1)andWest(region==4)aredifferent.
Wecoulduseoneway:.
onewaymedageregionifregion==1|region==4AnalysisofVarianceSourceSSdfMSFProb>FBetweengroups46.
241247146.
24124720.
020.
0002Withingroups46.
1969169202.
30984584Total92.
4381638214.
40181733Bartlett'stestforequalvariances:chi2(1)=2.
4679Prob>chi2=0.
116ttest—ttests(mean-comparisontests)7Wecouldalsousettest:.
ttestmedageifregion==1|region==4,by(region)Two-samplettestwithequalvariancesGroupObsMeanStd.
Err.
Std.
Dev.
[95%Conf.
Interval]NE931.
23333.
34115811.
02347430.
4466232.
02005West1328.
28462.
49235771.
77522127.
2118629.
35737combined2229.
49091.
44730592.
09805128.
5606930.
42113diff2.
948718.
65903721.
573994.
323445diff=mean(NE)-mean(West)t=4.
4743Ho:diff=0degreesoffreedom=20Ha:diff0Pr(T|t|)=0.
0002Pr(T>t)=0.
0001Thesignicancelevelsofbothtestsarethesame.
ImmediateformExample6ttestiislikettest,exceptthatwespecifysummarystatisticsratherthanvariablesasarguments.
Forinstance,wearereadinganarticlethatreportsthemeannumberofsunspotspermonthas62.
6withastandarddeviationof15.
8.
Thereare24monthsofdata.
Wewishtotestwhetherthemeanis75:.
ttesti2462.
615.
875One-samplettestObsMeanStd.
Err.
Std.
Dev.
[95%Conf.
Interval]x2462.
63.
22516115.
855.
9282569.
27175mean=mean(x)t=-3.
8448Ho:mean=75degreesoffreedom=23Ha:mean75Pr(T|t|)=0.
0008Pr(T>t)=0.
9996Example7Thereisnoimmediateformofttestwithpaireddatabecausethetestisalsoafunctionofthecovariance,anumberunlikelytobereportedinanypublishedsource.
Fornonpaireddata,however,wemighttype8ttest—ttests(mean-comparisontests).
ttesti2020532154Two-samplettestwithequalvariancesObsMeanStd.
Err.
Std.
Dev.
[95%Conf.
Interval]x20201.
118034517.
6599322.
34007y3215.
7071068413.
5578516.
44215combined5216.
92308.
69437855.
00723515.
5290518.
3171diff51.
2561352.
4769797.
523021diff=mean(x)-mean(y)t=3.
9805Ho:diff=0degreesoffreedom=50Ha:diff0Pr(T|t|)=0.
0002Pr(T>t)=0.
0001Ifwehadtypedttesti2020532154,unequal,thetestwouldhaveassumedunequalvariances.
VideoexamplesOne-samplettestinStatattestfortwoindependentsamplesinStatattestfortwopairedsamplesinStataImmediatecommandsinStata:One-samplettestfromsummarydataImmediatecommandsinStata:Two-samplettestfromsummarydataStoredresultsttestandttestistorethefollowinginr():Scalarsr(N1)samplesizen1r(sd1)standarddeviationforrstvariabler(N2)samplesizen2r(sd2)standarddeviationforsecondvariabler(pl)lowerone-sidedp-valuer(sd)combinedstandarddeviationr(pu)upperone-sidedp-valuer(mu1)x1meanforpopulation1r(p)two-sidedp-valuer(mu2)x2meanforpopulation2r(se)estimateofstandarderrorr(dft)degreesoffreedomr(t)tstatisticr(level)condencelevelMethodsandformulasSee,forinstance,Hoel(1984,140–161)orDixonandMassey(1983,121–130)foranintroductionandexplanationofthecalculationofthesetests.
Acock(2014,162–173)andHamilton(2013,145–150)describettestsusingapplicationsinStata.
Thetestfor=0forunknownσisgivenbyt=(x0)√nsThestatisticisdistributedasStudent'stwithn1degreesoffreedom(Gosset[Student,pseud.
]1908).
ttest—ttests(mean-comparisontests)9Thetestforx=ywhenσxandσyareunknownbutσx=σyisgivenbyt=xy(nx1)s2x+(ny1)s2ynx+ny21/21nx+1ny1/2TheresultisdistributedasStudent'stwithnx+ny2degreesoffreedom.
Youcouldperformttest(withouttheunequaloption)inaregressionsettinggiventhatregressionassumesahomoskedasticerrormodel.
Tocomparewiththettestcommand,denotetheunderlyingobservationsonxandybyxj,j=1,nx,andyj,j=1,ny.
Inaregressionframework,typingttestwithouttheunequaloptionisequivalentto1.
creatinganewvariablezjthatrepresentsthestackedobservationsonxandy(sothatzj=xjforj=1,nxandznx+j=yjforj=1,ny)2.
andthenestimatingtheequationzj=β0+β1dj+j,wheredj=0forj=1,nxanddj=1forj=nx+1,nx+ny(thatis,dj=0whenthezobservationsrepresentx,anddj=1whenthezobservationsrepresenty).
Theestimatedvalueofβ1,b1,willequalyx,andthereportedtstatisticwillbethesametstatisticasgivenbytheformulaabove.
Thetestforx=ywhenσxandσyareunknownandσx=σyisgivenbyt=xys2x/nx+s2y/ny1/2TheresultisdistributedasStudent'stwithνdegreesoffreedom,whereνisgivenby(withSatterthwaite's[1946]formula)s2x/nx+s2y/ny2s2x/nx2nx1+s2y/ny2ny1WithWelch'sformula(1947),thenumberofdegreesoffreedomisgivenby2+s2x/nx+s2y/ny2s2x/nx2nx+1+s2y/ny2ny+1Thetestforx=yformatchedobservations(alsoknownaspairedobservations,correlatedpairs,orpermanentcomponents)isgivenbyt=d√nsdwheredrepresentsthemeanofxiyiandsdrepresentsthestandarddeviation.
TheteststatistictisdistributedasStudent'stwithn1degreesoffreedom.
10ttest—ttests(mean-comparisontests)Youcanalsousettestwithouttheunpairedoptioninaregressionsettingbecauseapairedcomparisonincludestheassumptionofconstantvariance.
Thettestwithanunequalvarianceassumptiondoesnotlenditselftoaneasyrepresentationinregressionsettingsandisnotdiscussedhere.
(xjyj)=β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

酷锐云香港(19元/月) ,美国1核2G 19元/月,日本独立物理机,

酷锐云是一家2019年开业的国人主机商家,商家为企业运营,主要销售主VPS服务器,提供挂机宝和云服务器,机房有美国CERA、中国香港安畅和电信,CERA为CN2 GIA线路,提供单机10G+天机盾防御,提供美国原生IP,支持媒体流解锁,商家的套餐价格非常美丽,CERA机房月付20元起,香港安畅机房10M带宽月付25元,有需要的朋友可以入手试试。酷锐云自开业以来一直有着良好的产品稳定性及服务态度,支...

bgpto:日本独立服务器6.5折($120起),新加坡独立服务器7.5折($93起)

bgp.to在对日本东京的独立服务器进行6.5折终身优惠促销,低至$120/月;对新加坡独立服务器进行7.5折终身优惠促销,低至$93/月。所有服务器都是直连国内,速度上面相比欧洲、美国有明显的优势,特别适合建站、远程办公等多种用途。官方网站:https://www.bgp.to/dedicated.html主打日本(东京、大阪)、新加坡、香港(CN)、洛杉矶(US)的服务器业务!日本服务器CPU...

BuyVM($5/月)不限流量流媒体优化VPS主机 1GB内存

BuyVM商家属于比较老牌的服务商,早年有提供低价年付便宜VPS主机还记得曾经半夜的时候抢购的。但是由于这个商家风控非常严格,即便是有些是正常的操作也会导致被封账户,所以后来陆续无人去理睬,估计被我们风控的抢购低价VPS主机已经手足无措。这两年商家重新调整,而且风控也比较规范,比如才入手他们新上线的流媒体优化VPS主机也没有不适的提示。目前,BuyVM商家有提供新泽西、迈阿密等四个机房的VPS主机...

169pp com为你推荐
手机游戏排行榜2015安卓手机单机游戏2015年排行榜?绵阳电信绵阳电信营业厅哪家最大手机最全怎么样免费装扮qq空间要怎么免费装扮QQ空间!直播加速手机上什么软件可以帮助直播加速,大神们推荐推荐迅雷云点播账号求迅雷云播账号lockdowndios8.1能用gpp3to2吗?型号A1429mate8价格华为mate8 128g售价多少钱gbk编码表GBK码表怎么查服务器连接异常手机服务器连接异常怎样申请支付宝怎样申请支付宝?
域名信息查询 cn域名注册 北京服务器租用 樊云 新加坡服务器 私服服务器 免费smtp服务器 泉州移动 idc查询 新睿云 跟踪路由命令 免费外链相册 net空间 国外的代理服务器 工信部icp备案查询 apnic let 香港云主机 报警主机 主机响 更多