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.
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.
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).
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.
@@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).
you are the best. i love your videos, keep them coming please
Thanks 🙏 soo much! I’ll do!
Ah I was hoping to get the comment! So close. Thanks for the videos. Seriously a game changer for learning this !
Glad it's useful! Thanks for watching!
I'm so grateful to you, my dear professor. I'm a big fan of your channel.
😊😊😊😊😊
So nice of you! Thank you for your continuous support and for watching!
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.
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.
Thank you so much for your videos, i need your help please? how can i report factor analysis results with more plots
Thanks, I don’t know exactly, because I rarely do factor analysis. But you can check out sjPlot package. Cheers
@@yuzaR-Data-Science Thank you a lot
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).
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.
@@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).
glad I could help! thanks for watching and commenting! It's the best support!