Sie sind auf Seite 1von 4

Search

Go >>Home>>Products>>Stata12>>Marginsplots

Marginsplots
NewinStata12isthemarginsplotcommand,whichmakesiteasyto graphstatisticsfromfittedmodels.marginsplotgraphstheresultsfrommargins,andmarginsitselfcan computefunctionsoffittedvaluesafteralmostanyestimationcommand,linearornonlinear. SupposewevejustfitatwowayANOVAofsystolicbloodpressureonagegroup,sex,andtheirinteraction. Wecanestimatetheresponseforeachcellwithmargins:

Tostudytheinteractionitwouldbenicetoseeagraph.InStata12wenolongerhavetoconstructthe graphmanuallywecaninsteadjusttypemarginsplot:

marginsplotautomaticallychoosestheyvariableandxvariableandaddsconfidenceintervals.Wedont havetostickwiththedefaults,though:marginsplotincludesarichsetofoptionsforchangingaxis definitions,labels,curves,confidenceintervals,andmore. marginsplotalsosupportsthenewfeaturesofthemarginscommand,includingthecontrastoperators. Letscontrastwomenwithmenineachagegroupandplotthecontrasts:

Weseethatsystolicbloodpressureislowerinyoungerwomenthaninyoungermen.Butamongtheold, therelationshipisreversed,andwomenhavehigherbloodpressurethanmen. marginsplotworkswithnonlinearmodels,too.Supposewe'vefitalogisticregression,modelingthe probabilityofhighbloodpressureasafunctionofsex,agegroup,bodymassindex,andtheirinteractions. marginsplotcancontrastwomenwithmenontheprobabilityscale:

.q u i e t l ym a r g i n sr . s e x ,a t ( b m i = ( 1 0 ( 1 ) 6 5 ) ) .m a r g i n s p l o t ,x l a b e l ( 1 0 ( 1 0 ) 6 0 )r e c a s t ( l i n e )r e c a s t c i ( r a r e a ) V a r i a b l e st h a tu n i q u e l yi d e n t i f ym a r g i n s :b m i

Weveonlyscratchedthesurfaceanythingthatmarginscancompute,marginsplotcangraph.
Backtohighlights

Das könnte Ihnen auch gefallen