Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

summary() rounding

Can someone explain why R does this? Rounding max and mins on integer values seems extremely flawed.

summary(1:1283932)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      1  321000  642000  642000  962900 1284000 
max(1:1283932)
[1] 1283932
like image 341
nerdlyfe Avatar asked Jun 11 '15 14:06

nerdlyfe


People also ask

What is the rounding rule in statistics?

Level 1: For tables with percentages, the general rule is to round to one decimal. For tables with absolute numbers, identify the smallest number, decide how many digits to keep for this number, and then round all other entries to those digits.

How do you round numbers in statistics?

With traditional rounding, if the number has a value less than the half-way mark between the possible outcomes, it is rounded down; if the number has a value exactly half-way or greater than half-way between the possible outcomes, it is rounded up.


1 Answers

Default display precision is 4 digits. Use digits explicitly, e.g.:

> summary(1:1283932,digits=7)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      1  320984  641966  641966  962949 1283932 
like image 124
Alexey Ferapontov Avatar answered Sep 28 '22 15:09

Alexey Ferapontov