17 ms·
1-based for statistics is a STRONG reason to use it. 0 based is ridiculous for a statistics program Could you elaborate on that? What about statistics do you f
by n00b101 10y ago
1-based for statistics is a STRONG reason to use it. 0 based is ridiculous for a statistics program
Could you elaborate on that? What about statistics do you feel makes it necessary to have 1-based indexing?
- cschmidt 10y agoMathematical notation is almost always 1 based. Let $v = 1 \dots n$, that sort of thing. So I find translating mathematics into code (which I seem to do quite frequently) much easier with 1 based indexing. (One exception being if you have a lot of modulo arithmetic.) I've used both 0 based (python, C++), and 1 based (R, matlab, mathematica), but I really belive 1 based is the right choice for Julia. It isn't necessary, but it feels better.
- Fomite 10y agoMy flippant answer: "No one is ever assigned Patient ID 0" It's mostly about expectations. Users of statistical software, who may or may not be programmers by inclination, use 1-based indexing. The program they came from uses 1-based indexing (R, SAS, Stata, etc.). When you talk about data, you rarely talk about the 0th observation. It's just a recipe for errors to have to code switch between 0 and 1-based indexing.