| quantile.fdt | R Documentation | 
S3 methods for the quantile of a fdt. 
 
Useful to estimate the quantile (when the real data vector is not known) from a previous fdt.
## S3 methods: numerical
## S3 method for class 'fdt'
quantile(x,
         ...,
         i=1,
         probs=seq(0, 1, 0.25))
## S3 method for class 'fdt.multiple'
quantile(x, ...) 
| x | a  | 
| i | a vector of length up to the length of probs | 
| probs | vector of probabilities defining the quantiles | 
| ... | potencial further arguments (required by generic). | 
quantile.fdt calculates the quantiles based on a known formula for 
class intervals. quantile.fdt.multiple calls quantile.fdt
for each variable, that is, each column of the data.frame.
quantile.fdt returns a numeric vector containing the value(s) of the 
quantile(s) from fdt.
quantile.fdt.multiple returns a list, where each element is a numeric vector 
containing the quantile(s) of the fdt for each variable.
Faria, J. C. 
Allaman, I. B 
Jelihovschi, E. G.
median.fdt, var.fdt.
mdf <- data.frame(x=rnorm(1e2, 
                          20, 
                          2),
                  y=rnorm(1e2, 
                          30,
                          3),
                  z=rnorm(1e2,
                          40,
                          4))
head(mdf)
# From a data.frame
apply(mdf,
      2,
      quantile)[-c(1,4), ]
# From a fdt object
quantile(fdt(mdf))               # Notice that the i default is 1 (the first quartile)
## A small (but didactic) joke  
quantile(fdt(mdf),
         i=2,
         probs=seq(0, 
                   1, 
                   0.25))        # The quartile 2
quantile(fdt(mdf),
         i=5,
         probs=seq(0, 
                   1, 
                   0.10))        # The decile 5 
quantile(fdt(mdf),
         i=50,
         probs=seq(0, 
                   1, 
                   0.01))        # The percentile 50
quantile(fdt(mdf),
         i=500,
         probs=seq(0, 
                   1, 
                   0.001))       # The permile 500
median(fdt(mdf))                 # The median (all the results are the same) ;)
# More than one quantile
ql <- numeric()
for(i in 1:3)
  ql[i] <- quantile(fdt(mdf$x),
                    i=i,
                    probs=seq(0,
                              1,
                              0.25))  # The tree quartiles
names(ql) <- paste0(c(25,
                      50,
                      75),
                    '%')
round(ql,
      2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.