Skip to content

Conversation

@zoniusalexandr
Copy link

These changes make binscatter use the variable label, instead of the variable name, to label the axes and the legend entries. If the variable label is empty, it uses the variable name instead. This works with "by" and with multiple y-variables.

I've tested it briefly using the examples given in the help file for binscatter, but I haven't had a chance to exhaustively test it yet. In particular, I don't know what happens when you add special characters (like quotes) to a variable label and then try this command.

Previous version used only variable names to label the axes and legend
entries. This commit changes the program to use variable labels if they
exist, and variable names otherwise.

The one exception is the label for the y-axis if there are multiple
y-variables. I'll add in a for-loop sometime in the future to fix this.
Added a for loop to cover the case with multiple y-variables. Now each variable is described using the variable label, or the variable name if there is no label, using the appropriate separator.
@michaelstepner
Copy link
Owner

Thanks, this is a good idea, and would match the behaviour of other commands (like -scatter-).

I just started a new semester, so it'll be a few weeks before I get around to updating binscatter and releasing a new version. But I'll definitely include this in the next release.

@zoniusalexandr
Copy link
Author

Excellent, I'm glad my tinkering can be of some use. Good luck in school! 

By the way, do you know of a good resource for writing programs in Stata? It's such a unique language, my programming experience doesn't carry over as much as I had hoped. 

Sent from a telephone

On Mon, Feb 3, 2014 at 11:31 PM, Michael Stepner notifications@github.com
wrote:

Thanks, this is a good idea, and would match the behaviour of other commands (like -scatter-).

I just started a new semester, so it'll be a few weeks before I get around to updating binscatter and releasing a new version. But I'll definitely include this in the next release.

Reply to this email directly or view it on GitHub:
#2 (comment)

@michaelstepner
Copy link
Owner

I don't know of any general references or tutorials. My own training in Stata came about through lots of practice (writing Stata code was my primary job for a year) and frequent reference to the Stata docs (help files and the PDF manuals that are linked to from the help files). I find the Stata documentation is quite good. Although not that helpful for getting used to Stata's odd syntax, I suppose.

There are two resources from which I learned quite a bit about improving the efficiency of my code:

  1. Stata for very large datasets, Daniel Feenberg
  2. Optimizing Stata for analysis of large datasets, Joseph Canner and Eric Schneider

I think the main takeaway from those articles is that these programming functions are useful and often forgotten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants