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

热网互联33元/月,香港/日本/洛杉矶/韩国CN2高速线路云主机

热网互联怎么样?热网互联(hotiis)是随客云计算(Suike.Cloud)成立于2009年,增值电信业务经营许可证:B1-20203716)旗下平台。热网互联云主机是CN2高速回国线路,香港/日本/洛杉矶/韩国CN2高速线路云主机,最低33元/月;热网互联国内BGP高防服务器,香港服务器,日本服务器全线活动中,大量七五折来袭!点击进入:热网互联官方网站地址热网互联香港/日本/洛杉矶/韩国cn2...

Megalayer(48元)新增 美国CN2优化线路特价服务器和VPS方案

Megalayer 商家算是新晋的服务商,商家才开始的时候主要是以香港、美国独立服务器。后来有新增菲律宾机房,包括有VPS云服务器、独立服务器、站群服务器等产品。线路上有CN2优化带宽、全向带宽和国际带宽,这里有看到商家的特价方案有增加至9个,之前是四个的。在这篇文章中,我来整理看看。第一、香港服务器系列这里香港服务器会根据带宽的不同区别。我这里将香港机房的都整理到一个系列里。核心内存硬盘IP带宽...

优林云(53元)哈尔滨电信2核2G

优林怎么样?优林好不好?优林 是一家国人VPS主机商,成立于2016年,主营国内外服务器产品。云服务器基于hyper-v和kvm虚拟架构,国内速度还不错。今天优林给我们带来促销的是国内东北地区哈尔滨云服务器!全部是独享带宽!首月5折 续费5折续费!地区CPU内存硬盘带宽价格购买哈尔滨电信2核2G50G1M53元直达链接哈尔滨电信4核4G50G1M83元直达链接哈尔滨电信8核8G50G1M131元直...

169pp com为你推荐
博客外链请问怎么利用博客做外链呢人人时光机寻时光机歌词spgnuxps = getCon().prepareStatement(sql);啥意思,求注释,要是不嫌麻烦帮我把下面的也给注释了申请证书申请毕业证书vbscript教程请教一下高手们,这个VBS脚本难不难啊,我想学学这个,但是又不知道该从哪入手,希望高手指点指点??怎么点亮qq空间图标怎样点亮qq空间的图标如何快速收录如何让百度快速收录系统分析员系统分析师是做什么 的网站推广外链我是新手SEO,请问网站怎样做外链推广网站排名靠前如何使网站排名靠前?
深圳主机租用 域名备案信息查询 联通c套餐 asp.net主机 精品网 la域名 便宜建站 php探针 论坛空间 宁波服务器 佛山高防服务器 免费美国空间 789 阿里云免费邮箱 云服务器比较 lamp架构 酸酸乳 阿里云邮箱申请 七牛云存储 umax 更多