Quantile Regression as The Most Useful Alternative for Ordinary Linear Regression

Поделиться
HTML-код
  • Опубликовано: 13 дек 2022
  • Quantile Regression is The Most Useful Alternative for Ordinary Linear Regression, because it:
    - is robust to outliers and influential points
    - does not assume a constant variance (known as homoskedasticity) for the response variable or the residuals
    - does not assume normality
    - but the main advantage of QR over linear regression (LR) is that QR explores different values of the response variable, instead of only the average, and delivers therefore a more complete picture of the relationships between variables.
    If you only want the code (or want to support me), consider join the channel (join button below any of the videos), because I provide the code upon members requests.
    Enjoy! 🥳

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

  • @transportation-talk
    @transportation-talk Год назад +5

    Lots of ideas packed in a short video! Thank you for creating useful content and providing R code.

  • @marinal2705
    @marinal2705 Год назад +6

    This is such a great channel, I just started watching; I love that you run through the code quickly and present everything so well. Will keep tuning in to learn more!! Very interesting model, will try to implement in my practice.

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

    Amazing just what i was looking for thank you for this video!

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

    I am absolutely going to try this out the next time I need to do some regression. Thanks a lot for all these amazing videos. I feel like I learn more and more about statistics every time I watch.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      Glad, my content is useful! Thank for a nice feedback! And thanks for watching!

  • @alijanbain2852
    @alijanbain2852 Год назад +3

    Before watching the video, I just want to say thanks a lot for your amazing work and fabulous videos.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      Thanks, Ali! That means a lot to me! Hope you'll like the video also after watching it ;) Feel free to give any feedback. And thanks for watching!

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

    This is such a great video, thank you!!!

  • @ssardo
    @ssardo 11 месяцев назад

    Thank you for a great video packed with interesting ideas and a realistic example and code!

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  11 месяцев назад

      You are welcome 🙏 hope the rest of the channel is useful too!

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

    Very good video - really liked how you motivated the topic and came back to the motivation in the end. Thank you! Really good.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      Glad you liked it! Thanks for the feedback and for watching!

  • @zane.walker
    @zane.walker Год назад +1

    Well that noble prize is one step closer! Seriously, very impressive - I wonder why I haven't come across quantile regression in the past? Definitely something I will consider in the future.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      Thanks, Zane! Yeah, totally, I used robust, bootstrapping, log-transform and other "tricks" to survive in a statistical way ... and I was looking for a median regression for a long time, and somehow did not come across QR. Now I'll use it almost always instead of OLS, because OLS often does not satisfy assumptions. Thanks for watching. Cheers

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

    What a great video!!

  • @user-mi1gq2no6n
    @user-mi1gq2no6n Год назад

    Love these videos 🎉

  • @bartoszkedziora3256
    @bartoszkedziora3256 Месяц назад

    Absolutely amazing

  • @jalepezo
    @jalepezo 4 месяца назад +1

    Amazing explanation bro ! Best regards from Peru!

  • @Human2023v1
    @Human2023v1 6 месяцев назад

    Very Nice video. Keep it up.

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

    great insights...

  • @musicalive1782
    @musicalive1782 3 месяца назад

    Thank you

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

    Excellent.

  • @LeSaboteur3981
    @LeSaboteur3981 5 месяцев назад

    such a great, easy to understand explanation! way to few views fort that video. thanks a lot!

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

    Genial! Parabens pelo material!!!!
    Poderia pensar na possibilidade de montar um material sobre diff-in-diff?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад +1

      Obrigado pelo bom feedback e sua ótima ideia! Não posso prometer que vai aparecer logo, mas vou colocar na lista.

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

    Dude. I

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

    Hi, thank you for your videos!!! They are great! I actually would like to ask more of general statistics question. I was wondering if pratical significance can likely give good predictions. It's counterintuitive how statistical significance and predictions are often not realated. Based on the MSE decomposition, a decent trade off between bias and variance of the estimates should reduce the error. So, if they are both unbiased, predictions should be at least decent. Am I wrong on this?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад +1

      Hey man, thanks! I did not look into this good enough, but generally practical and statistical significance are two different concepts. Practical significance refers to the real-world importance or relevance of an observed relationship between variables, while statistical significance is a measure of the likelihood that an observed relationship is real, rather than being due to chance. Statistical significance does not necessarily imply that the observed relationship will be a good predictor of future outcomes, while having practical significance does not guarantee statistical significance. I think there is a trade-off between bias and variance in prediction error, and striking a balance between the two can improve the accuracy of predictions. However, other sources of error, such as measurement error or omitted variables, can also impact the accuracy of predictions. I as I said before, I am not the expert on that. Thanks for watching!

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

    Great video! Please do the same on unconditional quantile regression

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      Thanks! There was only one package on CRAN or uqr, but it was removed. Besides, I have read about some limitations of uqr and never read any paper using it, not in my field. I even don't see many papers using a classic quantile regression, while more should. So, though, your idea is good, but instead of saying - cool, I'll put it on my to-do list - I wanna be honest and say I don't think I will produce a video on uqr any time soon. Kind regards, Yury

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

      @@yuzaR-Data-Science totally understand.. looking forward to more videos 👍👍

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      @@sreelakshmis2095 being produced ;)

  • @andycharles5127
    @andycharles5127 7 месяцев назад

    Question: What is the minimum sample size for conducting quantile regression? I suspect this might be even more important when analyzing lower and higher quantiles where it is more likely to have fewer data points. Thx.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  7 месяцев назад +1

      I am not sure, whether the is such thing as a limited sample size for QR. The model might collaps, not converge or produce huge confidence intervals. If you don't need p.values, then go with bayesian QR (brm function from brms package, it's in my article, link in the video denscription), then you are better off with small sample sizes. Cheers

  • @SabinaMonti
    @SabinaMonti 3 месяца назад

    Very easy to follow, thak you. If you could share the R code will be great! (please note that the provided link to the code is not currently functioning)

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      Thank you Sabina for you posistive feedback! Unfortunately my blog was blocked due to increased traffic. They want me to pay for it. I refuse since I do it for free. I’ll try to reopen it ASAP with free alternative, but in the meanwhile please just rewatch the videos, because my blog is the script for them, so you won’t miss anything. However, if you wanna get the R code now, consider to join my channel to become a member, because I already published the code for members in the community posts. Cheers

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

    thank you for the video, i have a question, if our variables include unit root, namely if they are I(1), should we use first differences in the model ?In some studies I saw that they used variable's first differences rather than variables itself since variables are I(1).

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      Sorry for late replay mate! I was on holidays. Hmm, I never used "differences" in a model. But if I got your question correct (did I?) then it does not matter what is the predictor, a difference of something, or a power of something. The model checks the association between the predictors and outcome. Another thing is, I never use the power or roots of predictors because the interpretation suffers a lot. So, I try to stay close to the real data and sometimes may be use the log of the outcome, almost never the log of predictors. Cheers

  • @TinaTina-xn9on
    @TinaTina-xn9on Год назад

    Hello Dear Smart Sir, do you know how to perform any of the applicable methods of quantile panel regression with fixed effects (Penalized quantile fixed effect, quantile correlated random effect or Canay 2011 method) in R studio or Stata?
    My panel is short where n or id=167 and t=8, so n/t=20.875. I am thinking of analyzing 9 quantiles {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}, or what the appropriate quantiles you think.
    In R studio, I tried "rqpd" package. Until now I have issues in the three models.
    1) The code for penalized fixed effect is as follows:
    rqpd(y ~ x1 + x2 + x3 ... x13 | id ,panel (method = "pfe", taus = 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, tauw = c(*), lambda = **, ztol = ***), data = data)
    I do not know how to choose the appropriate weights in tauw. I do not know how to choose lambda or the penalty value (several choosing ways are explained in articles but no one shows how to code it in R), and I do not know how to choose ztol.
    2) The code for quantile correlated random effect is as follows:
    rqpd(y ~ x1 + x2 + x3 ... x13 | id | ??z?? ,panel(method = "cre", cre="ad", taus = 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9), data = data)
    The model forces me to include instrumental variables in ??z??. The problem is I assume that I do not have Endogeneity because I do not use treatment variable, and I do not know how to find Endogeneity so I assumed I do not need instrumental variables.
    3) The code for Canay 2011 method is unwritten in R. Although it is said that this method is the easiest one.
    If you know how to analyze my model in one of the proposed three methods or if you know a good method works with short panels to overcome the incidental parameters and asymptotic biases; except the "xtqreg" method in Stata because it gives me bad results . let us talk please.
    If you help me in analyzing it I will be glad to leave a tip .

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      Unfortunately, I don’t know how to do that. If you find out, please, don’t hesitate to post it here for the community

  • @dr.barunbiswas7132
    @dr.barunbiswas7132 3 месяца назад

    Love your videos. Great explanation. Btw, your blog post webpage is not working.😢 Please resolve.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      Thank your Dr. for you generous feedback! Unfortunately my blog was blocked due to increased traffic. They want me to pay for it. I refuse since I do it for free. I’ll try to reopen it ASAP with free alternative, but in the meanwhile please just rewatch the videos, because my blog is the script for them, so you won’t miss anything. However, if you wanna get the R code now, consider to join my channel to become a member, because I send the code to members. Cheers

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      Hi Dr.Barunbiswas, thanks for becoming a member! I posted the whole R code for the members in the community posts. Let me know whether you can access it. Kind regards!

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

    Uma outra sugestão, se é que me permite seria: ANOVA two-Way com enfase em interações

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад +1

      ANOVA two-Way com interações é, na verdade, um modelo usual de mínimos quadrados com interação. então, eu já fiz um pouco disso no visualize models parte 1, onde você também vê alguns conteúdos bônus, como emmeans e contrastes.. dê uma olhada no vídeo, se quiser

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

    Great video! I got the code for github and I ran into an issue with this line:
    cars %
    select(mpg, cylinders, displacement, horsepower, acceleration, origin)
    "Auto" is not defined anywhere. I figured it's mtcars with the columns renamed, but I'm having issues with "orign"...

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад +1

      Thanks, Alex!
      Sure. Just load library(ISLR), since "Auto" dataset coms from ISLR package.
      Cheers

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

    Does quantile regression requires greater sample size to make those split have enough statistical power? And is quantile regression be combined with interaction of a third variable?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад +2

      Good question! Yes, definitely, the more data the better QR works! Especially on the thin ends of the distribution. With smaller data sets, my approach is to use only the median regression (tau = 0.5) and even that usually makes a better job. For a highly skewed distributions, like a lot of values near 0, you can choose to study only the lower quantiles - that's the flexibility and I really love it ... don't know how I, as a statistician, lived so long without QR :)

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

      @@yuzaR-Data-Science Yes it is quite simple and can give much more nuanced results. Just this week, I found a positive linear relationship between AGE and QUALITY OF LIFE, but realized that the linear effect was quite different across age group, and even negative for the younger group. I used a grouping variable to find this, but with QR I could be more precise on the distribution of AGE. I remember learning this in graduate school but did not understand at that time the usefulness of it. Thank you for the amazing technical dissemination.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      Cool, I am glad it is useful for more than just me :) Thanks for watching, mate!

  • @Charlotte_lpy
    @Charlotte_lpy 2 месяца назад

    QR seems similar to heterogeneity analysis of OLS, doesn't it?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  2 месяца назад +1

      well, they both try to solve problems with unsatisfied assumptions, but I did not use heterogenety till now, while I love QR, which not only solves problems, but also delivers cool and a lot of results ;)

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

    This is great! How can this be done in Python instead of R? Specifically, how can non-linear quantile regression be performed with Python?

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      I don’t know yet. I specialize on R for the next time. Python might be coming later.

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

      @@yuzaR-Data-Science Do you know how the following curves can be generated in R for a given data set? The figure is shown on wikipedia:
      en.wikipedia.org/wiki/Quantile_regression

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      sure:
      library(quantregGrowth)
      library(ISLR)
      set.seed(1)
      o % sample_n(1000), tau=seq(.25,.75,l=3))
      # par(mfrow=c(1,2)) # for several plots
      plot(o, legend=TRUE, conf.level = .95, shade=TRUE, lty = 1, lwd = 3, col = -1, res=TRUE)

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

      @@yuzaR-Data-Science Thank you! I received the following error:
      Error in Wage %>% sample_n(1000) : could not find function "%>%"

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  Год назад

      load (install first if don't have it yet) "tidyverse" package. I do not know how to do that in Python. If you figure it out, please, let me know

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

    Or… you can divide your sample into low, medium, high and construct different OLS models. Most of the benefits of quantile regression are that you dont need to think about your dataset before you start running regressions. But you need to think about your dataset at some point once you start running quantile regressions. Let’s be honest, its main use if for analysts who forgot to prep their data before running their models, as it allows them to perform after the fact adjustments which should have been done before you ran your models.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  10 месяцев назад

      :) What do you mean by "prepare the data"? and "think about the dataset"? I actually have nothing against OLS, in fact I would love to use it all the time .... but it never satisfies all the (it's own) assumptions with real world data. Stratifying data rarely solves those problems, like heteroskedasticity, outliers, dodgy distributions etc. Transforming data reduces interpretability. But I am very keep on learning new things and oven to suggestions. So, please, feel free to discuss!

  • @LightInside-id1fm
    @LightInside-id1fm 3 месяца назад

    Honestly I had awful cringy feeling starting from the 1st minute. The utter fakeness of the voice kills , even slaughters otherwise decent content. The fashionable softness or radio host voice is a trap. Be yourself, stop following the hype, have authentic voice.

    • @yuzaR-Data-Science
      @yuzaR-Data-Science  3 месяца назад

      😂😂😂 bro, what are you talking about??? 😂😂😂 that's my voice and the only one I have ... thanks for calling my content "decent"! appreciate that! cheers!