Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Relabeling the factor variable categories/coefficients in estout/Omitting value labels in logit output

    Greetings, there are two ways to resolve my issue, I think.

    1. Get my logit output to show the actual names associated with the factor-variable categories and their coefficients. Is there a no-labels option for logit or other regression commands?
    2. Learn Stata's default naming convention for the coefficients/categories associated with factor variables when using the i dot notation in regression output.

    My particular context and what I want to do:

    I want to relabel the rows in my table using estout. Typically this is achieved using the option:

    varlabels (varname newlabel)

    as in the example varlabels (_cons Constant) which replaces the row name "_cons" in my estout output with "Constant".

    However, when I include a factor variable in my regression using the i dot notation... I do not know how to reference the "varname" and I can't seem to figure out how to get stata to tell me what they are called so that I can change the names of the rows containing coefficients for the factor variable categories. I would like to relabel the resulting rows in my table to indicate that they are categories in the factor variable.

    I have a categorical variable, "OwnLang4" (a 4 category language indicator) with the following labels:
    1 "Catalan"
    2 "Catalan and Spanish"
    3 "Spanish"
    4 "Aranes or other"

    In the output of my logit model and of my estout table the following rows appear

    Catalan
    Catalan and Spanish
    Spanish
    Aranes or other

    I would like to rename these rows to that they are all part of the OwnLang4 factor variable. For example: OwnLang4_Catalan. However, when I use the labels in the est out command (e.g. "varlabels (Catalan OwnLang4_Catalan)") Nothing changes because presumably there is a true name for each factor variable category (not the label), but I can't see it in my output.

    So I would like to ask how to get Stata to show me the real name of each factor variable category's coefficient.

    Thank you.

  • #2
    When you refer to labels, you dont refer to individual lables but the set of labels.
    So dont replace the label 'catalan', but replace the label for 'OwnLang'. You can add a prefix to each of the categories as in this example:

    Code:
    sysuse auto, clear
    eststo: quietly regress price mpg i.foreign
    eststo: quietly regress price c.mpg##i.foreign
    esttab using example.rtf, varlabels(foreign, prefix(Origin:)) replace
    and note estout or esttab in the last line is both valid, esttab will just give prettier results

    Comment

    Working...
    X