Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

asdoc abbreviates / truncates my variable names and labels | Word to Stata

  • 3

asdoc abbreviates / truncates my variable names and labels | Word to Stata

Category:asdoc

Stephen Okiya has asked the following question

I notice that the variable names are truncated in spite of using the option abb(100). Do you know why this is the case?


Answer:

asdoc uses the abbrev() function of Mata. For some reasons, the abbrev() function splits the following sentence in half, no matter which value we set for the abbreviation.

loc vari " Child's age when she/he was first fed something other than breast milk"

. dis abbrev("`vari'", 32)
 Child's age when she/he was firs

 . dis abbrev("`vari'", 100)
 Child's age when she/he was firs

However, we set the second argument of abbrev() function to missing, then the full sentence is show

. dis abbrev("`vari'", .)

Child's age when she/he was first fed something other than breast milk

Therefore, if we prefer not to abbreviate any name or label, just provide missing value for the abb() option of asdoc. So the following will show all the text

asdoc sum Q85, label abb(.)




3 Comments

michael

October 4, 2019at 7:37 pm

when I use the label option, the abb(.) trick doesn’t seem to work; I always get 32 characters, and no more.

    Attaullah Shah

    October 5, 2019at 12:10 am

    Michael
    Please mention the Stata command with which you are using asdoc.

Nathan, Bradley

October 6, 2019at 8:44 pm

I am excited to try out your impressive asdoc Stata function for a paper I am about to submit as the outputs look quite attractive. My aim is to have the full variable names show in the outputted tables without any abbreviation of variable names occurring.

However, I noticed that the abbreviation option does not seem to work per the help file. Specifically, longer dependent and independent variable names in the regression tables outputted by asdoc remain cut off regardless of what I specify for abb() or whether I combine it with the label option. The help file says specifying the label and abb() options together should cause the variable name length to be abb + 22.

Here is some example code:

asdoc reg sentiment firm_ban avg_volatility_12mos_g lnmve_q leverage_q, vce(robust)

nest label abb(9) save(TEST_ABB) replace

Leave a Reply

two × 1 =