👋🏼In this #R video, we learn to calculate relative risk, odds ratio and risk difference (attributable risk) using the epiR package in R (with example). These are numeric summaries for analyzing 2x2 tables. To learn the concept of relative risk, odds ratio and risk difference watch this video ( ruclips.net/video/JmuciUfCJ_w/видео.html ); Like to support us? You can Donate (bit.ly/2CWxnP2), Share our Videos, Leave us a Comment and Give us a Like 👍🏼! Either way We Thank You! 🦄
Prof, I tell people that u, Phil Chan and edd boone got me hooked to r.....or just a wonderful tutor. Kindly do us an r tutorial on Winbugs and kalman filters...just very basic introductory concepts in r...Bayesian stats in r have been such a challenge. Let me wish you Gods blessings n long life as you carry on the good job.
Thank you for this clear instructions for easily and quickly calculate RR or OR of a the numbers in a 2x2 table. Very enjoy learning from your videos. Thank you so much for explaining the details.
x2 jajajaja también aprendí bastante sobre R en esta cuarentena, hice algunos videos en español sobre temas relacionados, si quieres les das un vistazo u.u
Thank you for the demonstration. Just a suggestion: it would be helpful to demonstrate with a dataset since that is what most people will be using to compute their analyses.
after seeing 1000 videos have got the perfect video for OR.Many thanks to you. and I have one more qtn. May can you please give me an idea to calculate two diff times in R from the big data set?
One question, at 6:35, you mentioned that the confident interval covering 1 indicating that the odd ratio is not significant. could you elaborate more on this? many thanks
Hello Marin, thanks for your really helpful videos. Please how can we adjust for parameters like age or sex in the the epi.2by2 while calculating odd ratios?
what if the variables are not 2x2.... and I have 3 variable (3 way contingency table). can u show any such example... I saw in one of the research papers they have performed mantel Haenszel test... can u please demonstrate any such example
Hi Prof Marin, thank u alot for this intresting video..I just have a probleme with analysis of my results, its about association of genotype and disease, so I've 3 rows instead of 2, so it's a 2x3 table (a/a, A/a, A/A) ?? Thanks alot for ur attention. Best Regards,
Hi! Do you have any videos on producing adjusted RRs? I.e. feeding multiple variables in to a model to produce crude, age-adjusted and "fully"-adjusted RRs depending on number of variables available?
Yes, you can do that with Poisson regression. I have videos for that, just putting on the finishing touches, and will be releasing over the next few weeks. They’re lectures for week 9 of this series: ruclips.net/p/PLqzoL9-eJTNBDAG955KrzpduiPCj8-_3m
Great work Marin. I was wondering if you could give us a lecture in how to test difference in Sharpe ratio, or at least guide me through it? I tried to use paired t test, but then a recalled Sharpe ratio has an asymptotic distribution. The paired t test is a wrong approach, right?
Hi klfjakldf , that's not a topic I'm very familiar with, but id suggest to check out the "SharpeR" package in R. if you visit the R-project website, you can find documentation for the SharpeR package there, and see if it's what you're looking for.
Hello! Thank u for your video. I have a question. You use the function cbind to change the order of columns, but If also i need to change the order of the rows too. How I do it?
Hi , strangely I get these errors. Any idea how to fix them please? > boxplot(LungCap ~ Smoke) Error in eval(predvars, data, env) : object 'Smoke' not found > TAB
Hi Professor Martin. I have a question for you. I have to use this package but how can I Say that the test is significative? Where can I found the pvalue? Thanks a lot
Hello sir, thank you so much for this video. This video is very was very helpful for me. Can you post the video how can we do Hardy-Weinberg equilibrium, haplotype, linkage disequilibrium analyses and linkage disequilibrium plot in R .
hello Dear Marin, thank you for the wonderful tutorial. Just a small question when i do the correlation between two numeric variables, the results shows " NA ". What does that means?
Hi H.E Aljofi , that sounds like it's most likely due to having some missing values in there...do you have some NA's in the data? if so, you can use *cor(x,y, use="complete.obs")* to calculate the correlation between X and Y, using only the complete cases is doing so.
Hello Marin, Is there a way to avoid rounding in epi.2by2() function? A problem I've encountered is that there are zero cell entries in the original 2x2 table that cause some inf value in the result. So I added 0.5 to every cell. The result turned out to be the same (containing inf) with a warning message saying that: In fisher.test(dat, conf.int = TRUE, conf.level = conf.level) : 'x' has been rounded to integer: ........ Thanks.
Sawadee Jar im not sure how to change the rounding in the epi2by2 function...to be honest, i don't think that "epiR" is a very good package. but i can say a few things about why you're getting that error message. first off, if you have a 0 cell count, its really not a good idea to be doing any of these tests in general. with Fisher's Test, it can only work with integer values. the p-value is calculated by taking all permutations of possible tables, and using as the numerator the number of tables that are more extreme in their dependance than the observed table. so, it can only work with integer values....and it ends up rounding the 0.5 down to 0. to correct for this, you can fill in a value of 1 where there are cell counts of 0. as i mentioned, doing this is NOT A GOOD IDEA in terms of statistics, but it will correct for the error message you are getting.
MarinStatsLectures Dear Marin, Thank you for the reply. In that case, would you point me to any tests or packages that are suitable for zero cell entry?
Sawadee Jar i would suggest collecting more data, as there is not a "statistical fix" for having not observed something. if you haven't, say, observed any occurrences of some event under a certain condition, then that is what it is. you would either need to collect more data to observe an occurrence, or possibly look at redefining the "occurrence" so that you have at least one observed event in each cell. i don't know the context of your data, but you may be able to work with a different definition of "occurrence".
Hi Mike, First, thank you for this great R tutorial! Second, I had a question regarding this video in particular and the calculation of odds ratio. I did everything exactly (at least I think so) as you described in the video, but my result for odds ratio’s confidence interval, although similar, was not exactly the same (command epi.2by2(TAB3, method = "cohort.count", conf.level=0.95) or epi.2by2(TAB3, method = "cohort.count”)): Odds ratio (W) 1.42 (0.88, 2.28) (Your result can be seen here: ruclips.net/video/V_YNPQoAyCc/видео.html#t=394) Does this detail have any importance for the calculation of odds ratio with the epiR package? Could my epiR package, that I downloaded using the commands you described in earlier videos, be using some different parameters, corrections, etc.? Thanks!
Hi +Anastasia Levchenko , I'm not sure on the exact reason why they differ slightly, but my guess is that the approximation the package uses to estimate the SE and the confidence interval has probably been changed slightly. i made this video about 2.5 years ago, and so they must have made some minor updates to how they are approximating the confidence interval. but the difference is minor, and in no way any error on your part.
👋🏼In this #R video, we learn to calculate relative risk, odds ratio and risk difference (attributable risk) using the epiR package in R (with example). These are numeric summaries for analyzing 2x2 tables. To learn the concept of relative risk, odds ratio and risk difference watch this video ( ruclips.net/video/JmuciUfCJ_w/видео.html ); Like to support us? You can Donate (bit.ly/2CWxnP2), Share our Videos, Leave us a Comment and Give us a Like 👍🏼! Either way We Thank You! 🦄
The videos are great I have been watching them non-stop for a week! Thanks so much for taking the time.
THANK YOU FOR THIS VIDEO YOU JUST SAVED MY GRADE AND MY LIFE
Thank you so much for these videos. You are a lifesaver.
Prof,
I tell people that u, Phil Chan and edd boone got me hooked to r.....or just a wonderful tutor.
Kindly do us an r tutorial on Winbugs and kalman filters...just very basic introductory concepts in r...Bayesian stats in r have been such a challenge.
Let me wish you Gods blessings n long life as you carry on the good job.
Thank you for this clear instructions for easily and quickly calculate RR or OR of a the numbers in a 2x2 table. Very enjoy learning from your videos. Thank you so much for explaining the details.
You have no idea how much this video has helped me!!!! Nevertheless, I use this to reorder : Cigarrillo
x2 jajajaja también aprendí bastante sobre R en esta cuarentena, hice algunos videos en español sobre temas relacionados, si quieres les das un vistazo u.u
Very instructive; many functions of R are involved: data manipulation, plot e stats.
Thank you for the demonstration. Just a suggestion: it would be helpful to demonstrate with a dataset since that is what most people will be using to compute their analyses.
4:32 you can just reorder the levels of the factor in your data frame.
df$gender
Thanks! The beauty of programming is that there are so many different ways to accomplish something
Eu queria agradecer pela gentileza de compartilhar seus conhecimentos. Muito obrigada! Muito proveitoso!
Aluna do Brasil.
Creo que salvaste mis deberesss!
Muchas gracias por el tutorial e interpretación, me ayudo mucho || Thank you very much for the tutorial and interpretation, it helped me a lot
after seeing 1000 videos have got the perfect video for OR.Many thanks to you. and I have one more qtn. May can you please give me an idea to calculate two diff times in R from the big data set?
I’m sorry, I don’t understand your question.
@@marinstatlectures calculating time difference in R.
One question, at 6:35, you mentioned that the confident interval covering 1 indicating that the odd ratio is not significant. could you elaborate more on this? many thanks
Hello Marin, thanks for your really helpful videos. Please how can we adjust for parameters like age or sex in the the epi.2by2 while calculating odd ratios?
Hi, we can't adjust easily in a simple 2x2 table setting. BUT, you can find a logistic regression model, and adjust for other variables.
*model
what if the variables are not 2x2.... and I have 3 variable (3 way contingency table). can u show any such example... I saw in one of the research papers they have performed mantel Haenszel test... can u please demonstrate any such example
Hi Prof Marin, thank u alot for this intresting video..I just have a probleme with analysis of my results, its about association of genotype and disease, so I've 3 rows instead of 2, so it's a 2x3 table (a/a, A/a, A/A) ?? Thanks alot for ur attention.
Best Regards,
Hi! Do you have any videos on producing adjusted RRs? I.e. feeding multiple variables in to a model to produce crude, age-adjusted and "fully"-adjusted RRs depending on number of variables available?
Yes, you can do that with Poisson regression. I have videos for that, just putting on the finishing touches, and will be releasing over the next few weeks. They’re lectures for week 9 of this series: ruclips.net/p/PLqzoL9-eJTNBDAG955KrzpduiPCj8-_3m
Great work Marin. I was wondering if you could give us a lecture in how to test difference in Sharpe ratio, or at least guide me through it? I tried to use paired t test, but then a recalled Sharpe ratio has an asymptotic distribution. The paired t test is a wrong approach, right?
Hi klfjakldf , that's not a topic I'm very familiar with, but id suggest to check out the "SharpeR" package in R. if you visit the R-project website, you can find documentation for the SharpeR package there, and see if it's what you're looking for.
Hello! Thank u for your video. I have a question. You use the function cbind to change the order of columns, but If also i need to change the order of the rows too. How I do it?
You can use rbind() to bind data together in row-wise fashion
Hi , strangely I get these errors. Any idea how to fix them please?
> boxplot(LungCap ~ Smoke)
Error in eval(predvars, data, env) : object 'Smoke' not found
> TAB
Hi Professor Martin. I have a question for you. I have to use this package but how can I Say that the test is significative? Where can I found the pvalue?
Thanks a lot
Hello sir, thank you so much for this video. This video is very was very helpful for me. Can you post the video how can we do Hardy-Weinberg equilibrium, haplotype, linkage disequilibrium analyses and linkage disequilibrium plot in R .
how can I get the data of this video to practie in R, please
Thanks
hello Dear Marin, thank you for the wonderful tutorial. Just a small question when i do the correlation between two numeric variables, the results shows " NA ". What does that means?
Hi H.E Aljofi , that sounds like it's most likely due to having some missing values in there...do you have some NA's in the data? if so, you can use *cor(x,y, use="complete.obs")* to calculate the correlation between X and Y, using only the complete cases is doing so.
MarinStatsLectures it worked well after i used the function use="complete,obs".
it seems my data have missing values. Thank you Marin.
How can i get p-value for the OR or RR ?
How can I calculate odd ratio or relative ratio in subset data group?
Hello Marin,
Is there a way to avoid rounding in epi.2by2() function?
A problem I've encountered is that there are zero cell entries in the original 2x2 table that cause some inf value in the result. So I added 0.5 to every cell. The result turned out to be the same (containing inf) with a warning message saying that:
In fisher.test(dat, conf.int = TRUE, conf.level = conf.level) :
'x' has been rounded to integer: ........
Thanks.
Sawadee Jar im not sure how to change the rounding in the epi2by2 function...to be honest, i don't think that "epiR" is a very good package.
but i can say a few things about why you're getting that error message. first off, if you have a 0 cell count, its really not a good idea to be doing any of these tests in general.
with Fisher's Test, it can only work with integer values. the p-value is calculated by taking all permutations of possible tables, and using as the numerator the number of tables that are more extreme in their dependance than the observed table. so, it can only work with integer values....and it ends up rounding the 0.5 down to 0. to correct for this, you can fill in a value of 1 where there are cell counts of 0. as i mentioned, doing this is NOT A GOOD IDEA in terms of statistics, but it will correct for the error message you are getting.
MarinStatsLectures
Dear Marin,
Thank you for the reply.
In that case, would you point me to any tests or packages that are suitable for zero cell entry?
Sawadee Jar i would suggest collecting more data, as there is not a "statistical fix" for having not observed something. if you haven't, say, observed any occurrences of some event under a certain condition, then that is what it is. you would either need to collect more data to observe an occurrence, or possibly look at redefining the "occurrence" so that you have at least one observed event in each cell. i don't know the context of your data, but you may be able to work with a different definition of "occurrence".
I FUCKING LOVE YOU MAN!!!!!!
Hi Mike,
First, thank you for this great R tutorial!
Second, I had a question regarding this video in particular and the calculation of odds ratio. I did everything exactly (at least I think so) as you described in the video, but my result for odds ratio’s confidence interval, although similar, was not exactly the same (command epi.2by2(TAB3, method = "cohort.count", conf.level=0.95) or epi.2by2(TAB3, method = "cohort.count”)):
Odds ratio (W) 1.42 (0.88, 2.28)
(Your result can be seen here: ruclips.net/video/V_YNPQoAyCc/видео.html#t=394)
Does this detail have any importance for the calculation of odds ratio with the epiR package? Could my epiR package, that I downloaded using the commands you described in earlier videos, be using some different parameters, corrections, etc.?
Thanks!
Hi +Anastasia Levchenko , I'm not sure on the exact reason why they differ slightly, but my guess is that the approximation the package uses to estimate the SE and the confidence interval has probably been changed slightly. i made this video about 2.5 years ago, and so they must have made some minor updates to how they are approximating the confidence interval. but the difference is minor, and in no way any error on your part.