/
2prtest—Testsofproportions 2prtest—Testsofproportions

2prtest—Testsofproportions - PDF document

sherrill-nordquist
sherrill-nordquist . @sherrill-nordquist
Follow
377 views
Uploaded On 2017-03-09

2prtest—Testsofproportions - PPT Presentation

ThebitestcommandisabetterversionoftherstformofprtestinthatitgivesexactpvaluesResearchersshouldusebitestwhenpossibleespeciallyforsmallsamplesseeRbitestOptions Main bygroupvarspeciesanume ID: 523920

Thebitestcommandisabetterversionoftherstformofprtestinthatitgivesexactp-values.Researchersshouldusebitestwhenpossible especiallyforsmallsamples;see[R]bitest.Options  Main by(groupvar)speciesanume

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "2prtest—Testsofproportions" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

2prtest—Testsofproportions Thebitestcommandisabetterversionoftherstformofprtestinthatitgivesexactp-values.Researchersshouldusebitestwhenpossible,especiallyforsmallsamples;see[R]bitest.Options  � Main �by(groupvar)speciesanumericvariablethatcontainsthegroupinformationforagivenobservation.Thisvariablemusthaveonlytwovalues.Donotconfusetheby()optionwiththebyprex;bothmaybespecied.level(#)speciesthecondencelevel,asapercentage,forcondenceintervals.Thedefaultislevel(95)orassetbysetlevel;see[U]20.7Specifyingthewidthofcondenceintervals.countspeciesthatintegercountsinsteadofproportionsbeusedintheimmediateformsofprtest.Intherstsyntax,prtestiexpectsthat#obs1and#p1arecounts—#p1#obs1—and#p2isaproportion.Inthesecondsyntax,prtestiexpectsthatallfournumbersareintegercounts,that#obs1#p1,andthat#obs2#p2.Remarksandexamplesstata.comTheprtestoutputfollowstheoutputofttestinprovidingalotofinformation.Eachproportionispresentedalongwithacondenceinterval.Theappropriateone-ortwo-sampletestisperformed,andthetwo-sidedandbothone-sidedresultsareincludedatthebottomoftheoutput.Foratwo-sampletest,thecalculateddifferenceisalsopresentedwithitscondenceinterval.Thiscommandmaybeusedforbothlarge-sampletestingandlarge-sampleintervalestimation. Example1:One-sampletestofproportionIntherstform,prtesttestswhetherthemeanofthesampleisequaltoaknownconstant.Assumethatwehaveasampleof74automobiles.Wewishtotestwhethertheproportionofautomobilesthatareforeignisdifferentfrom40%..usehttp://www.stata-press.com/data/r13/auto(1978AutomobileData).prtestforeign==.4One-sampletestofproportionforeign:Numberofobs=74 Variable MeanStd.Err.[95%Conf.Interval] foreign .2972973.0531331.1931583.4014363 p=proportion(foreign)z=-1.8034Ho:p=0.4Ha:p0.4Ha:p!=0.4Ha:p&#x-532;0.4Pr(Zz)=0.0357Pr(|Z|&#x-531;|z|)=0.0713Pr(Z&#x-531;z)=0.9643Thetestindicatesthatwecannotrejectthehypothesisthattheproportionofforeignautomobilesis0.40atthe5%signicancelevel. 4prtest—Testsofproportions .prtesti30.445.67Two-sampletestofproportionsx:Numberofobs=30y:Numberofobs=45 Variable MeanStd.Err.z�P|z|[95%Conf.Interval] x .4.0894427.2246955.5753045y .67.0700952.532616.807384 diff -.27.1136368-.4927241-.0472759 underHo:.1169416-2.310.021 diff=prop(x)-prop(y)z=-2.3088Ho:diff=0Ha:diff0Ha:diff!=0Ha:diff&#x-531;0Pr(Zz)=0.0105Pr(|Z||z|)=0.0210Pr(Z&#x-531;z)=0.9895 Storedresultsprtestandprtestistorethefollowinginr():Scalarsr(z)zstatisticr(P #)proportionforvariable#r(N #)numberofobservationsforvariable#MethodsandformulasSeeAcock(2014,155–161)foradditionalexamplesoftestsofproportionsusingStata.Alarge-sample100(1� )%condenceintervalforaproportionpisbpz1� =2r bpbq nanda100(1� )%condenceintervalforthedifferenceoftwoproportionsisgivenby(bp1�bp2)z1� =2s bp1bq1 n1+bp2bq2 n2wherebq=1�bpandziscalculatedfromtheinversecumulativestandardnormaldistribution.Theone-tailedandtwo-tailedtestsofapopulationproportionuseanormallydistributedteststatisticcalculatedasz=bp�p0 p p0q0=nwherep0isthehypothesizedproportion.Atestofthedifferenceoftwoproportionsalsousesanormallydistributedteststatisticcalculatedas

Related Contents


Next Show more