Closed tamuri closed 4 years ago
Screenshot:
A couple of quick comments:
by inserting almost random numbers, I noticed that if a measurement is very far from the average (probably more than 5 SDSs), we don't get a centile number but the z-score, so in the plot we can't see the measurement:
would it make sense to always make sure that height = sitting height + leg length? As it is now, a change in height updates leg length, a change in sitting height updates leg lengths, a change in leg length doesn't affect anything. Having three measurements involved makes it very tricky to keep them consistent.
by inserting almost random numbers, I noticed that if a measurement is very far from the average (probably more than 5 SDSs), we don't get a centile number but the z-score, so in the plot we can't see the measurement.
Yes, maybe we can set all SDS > 3.3 to 99.9 centile, for plotting purposes. @statist7?
would it make sense to always make sure that height = sitting height + leg length? As it is now, a change in height updates leg length, a change in sitting height updates leg lengths, a change in leg length doesn't affect anything. Having three measurements involved makes it very tricky to keep them consistent.
Agreed, it's too complicated to do anything sensible. Let's keep the current calculations and revisit if we get a good idea.
The tab looks really good.
Yes, maybe we can set all SDS > 3.3 to 99.9 centile, for plotting purposes. @statist7?
The centile scale distorts reality with its 0-100 scale, and values in the tails all get crammed together. It might be better plotting them on the underlying z-score scale, so you use the existing centile numbers (a nice touch) but plot them at the corresponding z-score values. In this way extreme values can be seen spread out rather than crammed up against 0 or 100. The scale would need to use z-score labels beyond the 0.1th and 99.9th centiles, as z2cent
provides.
The scale should also probably automatically expand to handle outliers, within reason.
Another alternative would be to have three plot options: centile, z-score and centile on z-score (i.e. what I've just described). The advantage of the current centile scale is that it will (or should) plot everything, even extreme outliers, as they will be close to 0 or 100. In fact I think it currently omits extremely low outliers, which it shouldn't. Conversely high outliers appear as a fraction of a blob.
would it make sense to always make sure that height = sitting height + leg length?
This is indeed tricky. Entering height then leg length inserts sitting height, but updating sitting height then does nothing. When this happens it might be worth adding a flag next to leg length to show it is out of sync, assuming that height is always taken as correct. Perhaps change it to italic font?
Note that playing around this way generates a warning in renderPlotly.
The age input is very flexible - I see it takes a decimal age quite happily, which is useful.
Hi @giordano, this is ready to review. I've made all the changes and the few others we discussed (e.g. dynamically setting the range of the plot to accomodate extreme values)
handle switching between growth charts.
This PR adds
formattable
package, so you need topackrat::restore()
before running.