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!
You can find materials supporting this vid (and others) at github.com/equitable-equations/youtube.
I had no idea about the ecdf function, thank you!!
I'm glad it helped!
@@EquitableEquations 100% ! 😊
Thank you very much! You are a great teacher!!!
Thanks so much!
Very very useful. Thanks
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?
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!
@@EquitableEquations you're a genius! Thank you very much
Great examples! Hope you consider doing a video on quantile regression some day! 😁
Thank you!
in type=7 isn't it only less than, not equal to?
hi! great video! but let's say i have a distribution and wanna plot both the distribution and the 0.75 quantile
There are lots of great ways to do this using ggplot(). For instance, in a bar plot you might use geom_errorbar().
Thanks
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!
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.
@@EquitableEquations thank you!
Thank you so much, I have a question , how can I calculate the quantiles for a specific p, using Rankit-Cleveland method. Pleaase helpp
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.
@@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.
Hello, how can we calculate decimals in R program?
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.
@@EquitableEquations I understand now, thank you very much.:)