Percentiles and Quantiles in R

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • Computing percentiles and quantiles by hand is for suckers!
    If this vid helps you, please help me a tiny bit by mashing that 'like' button. For more #rstats joy, crush that 'subscribe' button!

Комментарии • 25

  • @EquitableEquations
    @EquitableEquations  4 месяца назад

    You can find materials supporting this vid (and others) at github.com/equitable-equations/youtube.

  • @prutsemie99
    @prutsemie99 2 года назад +2

    I had no idea about the ecdf function, thank you!!

  • @henriqueleijoto3100
    @henriqueleijoto3100 3 года назад +2

    Thank you very much! You are a great teacher!!!

  • @CEDESSMX
    @CEDESSMX 2 года назад +1

    Very very useful. Thanks

  • @gabrielmouta2796
    @gabrielmouta2796 3 года назад +4

    Great video, easy way of explaining. Let's say that I want 1 to 99 percentiles, a table of percentiles, or norms. How could I do it?

    • @EquitableEquations
      @EquitableEquations  3 года назад +2

      You can use seq(.01, .99, .01) to generate a vector of numbers from .01 to .99, then use this in the quantile() command.
      Hope this helps!

    • @gabrielmouta2796
      @gabrielmouta2796 3 года назад +1

      @@EquitableEquations you're a genius! Thank you very much

  • @brazilfootball
    @brazilfootball Год назад +1

    Great examples! Hope you consider doing a video on quantile regression some day! 😁

  • @romanvasiura6705
    @romanvasiura6705 Год назад

    Thank you!

  • @wildfemaleSMARTFON
    @wildfemaleSMARTFON 10 месяцев назад

    in type=7 isn't it only less than, not equal to?

  • @valeriomercatali6519
    @valeriomercatali6519 3 года назад +1

    hi! great video! but let's say i have a distribution and wanna plot both the distribution and the 0.75 quantile

    • @EquitableEquations
      @EquitableEquations  3 года назад

      There are lots of great ways to do this using ggplot(). For instance, in a bar plot you might use geom_errorbar().

  • @vincenzo4259
    @vincenzo4259 2 года назад +1

    Thanks

  • @violetamoya1054
    @violetamoya1054 3 года назад +1

    Hi! amazing video, how can i do that but for 2 variable of interest, for example i have an excel with sex, region, height, imc, etc what should i do if i wanna know the percentile 30% of the height of the people of certain region? thank you!

    • @EquitableEquations
      @EquitableEquations  3 года назад +1

      Hi! You can look at just one region with the filter() command:
      ruclips.net/video/HnpXsXpoJBU/видео.html
      To get quantiles for all regions at once, you can use group_by() command. I'll be producing a vid on this later in 2021.

    • @violetamoya1054
      @violetamoya1054 3 года назад +1

      @@EquitableEquations thank you!

  • @Im-Assmaa
    @Im-Assmaa 2 года назад

    Thank you so much, I have a question , how can I calculate the quantiles for a specific p, using Rankit-Cleveland method. Pleaase helpp

    • @EquitableEquations
      @EquitableEquations  2 года назад +1

      Hi! You can do a rankit transform with the qnorm() function (ruclips.net/video/q8baE17TAiU/видео.html), and you learn how can pick an alternate quantile method with ?quantile.

    • @Im-Assmaa
      @Im-Assmaa 2 года назад

      @@EquitableEquations Thank you sir for your reply.
      I am not sure this is what I am looking for, I am a finance student, and I am trying to calculate the CoVaR( Conditional value at risk) and VaR(Value at risk) using quantile regression, in order to analyze systemic risk for the banking system. So I already computed the coefficients alpha and beta for the CoVaR equation, using quantile regression in Eviews.
      Now i have to estimate the VaR for every bank when p=0.05 , So according to this approach, the VaR is equal to the total of quantiles computed for p=0.05 , using Rankit-cleveland definition.
      I should get a result that look like this :
      Descriptive Statistics for RATJ
      Categorized by values of RATJ
      Date: 11/13/17 Time: 00:57
      Sample: 1/05/2010 11/03/2017
      Included observations: 1956
      RATJ Quant.* Obs.
      [-0.1, -0.05) NA 4
      [-0.05, 0) -0.023874 816
      [0, 0.05) 0.000000 1132
      [0.05, 0.1) NA 4
      All -0.017742 1956
      *Quantiles computed for p=0.05, using the Rankit-cleveland definition.
      RATJ is the time serie for daily stock returns of the bank ATJ.
      Thank you so much for your time sir.

  • @esmaulgen4699
    @esmaulgen4699 3 года назад

    Hello, how can we calculate decimals in R program?

    • @EquitableEquations
      @EquitableEquations  3 года назад +1

      Hi! Do you mean deciles? These are just the 10th, 20th, 30th, etc. quantiles. The command quantile(x, seq(.1, .9, .1)) will give you all 9 of them at once.

    • @esmaulgen4699
      @esmaulgen4699 3 года назад

      @@EquitableEquations I understand now, thank you very much.:)