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

MineServer:洛杉矶CN2 GIA VPS/512MB内存/20GB NVME/800GB流量/200Mbps/KVM,58元/季

mineserver怎么样?mineserver是一家国人商家,主要提供香港CN2 KVM VPS、香港CMI KVM VPS、日本CN2 KVM VPS、洛杉矶cn2 gia端口转发等服务,之前介绍过几次,最近比较活跃。这家新推出了洛杉矶CN2 GIA VPS,512MB内存/20GB NVME/800GB流量/200Mbps/KVM,58元/季,并且进行了带宽升级,同时IP更改为美国IP。点击...

bgpto:独立服务器夏季促销,日本机器6.5折、新加坡7.5折,20M带宽,低至$93/月

bgp.to对日本机房、新加坡机房的独立服务器在搞特价促销,日本独立服务器低至6.5折优惠,新加坡独立服务器低至7.5折优惠,所有优惠都是循环的,终身不涨价。服务器不限制流量,支持升级带宽,免费支持Linux和Windows server中文版(还包括Windows 10). 特色:自动部署,无需人工干预,用户可以在后台自己重装系统、重启、关机等操作!官方网站:https://www.bgp.to...

BuyVM商家4个机房的官方测试IP地址和测速文件

BuyVM 商家算是有一些年头,从早年提供低价便宜VPS主机深受广大网友抢购且也遭到吐槽的是因为审核账户太过于严格。毕竟我们国内的个人注册账户喜欢账户资料乱写,毕竟我们看英文信息有些还是比较难以识别的,于是就注册信息的时候随便打一些字符,这些是不能通过的。前几天,我们可以看到BUYVM商家有新增加迈阿密机房,而且商家有提供大硬盘且不限制流量的VPS主机,深受有一些网友的喜欢。目前,BUYVM商家有...

169pp com为你推荐
ptrint(*ptr)*()怎么理解?天天酷跑刷积分教程天天酷跑积分怎么获得 天天酷跑刷积分方法qq空间装扮qq空间怎么装扮开机滚动条电脑开机有滚动条的画面神雕侠侣礼包大全神雕侠侣手游每天送的元宝买什么合适畅想中国淄博畅想中国消费怎么样保护气球为什么会那么害怕气球机械键盘轴机械键盘蓝轴有什么作用网络广告投放网络广告投放有哪些技巧?srv记录SRV记录的定义
电信服务器租赁 中文域名申请 花生壳域名贝锐 美国主机推荐 rackspace 特价空间 国外空间服务商 ubuntu更新源 css样式大全 京东商城双十一活动 admit的用法 刀片服务器的优势 老左正传 91vps 阿里校园 流量计费 中国网通测速 免费网页申请 常州联通宽带 新睿云 更多