# Customize quantile in DataFrames Combine summary

**URL:** https://discourse.julialang.org/t/customize-quantile-in-dataframes-combine-summary/39774
**Category:** Statistics
**Tags:** question
**Created:** [May 19, 2020, 7:04pm UTC](https://discourse.julialang.org/t/customize-quantile-in-dataframes-combine-summary/39774 "2020-05-19T19:04:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Nelain](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nelain/32/14994_2.png) [@Nelain](https://discourse.julialang.org/u/Nelain)
#### Post date: [May 19, 2020, 7:04pm UTC](https://discourse.julialang.org/t/customize-quantile-in-dataframes-combine-summary/39774/1 "2020-05-19T19:04:44Z")

</div>

Hello,

I am trying to summarize a GroupedDataFrame:

```julia
df2 = CSV.read(raw"_Q\Test.csv");

gd = groupby(df2, :Age_Catg)

print(
    combine(gd, nrow 
        ,:Income => mean
        ,:Income => middle
        ,:Income => quantile
    )
)

```

The issue is that I can’t specific the quantile I want (e.g. quantile(v, 0.1))  
The code currently always print 5 quantile levels [0, 0.25, 0.5, 0.75, 1] and I can’t find the syntax to customize it

thank you,

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [May 19, 2020, 7:17pm UTC](https://discourse.julialang.org/t/customize-quantile-in-dataframes-combine-summary/39774/2 "2020-05-19T19:17:20Z")

</div>

Thanks for posting! welcome to Julia and to using data frames.

First, note that you can use `describe` to get the statistics you want by doing.

```julia
combine(describe, groupby(df, :Age_Catg))

```

what you want is an [anonymous function](https://docs.julialang.org/en/v1/manual/functions/#man-anonymous-functions-1).

```julia
print(
    combine(gd, nrow 
        ,:Income => mean
        ,:Income => middle
        ,:Income => t -> quantile(t, .1)
    )
)

```

---

<div class="post-metadata">

### Author: ![Nelain](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nelain/32/14994_2.png) [@Nelain](https://discourse.julialang.org/u/Nelain)
#### Post date: [May 19, 2020, 7:32pm UTC](https://discourse.julialang.org/t/customize-quantile-in-dataframes-combine-summary/39774/3 "2020-05-19T19:32:15Z")

</div>

Thank you, thats exactly the solution I was looking for.

😀
