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

VirMach:$7.2/年KVM-美元512MB/$7.2/年MB多个机房个机房可选_双线服务器租赁

Virmach对资源限制比较严格,建议查看TOS,自己做好限制,优点是稳定。 vCPU 内存 空间 流量 带宽 IPv4 价格 购买 1 512MB 15GB SSD 500GB 1Gbps 1 $7/VirMach:$7/年/512MB内存/15GB SSD空间/500GB流量/1Gbps端口/KVM/洛杉矶/西雅图/芝加哥/纽约等 发布于 5个月前 (01-05) VirMach,美国老牌、稳...

Hostodo美国独立日优惠套餐年付13.99美元起,拉斯维加斯/迈阿密机房

Hostodo又发布了几款针对7月4日美国独立日的优惠套餐(Independence Day Super Sale),均为年付,基于KVM架构,采用NVMe硬盘,最低13.99美元起,可选拉斯维加斯或者迈阿密机房。这是一家成立于2014年的国外VPS主机商,主打低价VPS套餐且年付为主,基于OpenVZ和KVM架构,产品性能一般,支持使用PayPal或者支付宝等付款方式。商家客服响应也比较一般,推...

Sharktech($49/月),10G端口 32GB内存,鲨鱼机房新用户赠送$50

Sharktech 鲨鱼机房商家我们是不是算比较熟悉的,因为有很多的服务商渠道的高防服务器都是拿他们家的机器然后部署高防VPS主机的,不过这几年Sharktech商家有自己直接销售云服务器产品,比如看到有新增公有云主机有促销活动,一般有人可能买回去自己搭建虚拟主机拆分销售的,有的也是自用的。有看到不少网友在分享到鲨鱼机房商家促销活动期间,有赠送开通公有云主机$50,可以购买最低配置的,$49/月的...

169pp com为你推荐
外网和内网内网和外网有什么区别啊?安卓应用平台有没有什么安卓游戏都能找到的应用商店或者游戏中心办公协同软件免费的多人协同办公软件哪些,我了解的有钉钉、企业微信,其他的还有么?彩信中心短信中心号码是多少天天酷跑刷金币如何使用八门神器给天天酷跑刷钻刷金币如何建立自己的网站怎么创建自己的网站硬盘人硬盘是指什么人qq怎么发邮件用QQ怎样发送文件开机滚动条如何关闭开机滚动条?安装迅雷看看播放器迅雷看看播放器安装
南通服务器租用 liquidweb rackspace 免备案空间 debian6 165邮箱 中国电信测网速 免费phpmysql空间 根服务器 香港亚马逊 lick 华为k3 cdn网站加速 中国联通宽带测试 阵亡将士纪念日 国内空间 七牛云存储 北京主机托管 789电视剧网 电信主机托管 更多