rologit.hlp

来自「是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到」· HLP 代码 · 共 258 行

HLP
258
字号
{smcl}
{* 02feb2005}{...}
{cmd: helpb rologit}{right:dialog:  {bf:{dialog rologit}}{space 15}}
{right:also see:  {help rologit postestimation}}
{hline}

{title:Title}

{p2colset 5 20 22 2}{...}
{p2col :{hi:[R] rologit} {hline 2}}Rank-ordered logistic regression{p_end}
{p2colreset}{...}


{title:Syntax}

{p 8 17 2}
{cmd:rologit} {depvar} {indepvars} {ifin} {weight} {cmd:,}
   {opth gr:oup(varname)} 
   [{it:options}]

{marker options}{...}
{synoptset 19 tabbed}{...}
{synopthdr:options}
{synoptline}
{syntab:Model}
{p2coldent: * {opth gr:oup(varname)}}identifier variable that links the
alternatives{p_end}
{synopt :{opth off:set(varname)}}include {it:varname} in model with 
coefficient constrained to 1{p_end}
{synopt :{opt inc:omplete(#)}}use {it:#} to code unranked alternatives; 
default is {cmd:incomplete(0)}{p_end}
{synopt :{opt rev:erse}}reverse the preference order{p_end}
{synopt :{opt note:strhs}}keep RHS variables that do not vary within group{p_end}
{synopt :{opt ties(spec)}}method to handle ties: {opt exactm}, {opt breslow}, 
{opt efron}, or {opt none}{p_end}

{syntab:SE/Robust}
{synopt :{opt r:obust}}compute standard errors using the robust/sandwich
estimator{p_end}
{synopt :{opth cl:uster(varname)}}adjust standard errors for intragroup
correlation{p_end}

{syntab:Reporting}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}

{syntab:Max options}
{synopt :{it:{help rologit##maximize_options:maximize_options}}}control the maximization process; seldom used{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}*{opth group(varname)} is required.{p_end}
{p 4 6 2}{cmd:bootstrap}, {cmd:by}, {cmd:jackknife}, {cmd:rolling},
{cmd:statsby}, and {cmd:xi} are allowed; see {help prefix}.{p_end}
{p 4 6 2}{cmd:fweight}s, {cmd:iweight}s, and {cmd:pweight}s, are allowed; 
see {help weight}.  No weights are allowed in the case of ties.{p_end}
{p 4 6 2}See {help rologit postestimation} for additional capabilities
of estimation commands.


{title:Description}

{pstd}
{cmd:rologit} fits the rank-ordered logistic regression model by
maximum likelihood.  This model is also known as the Plackett-Luce model,
as the exploded logit model, and as the choice-based method of  
conjoint analysis.

{pstd}
{cmd:rologit} expects the data to be in long form, similar to {helpb clogit},
in which each of the ranked alternatives forms an observation; all observations
related to an individual are linked together by the variable that you specify
in the {opt group()} option.  The distinction from {cmd:clogit} is that
{it:depvar} in {cmd:rologit} records the rankings of the alternatives, whereas
for {cmd:clogit}, {it:depvar} only marks the best alternative by a value not
equal to zero.  {cmd:rologit} interprets equal scores of {it:depvar} as ties.
The ranking information may be incomplete "at the bottom" (least preferred
alternatives).  That is, unranked alternatives may be coded as 0 or as a
common value that may be specified with the {opt incomplete()} option.

{pstd}
If your data record only the unique alternative, {cmd:rologit}
fits the same model as {helpb clogit}.


{title:Options}

{dlgtab:Model}

{phang}
{opth group(varname)} is required, and it specifies the identifier variable
(numeric or string) that links the alternatives for an individual, which have
been compared and rank-ordered with respect to one another.

{phang}
{opth offset(varname)}; see
      {help estimation options##offset():estimation options}.

{phang}
{opt incomplete(#)} specifies the numeric value used to code alternatives
that are not ranked.  It is assumed that unranked alternatives are less
preferred than the ranked alternatives (i.e., the data record the ranking of
the most preferred alternatives).  It is not assumed that subjects are
indifferent between the unranked alternatives.  {it:#} defaults to 0.

{phang}
{opt reverse} specifies that in the preference order, a higher number
means a less attractive alternative.  The default is that higher values
indicate more attractive alternatives.  The rank-order logit model
is not symmetric in the sense that reversing the ordering simply leads 
to a change in the signs of the coefficients.

{phang}
{opt notestrhs} suppresses the test that the independent variables vary within
(at least some of) the groups.  Effects of variables that are always constant
are not identified.  For instance, a rater's sex cannot directly affect his or
her rankings; it could affect the rankings only via an interaction with a
variable that does vary between alternatives.

{phang}
{opt ties(spec)} specifies the method for handling ties (indifference between
alternatives) (see {helpb stcox} for details): 

{p2colset 9 19 21 2}{...}
{p2col :{opt ex:actm}}exact marginal likelihood (default){p_end}
{p2col :{opt bre:slow}}Breslow's method{p_end}
{p2col :{opt efr:on}}Efron's method{p_end}
{p2col :{cmd:none}}no ties allowed{p_end}
{p2colreset}{...}

{dlgtab:SE/Robust}

{phang}
{opt robust}, {opth cluster(varname)}; see
    {help estimation options##robust:estimation options}. 
Note that if {opt robust} or {opt cluster()} are specified and there are tied
rankings in the data, {cmd:ties(efron)} is imposed.

{dlgtab:Reporting}

{phang}
{opt level(#)}; see {help estimation options##level():estimation options}. 

{marker maximize_options}{...}
{dlgtab:Max options}

{phang}
{it:maximize_options}: {opt iter:ate(#)}, {opt tr:ace},
[{cmd:{ul:no}}]{cmd:{ul:lo}}{cmd:g}, {opt tol:erance(#)}, 
{opt ltol:erance(#)}, see {help maximize}.  These options are seldom used.


{title:Example}

{pstd}
You have data in which subjects ranked up to 4 options.  {cmd:rologit}
requires that the data are in "long format", in which the responses of a
single subject are recorded in different records (observations).

{center:caseid    depvar   option   x1    x2}
{center:   1         4        1      1     0}
{center:   1         2        2      0     1}
{center:   1         3        3      0     0}
{center:   1         1        4      1     1}

{center:   2         1        1      3     0}
{center:   2         3        2      0     1}
{center:   2         3        3      2     1}
{center:   2         4        4      1     2}

{center:   3         1        1      3     1}
{center:   3         3        2      1     1}
{center:   3         4        4      0     1}

{center:   4         2        1      1     1}
{center:   4         1        2      1     1}
{center:   4         0        3      0     1}
{center:   4         0        4      1     0}

{pstd}
where 0 indicates that subject 4 only specified his two most
favorable alternatives. In this example

{pmore}
subject 1 has ranking

{pmore2}
option_1 > option_3 > option_2 > option_4

{pmore}
subject 2 has a ranking with ties,

{pmore2}
option_4 > option_2 == option_3 > option_1

{pmore}
subject 3 ranked a subset of alternatives, ignoring option 3,

{pmore2}
option_4 > option_2 > option_1

{pmore}
subject 4 had an incomplete ranking

{pmore2}
option_1 > option_2 > (option_3,option_4)

{pstd}
Note that subject 4 ranked option_1 highest among all 4 options, and ranked
option_2 highest among the remaining three options.  His preference ordering
among option_3 and option_4, however, is not known.

{pstd}
You can fit a rank-ordered logit model for up to 4 alternatives as

{pmore}{cmd:. rologit depvar x1 x2, group(caseid)}{p_end}

{pstd}
More complicated models may be formulated as well.  We can perform a
likelihood ratio test that men and women rank the options in the same way
(note that the main effect of sex is not identified),

{pmore}{cmd:. lrtest, saving(0)}{p_end}
{pmore}{cmd:. gen sx1 = x1 * (male==1)}{p_end}
{pmore}{cmd:. gen sx2 = x2 * (male==1)}{p_end}
{pmore}{cmd:. rologit depvar x1 x2 sx1 sx2, group(caseid)}{p_end}
{pmore}{cmd:. lrtest}{p_end}


{title:A note on data organization}

{pstd}
Sometimes your data will be in a "wide format" in which the ranking
of options are described in a series of variables, rather than in different
observations that are associated with a single subject.

	caseid  opt1  opt2  opt3  opt4
	  1       4     2     3     1
	  2       1     3     3     4
	  3       1     3     .     4
	  4       2     1     0     0

{pstd}
You may want to verify that this information is identical to the data in
long format listed above.  The Stata command {helpb reshape} makes the
transformation between "long" and "wide" formats quite simple,

{pmore}{cmd:. reshape long opt, i(caseid) j(opt)}{p_end}
{pmore}{cmd:. drop if opt == .}{p_end}


{title:Also see}

{psee}
Manual:  {hi:[R] rologit}{p_end}

{psee}
Online:  {help rologit postestimation};{break}
{helpb clogit}, {helpb logit}, {helpb mlogit}, {helpb nlogit}{p_end}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?