Example: marketing

Stata: Software for Statistics and Data Science | Stata

Marginal means, predictive margins, and marginal effectsSyntaxMenuDescriptionOptionsRemar ks and examplesStored resultsMethods and formulasReferencesAlso seeSyntaxmargins[marginlist] [if] [in] [weight] [,responseoptions options]wheremarginlistis a list of factor variables or interactions that appear in the current estimation variables may be typed with or without , and you may use any factor-variable syntax:. margins # margins sex group sex# margins sex##groupresponseoptionsDescriptionMain predict(predopt)estimate margins forpredict,predoptexpression(pnlexp)esti mate margins forpnlexpdydx(varlist)estimate marginal effect of variables invarlisteyex(varlist)estimate elasticities of variables invarlistdyex(varlist)estimate semielasticity d(y)/d(lnx)eydx(varlist)estimate semielasticity d(lny)/d(x)

requires that the linearized variance estimation method be used for the model. See[SVY] svy postestimation for anexampleof margins with replication-based methods. nose suppresses calculation of the VCE and standard errors. See Requirements for model specification for an example of the use of this option. Advanced

Tags:

  Variance

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Stata: Software for Statistics and Data Science | Stata

1 Marginal means, predictive margins, and marginal effectsSyntaxMenuDescriptionOptionsRemar ks and examplesStored resultsMethods and formulasReferencesAlso seeSyntaxmargins[marginlist] [if] [in] [weight] [,responseoptions options]wheremarginlistis a list of factor variables or interactions that appear in the current estimation variables may be typed with or without , and you may use any factor-variable syntax:. margins # margins sex group sex# margins sex##groupresponseoptionsDescriptionMain predict(predopt)estimate margins forpredict,predoptexpression(pnlexp)esti mate margins forpnlexpdydx(varlist)estimate marginal effect of variables invarlisteyex(varlist)estimate elasticities of variables invarlistdyex(varlist)estimate semielasticity d(y)/d(lnx)eydx(varlist)estimate semielasticity d(lny)/d(x)continuoustreat factor-level indicators as continuousoptionsDescriptionMaingrandadd the overall margin.

2 Default if nomarginlistAtat(atspec)estimate margins at specified values of covariatesatmeansestimate margins at the means of covariatesasbalancedtreat all factor variables as balancedif/in/overover(varlist)estimate margins at unique values ofvarlistsubpop(subspec)estimate margins for subpopulationWithinwithin(varlist)estima te margins at unique values of the nesting factors invarlistContrastcontrastoptionsany options documented in [R]margins, contrastPairwise comparisonspwcompareoptionsany options documented in [R]margins, pwcompare12 margins Marginal means, predictive margins, and marginal effectsSEvce(delta)estimateSEs using delta method.

3 The defaultvce(unconditional)estimateSEs allowing for sampling of covariatesnosedo not estimateSEsAdvancednoweightsignore weights specified in estimationnoesampledo not restrictmarginsto the estimation sampleemptycells(empspec)treatment of empty cells for balanced factorsestimtolerance(tol)specify numerical tolerance used to determine estimable functions;default isestimtolerance(1e-5)noestimchecksuppre ss estimability checksforceestimate margins despite potential problemschainruleuse the chain rule when computing derivativesnochainruledo not use the chain ruleReportinglevel(#)set confidence level; default islevel(95)mcompare(method)adjust for multiple comparisons.

4 Default ismcompare(noadjust)noatlegendsuppress legend of fixed covariate valuespostpost margins and theirVCEas estimation resultsdisplayoptionscontrol columns and column formats, row spacing, line width andfactor-variable labelingdf(#)usetdistribution with#degrees of freedom for computingp-valuesand confidence intervalsmethodDescriptionnoadjustdo not adjust for multiple comparisons; the defaultbonferroni[adjustall]Bonferroni s method; adjust across all termssidak[adjustall] Sid ak s method; adjust across all termsscheffeScheff e s methodTime-series operators are allowed if they were used in the ()underOptionsfor a description ,aweights,iweights, andpweights are allowed.

5 See[U] (#)does not appear in the dialog >Postestimation>Marginal means and predictive marginsStatistics>Postestimation>Margina l effectsDescriptionMargins are Statistics calculated from predictions of a previously fit model at fixed values of somecovariates and averaging or otherwise integrating over the remaining Marginal means, predictive margins, and marginal effects 3 Themarginscommand estimates margins of responses for specified values of covariates andpresents the results as a include estimated marginal means.

6 Least-squares means, average and conditionalmarginal and partial effects (which may be reported as derivatives or as elasticities), average andconditional adjusted predictions, and predictive : The option descriptions are brief and use jargon. Skip to Remarks and examples if you arereading aboutmarginsfor the first time. Main predict(predopt)andexpression(pnlexp)are mutually exclusive; they specify the response. Ifneither is specified, the response will be the default prediction that would be produced bypredictafter the underlying estimation (predopt)specifies the option(s) to be specified with thepredictcommand to producethe variable that will be used as the response.

7 After estimation bylogistic, you could specifypredict(xb)to obtain linear predictions rather than thepredictcommand s default, (pnlexp)specifies the response as an expression. See [R]predictnlfor afull description ofpnlexp. After estimation bylogistic, you might specifyexpres-sion(exp(predict(xb)))to use relative odds rather than probabilities as the examples, seeExample 12: Margins of a specified (varlist),eyex(varlist),dyex(varlist), andeydx(varlist)request thatmarginsreport deriva-tives of the response with respect tovarlistrather than on the response (),dyex(),andeydx()report derivatives as elasticities; seeExpressing derivatives as relevant only when one ofdydx()oreydx()is also specified.

8 It specifies that thelevels of factor variables be treated as continuous; seeDerivatives versus discrete differences. Thisoption is implied if there is a single-level factor variable specified indydx()oreydx().grandspecifies that the overall margin be assumed whenmarginlistis empty. At at(atspec)specifies values for covariates to be treated as (age=20)fixes covariateageto the value ()may be used to fix continuous orfactor (age=20 sex=1)simultaneously fixes covariatesageandsexat the values (age=(20 30 40 50))fixes age first at 20, then at 30.

9 Marginsproduces separate resultsfor each specified (age=(20(10)50))does the same asat(age=(20 30 40 50)); that is, you may specify ((mean) age (median) distance)fixes the covariates at the summary Statistics ((p25)all)fixes all covariates at their 25th percentile values. SeeSyntax of at()for thefull list of summary-statistic ((mean)all (median) x x2= z=(1 2 3))is read from left to right, with latter specifiersoverriding former ones. Thus all covariates are fixed at their means except forx(fixed at itsmedian),x2(fixed at ), andz(fixed first at 1, then at 2, and finally at 3).

10 4 margins Marginal means, predictive margins, and marginal effectsat((means)all (asobserved) x2)is a convenient way to set all covariates exceptx2to ()options can be specified, and each will produce a different set of of at()for more that covariates be fixed at their means and is shorthand forat((mean)all).atmeansdiffers fromat((mean)all)in thatatmeanswill affect subsequentat() instance,. , atmeans at((p25) x) at((p75) x)produces two sets of margins with both sets evaluated at the means of all covariates shorthand forat((asbalanced)factor)and specifies that factor covariates beevaluated as though there were an equal number of observations in each level; seeObtaining marginsas though the data were fromat((asbalanced)factor)inthatasbalanc edwill affect subsequentat()options in the same way asatmeansdoes.


Related search queries