Hello
Hopefully just a quick one - I was comparing some results I produced using the "statsby" prefix with those when using "tabstat" & noticed a few minor differences that I can't work out.
I looked a little closer with different formatting in tabstat and I don't understand some (minor) differences when I format to a different number of units.
Eg, in the example below, when I use tabstat & format it to 1 dp (%9.1f) - can someone explain why the p50 for the "Control" group doesn't round to 5.6 - when I show it to 3dp (%9.3f) it is 5.550? (highlighted in red). Using statsby, it rounds to 5.6 as I would expect.
Probably easily explainable, just wanted to understand why I am getting slightly different results. Thank you!
Hopefully just a quick one - I was comparing some results I produced using the "statsby" prefix with those when using "tabstat" & noticed a few minor differences that I can't work out.
I looked a little closer with different formatting in tabstat and I don't understand some (minor) differences when I format to a different number of units.
Eg, in the example below, when I use tabstat & format it to 1 dp (%9.1f) - can someone explain why the p50 for the "Control" group doesn't round to 5.6 - when I show it to 3dp (%9.3f) it is 5.550? (highlighted in red). Using statsby, it rounds to 5.6 as I would expect.
Code:
. tabstat glucose, stats(n p50 p25 p75) by(randgroup) format(%9.3f)
Summary for variables: glucose
Group variable: randgroup (randgroup)
randgroup | N p50 p25 p75
-------------+----------------------------------------
Control | 278.000 5.700 5.000 6.700
Intervention | 280.000 5.550 4.800 6.800
-------------+----------------------------------------
Total | 558.000 5.600 4.900 6.800
------------------------------------------------------
. tabstat glucose, stats(n p50 p25 p75) by(randgroup) format(%9.1f)
Summary for variables: glucose
Group variable: randgroup (randgroup)
randgroup | N p50 p25 p75
-------------+----------------------------------------
Control | 278.0 5.7 5.0 6.7
Intervention | 280.0 5.5 4.8 6.8
-------------+----------------------------------------
Total | 558.0 5.6 4.9 6.8
------------------------------------------------------

Comment