1. I want to keep median, IQR together while increasing the spacing between the column variable vital. I have tried playing with collect style column option but that is not giving me what I want. What option should I check?
2. I want to add a new row with its title to nest the three lab values under a title that would be called "Baseline Lab. studies at RT? How would I do that in the tables dialog or using a code?
This is what I have so far.
table (var) (vital), ///
statistic(median agedx) ///
statistic(iqr agedx) ///
statistic(fvfrequency female timeperiod raidx2 IPI4 tscons) ///
statistic(fvpercent female timeperiod raidx2 IPI4 tscons) ///
statistic(median tsbcreat tsbblr tsbalb) ///
statistic(iqr tsbcreat tsbblr tsbalb) ///
nototal
// Change median and range to two columns rather than stacked
collect recode result fvfrequency = column1 ///
fvpercent = column2 ///
median = column1 ///
iqr = column2
collect layout (var) (vital#result[column1 column2])
collect style cell var[female timeperiod raidx2 IPI4 tscons]#result[column1], nformat(%6.0fc)
collect style cell var[female timeperiod raidx2 IPI4 tscons]#result[column2], ///
nformat(%3.1f) sformat("%s%%")
collect style cell ///
var[agedx tsbcreat tsbblr tsbalb]#result[column1 column2], ///
nformat(%4.1f)
collect style cell ///
var[agedx tsbcreat tsbblr tsbalb]#result[column2], ///
sformat("(%s)")
collect preview
collect dims
collect label dim vital "Vital status", modify
collect label levels var raidx2 "Rai stage at Dx", modify
collect label list raidx2
collect label levels var timeperiod "Era of CLL diagnosis (n, %)", modify
collect label levels var IPI4 "NHL-IPI", modify
collect label levels var female "Gender", modify
collect label levels var tsbblr "Ser. Bilirubin at RT (mg/L)", modify
collect label levels var tsbalbm "Ser. Albumin at RT (g/dL)", modify
collect label levels var tsbcreat "Ser. Creatinine at RT (mg/L)", modify
collect label levels var agedx "Age,yrs (IQR)", modify
collect style header result, level(hide)
collect preview
collect dims
collect label list result, all
// Row labels
collect style row stack, nobinder spacer
collect style column, dups(center) extraspace(1) width(asis)
collect style cell border_block, border(right, pattern(nil))
collect preview
----------------------------------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte vital float agedx byte female double tsbblr byte(IPI4 timeperiod raidx2) double tsbcreat float tsbalbm 0 47.32923 1 .4 2 1 0 .8 4.1 1 62.95962 0 .7 . 2 1 1.05 3 1 81.36619 0 .4 3 2 1 1.4 4 0 55.09925 0 1.5 1 2 . 1.03 2.4 0 . 0 . . 2 . . . 0 66.42026 0 .8 3 1 0 .8 3.9 1 82.61191 0 .4 2 2 1 2.35 3.9 0 56.0438 1 1.6 . 1 . .8 2.8 0 69.42916 1 .8 3 1 0 1.7 4.2 1 58.71047 1 1 . 1 0 .7 4.1 0 59.68241 0 .3 . 2 . 3.2 2.4 0 38.76523 0 .6 2 1 0 1 1 0 59.51814 0 .5 1 2 0 .9 4.3 0 56.35866 0 .5 . 1 0 1.13 4.5 0 57.5989 1 .4 1 1 . .7 3.6 0 45.22656 0 .8 1 1 1 .4 2.6 0 67.518135 0 .3 3 2 1 .8 4.5 0 55.0089 0 .6 2 1 0 1 4.3 1 82.76523 0 .3 3 2 0 1.4 4.1 0 68.39425 0 .5 3 1 0 .8 3.6 0 53.94935 0 2 3 0 0 2 3.9 0 77.76044 0 .4 . 2 . .8 2 0 52.35866 1 .3 0 1 0 .6 3.9 0 60.04107 1 1.1 3 0 0 .9 3.2 1 48.33402 0 .3 0 1 0 1 4.1 0 72.76386 0 .6 2 1 0 1.3 4.1 0 51.18412 0 .5 0 1 1 1.07 2.9 1 33.952087 0 .6 1 0 . 1.1 3.9 1 60.75565 0 .2 . 2 0 .7 4.2 1 54.77892 0 1.7 0 2 . .9 4.2 1 54.40657 1 1.8 3 1 0 .5 4.1 1 66.10541 0 . . 1 . . . 1 75.72348 0 .2 1 2 . 1.2 4.1 1 60.91444 0 . . 1 . . . 0 54.76249 0 .1 0 2 1 1 2.9 0 56.282 0 .4 . 1 0 .8 3.2 0 70.20944 0 .5 3 1 0 1.4 2.3 1 57.74675 0 .9 3 1 0 1 4.5 1 53.53593 1 .3 . 0 . 2.3 4.1 0 53.99589 0 .4 3 1 0 .8 3.5 0 50.2423 0 .3 . 0 . 1.3 3.6 0 45.12526 0 .3 1 1 0 1.2 3.9 0 . 0 . . 1 . . . 1 81.35524 1 .5 2 1 . 1 4.3 0 49.82615 1 1.2 3 0 . .5 2 0 67.8549 0 .5 . 1 . .8 4.2 0 67.19507 1 1.6 . 1 0 1.1 3.2 1 55.1321 0 .5 0 1 0 1.1 3.8 1 . 0 . . 1 . . . 0 75.65777 0 .3 . 0 . 1.2 3.8 0 . 0 . . 1 . . . 0 52.5065 1 .4 . 1 1 .5 3.1 0 61.51403 1 .4 . 1 . .8 4.5 1 64.28474 0 .4 1 1 . .9 3.1 0 46.59001 0 3.6 2 1 0 1.1 3.5 0 42.51335 0 .4 . 1 . .9 5 0 57.62355 0 2.8 . 0 . 1 4 1 48.58316 0 . . 1 . . . 1 51.09377 0 1.5 2 1 0 1.1 4.6 0 . 0 . . 1 . . . 1 60.03286 0 1.2 1 0 . 1.6 4.2 0 46.6694 0 .8 . 1 . 1.4 4 0 63.44969 0 .8 . 0 . 2.3 3.6 0 36.70363 1 1.4 0 0 . .6 3.8 0 63.4579 0 1.7 1 0 . .9 1.9 1 57.79329 0 .2 . 1 0 1.3 4.3 1 48.77481 0 6.4 . 1 . . . 1 67.54004 0 .6 . 0 . .9 4.6 0 46.48597 0 .8 1 0 . 1.4 4.1 1 55.33196 0 .6 . 0 1 1.1 3.7 0 47.93155 1 1.8 2 0 . 1.1 2.2 0 33.90007 0 .8 0 0 0 .7 3.8 0 . 0 1.5 . 0 . 1 3.3 0 48.4627 0 1.2 2 0 1 1.6 2.6 0 59.72622 0 .4 3 0 0 1.1 4.1 0 . 1 . . 0 . . . 0 58.705 0 1.9 2 1 . 1.3 3.4 1 68.3039 0 . . 2 . . . 0 70.49966 0 1.2 2 1 . .8 3.8 0 49.35524 0 .81 0 1 0 .89 3.7 0 59.4579 1 .8 2 1 0 .98 4.1 1 59.98083 0 . . 1 . . . 1 68.75291 1 .6 . 2 . .67 3 1 59.40315 1 .4 0 1 0 .8 4.2 0 78.97057 1 1.1 1 2 . 2.21 3.9 0 71.474335 1 . . 2 . . . 1 62.705 0 .3 0 1 0 1.23 3.6 1 51.25531 1 .7 1 0 1 .9 4.2 1 56.59411 0 .7 1 2 0 1 4.2 1 62.90212 0 .5 0 2 1 1.2 4 0 61.19644 0 1.3 3 2 0 1.2 3.2 1 70.60917 0 3.7 1 2 0 1.2 4.1 1 70.428474 1 .5 . 2 1 .69 4.1 0 67.403145 0 1.4 3 1 0 1.6 2.5 1 72.74744 0 .9 1 2 . 1 4.4 0 64.39973 1 .12 . 2 1 .85 3.6 1 68.520195 0 .8 3 2 1 1.1 4.7 1 66.464066 0 .4 3 1 . .7 4.5 1 66.10541 0 . . 1 . . . 0 60.76934 1 1 2 2 0 .8 4.3 end label values vital vitallab label def vitallab 0 "Dead", modify label def vitallab 1 "Alive", modify label values female genderlbl label def genderlbl 0 "Male", modify label def genderlbl 1 "Female", modify label values IPI4 IPIlab label def IPIlab 0 "Low risk (0-1)", modify label def IPIlab 1 "Low-Intermediate risk (2)", modify label def IPIlab 2 "High-Intermediate(3)", modify label def IPIlab 3 "High Risk(4/5)", modify label values timeperiod timelab label def timelab 0 "Pre-2000", modify label def timelab 1 "2001-2010", modify label def timelab 2 "2011-2022", modify label values raidx2 Lrai label def Lrai 0 "Low Stage (0-2)", modify label def Lrai 1 "High Stage (3-4)", modify
0 Response to spacing between columns in collect table
Post a Comment