Stata 15 help for margins_pwcompare

Title

[R] margins, pwcompare -- Pairwise comparisons of margins

Syntax

margins [marginlist] [if] [in] [weight] [, pwcompare margins_options]

margins [marginlist] [if] [in] [weight] [, pwcompare(suboptions) margins_options]

where marginlist is a list of factor variables or interactions that appear in the current estimation results. The variables may be typed with or without the i. prefix, and you may use any factor-variable syntax:

. margins i.sex i.group i.sex#i.group, pwcompare

. margins sex group sex#i.group, pwcompare

. margins sex##group, pwcompare

suboptions Description ------------------------------------------------------------------------- Pairwise comparisons cieffects show effects table with confidence intervals; the default pveffects show effects table with p-values effects show effects table with confidence intervals and p-values cimargins show table of margins and confidence intervals groups show table of margins and group codes sort sort the margins or contrasts in each term -------------------------------------------------------------------------

fweights, aweights, iweights, and pweights are allowed; see weight.

Menu

Statistics > Postestimation

Description

margins with the pwcompare option performs pairwise comparisons of margins. margins, pwcompare extends the capabilities of pwcompare to any of the nonlinear responses, predictive margins, or other margins that can be estimated by margins.

Suboptions

+----------------------+ ----+ Pairwise comparisons +---------------------------------------------

cieffects specifies that a table of the pairwise comparisons with their standard errors and confidence intervals be reported. This is the default.

pveffects specifies that a table of the pairwise comparisons with their standard errors, test statistics, and p-values be reported.

effects specifies that a table of the pairwise comparisons with their standard errors, test statistics, p-values, and confidence intervals be reported.

cimargins specifies that a table of the margins with their standard errors and confidence intervals be reported.

groups specifies that a table of the margins with their standard errors and group codes be reported. Margins with the same letter in the group code are not significantly different at the specified significance level.

sort specifies that the reported tables be sorted on the margins or contrasts in each term.

Examples

These examples are intended for quick reference. For a conceptual overview of margins, pwcompare and examples with discussion, see Remarks and examples in [R] margins, pwcompare.

Setup . webuse nhanes2 . logistic highbp sex##agegrp##c.bmi

Pairwise comparisons of the average predicted probability of high blood pressure conditional on being in each of the six age groups . margins agegrp, pwcompare

Predictive margins with group codes denoting margins that are not significantly different . margins agegrp, pwcompare(group)

Pairwise comparisons of margins using Bonferroni's adjustment for multiple comparisons . margins agegrp, pwcompare(group) mcompare(bonferroni)

Stored results

margins, pwcompare stores the following additional results in r():

Scalars r(k_terms) number of terms participating in pairwise comparisons

Macros r(cmd) pwcompare r(cmd2) margins r(group#) group code for the #th margin in r(b) r(mcmethod_vs) method from mcompare() r(mctitle_vs) title for method from mcompare() r(mcadjustall_vs) adjustall or empty

Matrices r(b) margin estimates r(V) variance-covariance matrix of the margin estimates r(b_vs) margin difference estimates r(V_vs) variance-covariance matrix of the margin difference estimates r(error_vs) margin difference estimability codes; 0 means estimable, 8 means not estimable r(table_vs) matrix containing the margin differences with their standard errors, test statistics, p-values, and confidence intervals r(L) matrix that produces the margin differences

margins, pwcompare with the post option also stores the following additional results in e():

Scalars e(k_terms) number of terms participating in pairwise comparisons

Macros e(cmd) pwcompare e(cmd2) margins

Matrices e(b) margin estimates e(V) variance-covariance matrix of the margin estimates e(b_vs) margin difference estimates e(V_vs) variance-covariance matrix of the margin difference estimates e(error_vs) margin difference estimability codes; 0 means estimable, 8 means not estimable e(L) matrix that produces the margin differences


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index