Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: fsum labels with multi-level variable

From   "Lane, Scott D" <>
To   "" <>
Subject   st: fsum labels with multi-level variable
Date   Tue, 19 Feb 2013 16:26:13 -0600

I have the following fsum code, which looks OK in the output, except that dose remains listed by number (1-4, as entered in the data) rather than by label (which is my intention).  I have scanned all the fsum documentation and the list serve FAQ to no avail.  Here is the code, any help would be appreciated.

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"
sort dose
by dose: fsum dose i_systolic i_diastolic i_hr, stats(mean se p25 p50 p75) format(%9.2f) uselabel

I think I understand that this does not work because the [by dose] call should come after the [fsum] call, but it's not clear how to get fsum to list by dose otherwise…

Scott Lane

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index