Odds Ratio, Relative Risk & Risk Difference with R | R Tutorial 4.11| MarinStatsLectures
TLDRIn this informative video, Mike Marin introduces a package for calculating 'relative risk', 'odds ratio', and 'attributable risk' using R software. The tutorial focuses on analyzing the relationship between gender and smoking habits using lung capacity data. Marin demonstrates how to create 2-way tables and bar plots, perform chi-square tests, and utilize the epiR package to compute statistical measures. He explains the interpretation of these measures, including the significance of the odds ratio, and how to reorganize data into a standard a, b, c, d format for clearer analysis. The video is a valuable resource for those interested in R programming and statistical analysis.
Takeaways
- π The video introduces a package for calculating 'relative risk', 'odds ratio', and 'attributable risk' or 'risk difference' using R software.
- π The focus is on analyzing the relationship between two categorical variables, specifically Gender and Smoking, using lung capacity data.
- π A 2-way table is created to visualize the relationship between Gender and Smoking, and a bar plot is suggested for better visual examination.
- π« The chi-square test of independence is mentioned, but it's noted that it doesn't indicate the strength or direction of the association.
- π The 'epiR' package in R is recommended for calculating the summaries of 'relative risk', 'odds ratio', and 'attributable risk'.
- π The '2by2' command from the 'epiR' package is used to calculate the statistical measures, with options to specify the study type and confidence level.
- π’ The script explains how to interpret the 'odds ratio', providing an example of how to switch reference groups for different interpretations.
- π The standard a, b, c, d table format is introduced for organizing data in a way that aligns with common statistical interpretations.
- π Two methods are demonstrated for reorganizing the data into the a, b, c, d format: using the 'matrix' command and the 'cbind' command.
- π The 'colnames' command is shown to add column names to the reorganized table for clarity.
- π The video concludes with recalculating the statistical summaries using the reorganized table and interpreting the results, including the significance of the confidence interval.
Q & A
What statistical measures are discussed in the video to analyze the association between two categorical variables?
-The video discusses 'relative risk', 'odds ratio', and 'attributable risk' or 'risk difference' as measures of the direction and strength of the association between two categorical variables.
What R package is used in the video to calculate the statistical measures?
-The 'epiR' package is used in the video to calculate the statistical measures such as 'relative risk', 'odds ratio', and 'attributable risk'.
How is the lung capacity data imported and attached in R for analysis?
-The lung capacity data is imported into R and attached using the 'table' command, which is then saved in an object named 'TAB'.
What is the purpose of setting the 'beside' argument to TRUE in the bar plot?
-Setting the 'beside' argument to TRUE in the bar plot places the bar plots side by side, allowing for a visual comparison of the two categorical variables.
What does the bar plot suggest about the relationship between gender and smoking based on the video?
-The bar plot suggests that there may be a relationship between gender and smoking, as the non-smoking group has more males than females, while the smoking group has more females than males.
Why is the chi-square test of independence not sufficient to indicate the strength or direction of an association?
-The chi-square test of independence is not sufficient because it only tests for the presence of an association but does not provide information about the strength or direction of that association.
What is the default confidence level used in the 'epi.2by2' command?
-The default confidence level used in the 'epi.2by2' command is 95 percent.
How is the 'relative risk' interpreted in the context of the video?
-In the video, the 'relative risk', also referred to as the 'incidence risk ratio', is interpreted as the risk of the outcome occurring in the exposed group compared to the unexposed group.
What does an odds ratio of 0.71 signify in the context of the video?
-An odds ratio of 0.71 signifies that the odds of a female not smoking are 0.71 times the odds of a male not smoking, indicating a lower likelihood of smoking among females compared to males.
What is the significance of the confidence interval containing the value 1 in the context of the odds ratio?
-If the confidence interval of the odds ratio contains the value 1, it indicates that the odds ratio is not statistically significant, suggesting that there is no significant difference in the odds of the outcome between the groups being compared.
How can the standard a, b, c, d format of a 2x2 table be achieved in R?
-The standard a, b, c, d format of a 2x2 table can be achieved in R by creating a matrix with the appropriate values and using the 'matrix' command, or by using square brackets and the 'cbind' command to bind values column-wise.
Outlines
π Analyzing Risk Measures with R: Introduction and Data Setup
In this introductory section, Mike Marin presents a video focused on calculating key statistical measures such as 'relative risk', 'odds ratio', and 'attributable risk' using R software. He introduces the lung capacity dataset and demonstrates the initial steps of data analysis, including importing the data into R, creating a 2-way table with the 'table' command, and visualizing the relationship between gender and smoking through a bar plot. The video sets the stage for exploring the association between categorical variables and introduces the concept of statistical measures that quantify the strength and direction of such associations.
π Understanding and Calculating Statistical Summaries with epiR Package
This paragraph delves into the specifics of calculating statistical summaries using the epiR package in R. Mike explains the use of the '2by2' command to generate summaries for a 2x2 table, including setting the 'method' argument for different study types and adjusting the 'conf.level' for the desired confidence interval. He provides an example of interpreting the odds ratio and demonstrates how to reorganize the table into a standard a, b, c, d format for consistency with traditional statistical interpretations. The summary also includes a step-by-step guide on creating matrices and binding columns to form the required table structure. The video concludes with an example calculation and interpretation of the odds ratio for smoking habits among males and females, highlighting the significance of the confidence interval in determining statistical relevance.
Mindmap
Keywords
π‘Relative Risk
π‘Odds Ratio
π‘Attributable Risk
π‘Risk Difference
π‘Categorical Variables
π‘Chi-Square Test
π‘epiR Package
π‘2by2 Table
π‘Bar Plot
π‘Confidence Interval
π‘Standard a, b, c, d Notation
Highlights
Introduction to a package for calculating 'relative risk', 'odds ratio', and 'attributable risk' or 'risk difference' using R statistical software.
Explanation of 'relative risk', 'odds ratio', and 'attributable risk' as measures of the association between two categorical variables.
Use of lung capacity data to explore the relationship between Gender and Smoking.
Creation and saving of a 2-way table using the 'table' command in R.
Visualization of the relationship between Gender and Smoking with a bar plot.
Observation of potential association between non-smoking and gender based on bar plot analysis.
Discussion on the limitations of the chi-square test of independence in indicating the strength or direction of association.
Introduction of the epiR package for calculating 'relative risk', 'odds ratio', and 'attributable risk'.
Guidance on installing and loading the epiR package in R.
Accessing help documentation for the epiR package.
Use of the '2by2' command to produce summaries of association measures.
Setting the 'method' argument for different study types in the 'epi.2by2' command.
Calculation and interpretation of 'relative risk', 'odds ratio', and 'attributable risk' from the 2by2 table.
Interpretation of odds ratio and its implications for the association between gender and smoking.
Standard a, b, c, d table notation for statistical formulas and interpretations.
Reorganization of the table into the standard a, b, c, d format using matrix and cbind commands.
Adding column names to the reorganized table for clarity.
Re-calculation of association measures using the reorganized table in the epi.2by2 command.
Interpretation of the recalculated odds ratio and its significance.
Upcoming discussion on correlation and linear regression in the next video.
Closing remarks and call to action to subscribe to MarinStatsLectures for more content.
Transcripts
Browse More Related Video
Chi-Square Test, Fisherβs Exact Test, & Cross Tabulations in R | R Tutorial 4.10| MarinStatsLectures
Relative Risk vs Odds Ratio! EXTENSIVE VIDEO!
How to Install Packages in R | R Tutorial 1.13 | MarinStatsLectures
Calculating Mean, Standard Deviation, Frequencies and More in R | R Tutorial 2.8| MarinStatsLectures
Odds Ratio, Relative Risk, Risk Difference | Statistics Tutorial #30| MarinStatsLectures
Scatterplots in R | R Tutorial 2.7 | MarinStatsLectures
5.0 / 5 (0 votes)
Thanks for rating: