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

10gbiz:香港/洛杉矶CN2直连线路VPS四折优惠,直连香港/香港/洛杉矶CN2四折

10gbiz怎么样?10gbiz在本站也多次分享过,是一家成立于2020的国人主机商家,主要销售VPS和独立服务器,机房目前有中国香港和美国洛杉矶、硅谷等地,线路都非常不错,香港为三网直连,电信走CN2,洛杉矶线路为三网回程CN2 GIA,10gbiz商家七月连续推出各种优惠活动,除了延续之前的VPS产品4折优惠,目前增加了美国硅谷独立服务器首月半价的活动,有需要的朋友可以看看。10gbiz优惠码...

ZJI(月付450元),香港华为云线路服务器、E3服务器起

ZJI发布了9月份促销信息,针对香港华为云线路物理服务器华为一型提供立减300元优惠码,优惠后香港华为一型月付仅450元起。ZJI是原来Wordpress圈知名主机商家:维翔主机,成立于2011年,2018年9月更名为ZJI,提供中国香港、台湾、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册等业务,商家所选数据中心均为国内访问质量高的机房和线路,比如香港阿里云、华为...

80VPS:香港服务器月付420元;美国CN2 GIA独服月付650元;香港/日本/韩国/美国多IP站群服务器750元/月

80vps怎么样?80vps最近新上了香港服务器、美国cn2服务器,以及香港/日本/韩国/美国多ip站群服务器。80vps之前推荐的都是VPS主机内容,其实80VPS也有独立服务器业务,分布在中国香港、欧美、韩国、日本、美国等地区,可选CN2或直连优化线路。如80VPS香港独立服务器最低月付420元,美国CN2 GIA独服月付650元起,中国香港、日本、韩国、美国洛杉矶多IP站群服务器750元/月...

169pp com为你推荐
邮箱群发如何用邮箱群发广告邮件?百度k站百度是怎么样k站的呢?湖南商标注册湖南商标注册代办公司最新qq空间代码QQ空间代码显卡温度多少正常显卡温度多少算正常?今日热点怎么删除如何彻底删除今日热点神雕侠侣礼包大全神雕侠侣手游华山论剑礼包有什么 怎么领取畅想中国未来的中国是什么样子的保护气球气球保护液可以用什么来代替?创维云电视功能创维云电视是指什么
域名中介 武汉域名注册 广州主机租用 美国加州vps 如何查询ip地址 什么是二级域名 金万维动态域名 smartvps site5 香港机房 edis 外国空间 info域名 parseerror 免费smtp服务器 新家坡 国外免费asp空间 服务器监测 万网空间购买 美国独立日 更多