Friday, October 28, 2011

Stata: curve labels for sts graph

I'm plotting KM curves in Stata using

sts graph, by(iGroup)

and here is the plot that I get:
Note that the default curve labels in the legend are of the type "varname=label" for each group. Clearly, this isn't the desired labeling because there is no need for the "varname=" part.  I didn't find much on help on the web regarding how to deal with this (except this post which is cumbersome, to say the least).  There also does not appear to be an option in sts graph or in legend() to change this behavior. Also, it's not the behavior of other plot types (e.g. graph bar age, over(iGroup) labels everything with just the value label).

So here is my solution - it is to define the value labels using global macros:

global iGroup1 "Group -/-"
global iGroup2 "Group -/+"
global iGroup3 "Group +/+"
label def iGroup 1 "$iGroup1" 2 "$iGroup2" 3 "$iGroup3", modify
label val iGroup iGroup
stset DFS, fail(Relapse)
sts graph, by(iGroup) legend(label(1 "$iGroup1") label(2 "$iGroup2") label(3 "$iGroup3"))

And voilà!

Any thoughts?

Monday, October 17, 2011

Mendeley Workshop Tuesday, 10/18 noon

I really like using Mendeley for reference management, and as soon as they add the capability to deal with PMCID's, it will be absolutely perfect in my view.  Our library has a training workshop on Mendeley - here is the link.

Monday, October 10, 2011

Waterfall plot in Stata

*** Waterfall plot
gsort - recist_pct
gen i=_n
tw bar recist_pct i , ytitle("RECIST %Change") xtitle("")

Stata code that produces this plot:

Gaming & Research (decoding aids protein)

For more than 20 years, I have stubbornly preached about the importance of teamwork, functional relationships.  It has been intuitively clear to me for years that non-experts are an essential contributors in a properly structured team environment.  In my engineering work I have also demonstrated the parallels between the structure of functioning human social systems and good technical architecture (as well as taught teams to see, and apply this).

Here is an example from a different field which, while it doesn't surprise me, does thrill me.

It's about the foldit game developed at the University of Washington, and how non-experts decoded an aids protein.

A lay overview appears here:

A paper outlining how experts structured involving others in a way which worked (and which may have some simple lessons for broader application):

Sunday, October 9, 2011

Source Tree (Easy Repositories)

I realize this isn't for everyone, so please filter if it doesn't apply to you.

If you:

  • use a macintosh  (Snow Leopard or newer OS/X);
  • use source repositories (any of SVN,  git, or mercurial / hg )
then you might want to have a look at a free (for the time being) desktop tool to manage, view your repositories:
It's from Atlassian, the people who run   At first look, it seems to be reasonable.


- Yarko

Oh, Fun!

Just thought I'd share this curiosity:

And for those not interested in mapping their own, this related note is also interesting:

Subscribe via email

Enter your email address:

Delivered by FeedBurner