Conditioning with {dplyr} Modify Your Data Quick

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

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

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

    you are the best. i love your videos, keep them coming please

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

    Ah I was hoping to get the comment! So close. Thanks for the videos. Seriously a game changer for learning this !

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

    I'm so grateful to you, my dear professor. I'm a big fan of your channel.
    😊😊😊😊😊

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

      So nice of you! Thank you for your continuous support and for watching!

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

    I love the way you just explain the basics of some tests and show in clear examples. Will you ever cover the propensity score matching in that way? Its very complicated in theory as well as in practise.

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

      Hey, thanks for nice feedback! Wow, fancy topic. Never needed to do that before. If I ever dive into it, it won't be soon. The list of things I wanna cover is long and those are more frequently used. Sorry, just wanna be honest, so you don't wait for no reason.

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

    Thank you so much for your videos, i need your help please? how can i report factor analysis results with more plots

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

      Thanks, I don’t know exactly, because I rarely do factor analysis. But you can check out sjPlot package. Cheers

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

      @@yuzaR-Data-Science Thank you a lot

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

    Hi. Can you please helpm me? Do you know how can we extract the "the last date" from many columns? I have a large data and every person in that data underwent multiple examination with an indication the date of the examination. However, some have passed 5, some 3, and some even 1. Accordingly, some have 5 dates indicated, and some have one (the remaining columns are empty).

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

      Hi. Seems managable.
      When I understood correct, your IDs are in columns. So, I would
      - pivot_longer them
      - group_by = ID
      - then choose the last or max date per ID
      something like
      library(dplyr)
      library(lubridate)
      df %>%
      mutate(date = ymd(date)) %>% # need only to transform to date class
      group_by(ID) %>%
      mutate(date = max(date))
      you might wanna sort your dates in the grouped data first.

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

      @@yuzaR-Data-Science Thank you. Im just a beginner, so it took a time for me to figure out how to solve the problem. You helped me a lot. SInce I had many NA's (like a said some patients had 2 dates, some 6) when pivotting the data I removed NA and so your code (max date) worked for me. Without removing NA's it didnt work:
      pivotted_data%
      pivot_longer(cols=date1:date6, names_to="Procedure", values_to="date",values_drop_na = TRUE).

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

      glad I could help! thanks for watching and commenting! It's the best support!