Hello all,
I was learning collect and trying to make a table of summary statistics. I want to modify the labels for Rai stage as below, but the modification is not visible in the collect preview.
***********************
table (var) (age65), ///
statistic(median agedx tsbcreat) ///
statistic(range agedx tsbcreat) ///
statistic(fvfrequency raidx2 IPI4 tscons) ///
statistic(fvpercent raidx2 IPI4 tscons) ///
statistic(median tsbblr tsbalb tsbplt) ///
statistic(range tsbblr tsbalb tsbplt) ///
nototal
// Change median and range to two columns rather than stacked
collect recode result fvfrequency = column1 ///
fvpercent = column2 ///
median = column1 ///
range = column2
collect layout (var) (age65#result[column1 column2])
collect style cell var[raidx2 IPI4 tscons]#result[column1], nformat(%6.0fc)
collect style cell var[raidx2 IPI4 tscons]#result[column2], ///
nformat(%6.1f) sformat("%s%%")
collect style cell ///
var[agedx tsbcreat tsbblr tsbalb tsbplt]#result[column1 column2], ///
nformat(%6.1f)
collect style cell ///
var[agedx tsbcreat tsbblr tsbalb tsbplt]#result[column2], ///
sformat("(%s)")
collect preview
collect label dim age65 "Age groups", modify /// works properly
collect label levels colname raidx2 "Rai stage at Diagnosis", modify /// does not update
collect label list raidx2
collect style header result, level(hide)
collect preview
// Row labels
collect style row stack, nobinder spacer
collect style cell border_block, border(right, pattern(nil))
collect preview
I was learning collect and trying to make a table of summary statistics. I want to modify the labels for Rai stage as below, but the modification is not visible in the collect preview.
***********************
table (var) (age65), ///
statistic(median agedx tsbcreat) ///
statistic(range agedx tsbcreat) ///
statistic(fvfrequency raidx2 IPI4 tscons) ///
statistic(fvpercent raidx2 IPI4 tscons) ///
statistic(median tsbblr tsbalb tsbplt) ///
statistic(range tsbblr tsbalb tsbplt) ///
nototal
// Change median and range to two columns rather than stacked
collect recode result fvfrequency = column1 ///
fvpercent = column2 ///
median = column1 ///
range = column2
collect layout (var) (age65#result[column1 column2])
collect style cell var[raidx2 IPI4 tscons]#result[column1], nformat(%6.0fc)
collect style cell var[raidx2 IPI4 tscons]#result[column2], ///
nformat(%6.1f) sformat("%s%%")
collect style cell ///
var[agedx tsbcreat tsbblr tsbalb tsbplt]#result[column1 column2], ///
nformat(%6.1f)
collect style cell ///
var[agedx tsbcreat tsbblr tsbalb tsbplt]#result[column2], ///
sformat("(%s)")
collect preview
collect label dim age65 "Age groups", modify /// works properly
collect label levels colname raidx2 "Rai stage at Diagnosis", modify /// does not update
collect label list raidx2
collect style header result, level(hide)
collect preview
// Row labels
collect style row stack, nobinder spacer
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 age65 float agedx byte raidx2 double tsbcreat byte(IPI4 tscons) double(tsbblr tsbalbm) long tsbplt 0 47.32923 0 .8 2 0 .4 4.1 190000 1 62.95962 1 1.05 . 1 .7 3 99000 1 81.36619 1 1.4 3 1 .4 4 151000 0 55.09925 . 1.03 1 . 1.5 2.4 29000 1 . . . . . . . . 1 66.42026 0 .8 3 1 .8 3.9 23000 1 82.61191 1 2.35 2 0 .4 3.9 80000 1 56.0438 . .8 . 1 1.6 2.8 48000 1 69.42916 0 1.7 3 1 .8 4.2 145000 1 58.71047 0 .7 . 0 1 4.1 185000 1 59.68241 . 3.2 . 0 .3 2.4 326000 0 38.76523 0 1 2 1 .6 1 114000 0 59.51814 0 .9 1 1 .5 4.3 126000 1 56.35866 0 1.13 . 0 .5 4.5 102000 0 57.5989 . .7 1 0 .4 3.6 85000 0 45.22656 1 .4 1 0 .8 2.6 16000 1 67.518135 1 .8 3 1 .3 4.5 91000 0 55.0089 0 1 2 0 .6 4.3 85000 1 82.76523 0 1.4 3 0 .3 4.1 203000 1 68.39425 0 .8 3 0 .5 3.6 162000 1 53.94935 0 2 3 1 2 3.9 199000 1 77.76044 . .8 . 0 .4 2 137000 0 52.35866 0 .6 0 1 .3 3.9 244000 1 60.04107 0 .9 3 0 1.1 3.2 113000 0 48.33402 0 1 0 1 .3 4.1 178000 1 72.76386 0 1.3 2 0 .6 4.1 141000 0 51.18412 1 1.07 0 0 .5 2.9 387000 0 33.952087 . 1.1 1 0 .6 3.9 156000 0 60.75565 0 .7 . 0 .2 4.2 260000 0 54.77892 . .9 0 1 1.7 4.2 44000 1 54.40657 0 .5 3 0 1.8 4.1 63000 1 66.10541 . . . . . . . 1 75.72348 . 1.2 1 1 .2 4.1 275000 1 60.91444 . . . . . . . 0 54.76249 1 1 0 0 .1 2.9 163000 0 56.282 0 .8 . . .4 3.2 133000 1 70.20944 0 1.4 3 1 .5 2.3 94000 0 57.74675 0 1 3 0 .9 4.5 114000 1 53.53593 . 2.3 . 1 .3 4.1 361000 0 53.99589 0 .8 3 1 .4 3.5 264000 0 50.2423 . 1.3 . 1 .3 3.6 53000 0 45.12526 0 1.2 1 1 .3 3.9 98000 1 . . . . . . . 231000 1 81.35524 . 1 2 1 .5 4.3 192000 1 49.82615 . .5 3 1 1.2 2 12000 1 67.8549 . .8 . 0 .5 4.2 200000 1 67.19507 0 1.1 . 1 1.6 3.2 11000 0 55.1321 0 1.1 0 1 .5 3.8 103000 1 . . . . . . . . 1 75.65777 . 1.2 . 1 .3 3.8 211000 1 . . . . . . . . 0 52.5065 1 .5 . 1 .4 3.1 260000 0 61.51403 . .8 . . .4 4.5 184000 1 64.28474 . .9 1 1 .4 3.1 250000 0 46.59001 0 1.1 2 1 3.6 3.5 7000 0 42.51335 . .9 . 0 .4 5 237000 1 57.62355 . 1 . 1 2.8 4 39000 0 48.58316 . . . . . . . 0 51.09377 0 1.1 2 0 1.5 4.6 2000 0 . . . . . . . . 1 60.03286 . 1.6 1 0 1.2 4.2 134000 0 46.6694 . 1.4 . 0 .8 4 28000 1 63.44969 . 2.3 . 1 .8 3.6 130000 0 36.70363 . .6 0 1 1.4 3.8 685000 1 63.4579 . .9 1 1 1.7 1.9 12000 0 57.79329 0 1.3 . 1 .2 4.3 279000 0 48.77481 . . . 0 6.4 . . 1 67.54004 . .9 . 1 .6 4.6 107000 0 46.48597 . 1.4 1 0 .8 4.1 78000 0 55.33196 1 1.1 . 0 .6 3.7 7000 0 47.93155 . 1.1 2 0 1.8 2.2 34000 0 33.90007 0 .7 0 1 .8 3.8 180000 1 . . 1 . . 1.5 3.3 165000 0 48.4627 1 1.6 2 1 1.2 2.6 13000 0 59.72622 0 1.1 3 1 .4 4.1 113000 1 . . . . . . . . 1 58.705 . 1.3 2 1 1.9 3.4 50000 1 68.3039 . . . 1 . . . 1 70.49966 . .8 2 0 1.2 3.8 145000 0 49.35524 0 .89 0 1 .81 3.7 148000 1 59.4579 0 .98 2 1 .8 4.1 250000 1 59.98083 . . . . . . . 1 68.75291 . .67 . . .6 3 220000 1 59.40315 0 .8 0 0 .4 4.2 261000 1 78.97057 . 2.21 1 1 1.1 3.9 567000 1 71.474335 . . . . . . 16000 1 62.705 0 1.23 0 1 .3 3.6 112000 1 51.25531 1 .9 1 1 .7 4.2 75000 0 56.59411 0 1 1 0 .7 4.2 104000 1 62.90212 1 1.2 0 1 .5 4 70000 1 61.19644 0 1.2 3 1 1.3 3.2 43000 1 70.60917 0 1.2 1 0 3.7 4.1 153000 1 70.428474 1 .69 . 1 .5 4.1 310000 1 67.403145 0 1.6 3 0 1.4 2.5 32000 1 72.74744 . 1 1 0 .9 4.4 178000 1 64.39973 1 .85 . 0 .12 3.6 72000 1 68.520195 1 1.1 3 0 .8 4.7 51000 1 66.464066 . .7 3 0 .4 4.5 147000 1 66.10541 . . . 1 . . . 0 60.76934 0 .8 2 1 1 4.3 18000 end label values age65 age2 label def age2 0 "<65 years", modify label def age2 1 ">=65 years", modify label values raidx2 railab2 label def railab2 0 "Low Stage (0-2)", modify label def railab2 1 "High Stage (3-4)", 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 tscons posneglab label def posneglab 0 "Negative", modify label def posneglab 1 "Positive", modify
Comment