Hi all,
For reasons that aren't really worth going into, I'm trying to reproduce the algorithm that Stata uses to automatically label plot axes. I understand from here and here that the first bit of the algorithm is to start with the range of the variable and divide it into (about) 5 equally spaced labels. But I think there are other steps n the process, because it also always chooses round numbers (at an appropriate order of magnitude) to display. I'm wondering, is there a command that will produce these values for you automatically for any variable? Or a standard algorithm I could implement?
My instinct was to calculate the range of the variable and divide it into 5 groups, and then maybe use the size of those groups and the floor function in some combination to determine the right level of rounding. By I'm a little stuck at that point. Any thoughts or guidance?
Related Posts with What is Stata's full algorithm for automatically labelling axes on plots?
Local storing string content not workingHi, I would like to take the levels of a variable (string) in one file and use that list to loop thr…
Scatter plotHi All, I would like to graph a scatter plot with two y-axis and one x-axis. However, I want the se…
Loop issuesHi everyone. I have a dataset with this structure: date a1 a2 a3 a4 a5 example example_bis 01/0…
Random selection of first diagnosis code from the register dataDear all, I am working on the register-based cancer study. For the study, I would like to select on…
Stata reports decimals in IQRI want to report the interquartile range of charlson comorbidity index. I want do to that for a grou…
Subscribe to:
Post Comments (Atom)
0 Response to What is Stata's full algorithm for automatically labelling axes on plots?
Post a Comment