Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: solved


From   "Lane, Scott D" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: solved
Date   Tue, 19 Feb 2013 17:02:26 -0600

Regarding my earlier post [st: fsum labels with multi-level variable], I found the solution by doing some additional homework on the labels function.  By adding the line [label values dose dose], I was able to get the dose names to display in fsum.  Perhaps this can help someone out in the future.  For those skilled in writing ado code, adding an option to export to a text file (as with tabout) would be a nice addition to fsum (which has a much better effort-to-flexibility ratio than tabout).  One can always use translate @Results, but the formatting is not well maintained.  Revised code:

label variable i_systolic "systolic BP"
label variable i_diastolic "diastolic BP"
label variable i_hr "heart rate"
label define dose 1 "placebo" 2 "150 mg caffeine" 3 "300 mg caffeine" 4 "450 mg caffeine"
label values dose dose /// <== added code here ///
sort dose
by dose: fsum dose i_systolic i_diastolic i_hr, stats(mean se p25 p50 p75) format(%9.2f) uselabel


Regards,
Scott Lane
UTHSC-Houston

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index