
Welcome to this beginner-friendly course on R and RStudio. I am Ahshanul Haque, a PhD student at Charles Sturt University, Australia.
In this free course, you will learn how to use R packages, import data from different sources, manage and transform data, add labels, merge datasets, perform descriptive statistics, and even create automatic tables in Word.
This course is designed for anyone working with public health, medical science, social science, marketing data, or machine learning. By completing it, you will build a strong foundation that will make advanced topics like data visualization, regression, and machine learning much easier to learn in the future.
Because R software is updated frequently, you might notice small differences or errors while executing the code from this course. This is completely normal. I update the course code regularly to ensure compatibility. If you run into any problems, don’t hesitate to contact me. Your learning experience is my priority.
In this lecture, you will learn how to download and install R and RStudio step by step. We will set up everything properly so you can start your data analysis journey without any problem. No prior experience is needed.
Welcome back! With R and RStudio installed, the next crucial step is building your toolkit. This video will guide you through the process of installing and managing R packages, which are essential for every data analysis task.
In this lesson, you'll learn:
What are R packages and why they're so important for expanding R's capabilities.
How to install a package using the install.packages() function.
How to load a package for use in your session with the library() function.
Best practices for managing your R packages, ensuring a smooth and efficient workflow.
We'll focus on key packages like the Tidyverse suite, which will be our main toolkit for data manipulation and visualization throughout this course. By the end of this video, you'll be ready to equip your RStudio environment for any public health research challenge. Let's start building!
Learn how to navigate the RStudio interface, write your first R commands, and become comfortable using the Console, Script, Environment, and Plots panels.
In this section, we will start with a very simple example in R. Do not worry if you are new. Just follow step by step. We will begin by creating a simple graph and a simple table. More detailed graphs and analyses will be covered step by step in the next sections.
In this lecture, you will learn how to read Excel data into R using a simple command. This is the first step before creating graphs and tables.
In this lecture, you will create your first graph in R using a box plot. Just follow the steps and see how your data looks visually.
In this lecture, you will create a simple descriptive summary table in R. This helps you understand your data and is useful for reports and research.
Welcome to a crucial step in any data analysis project: getting your data into RStudio! In this lesson, we'll cover how to easily import data from the most common file formats used in public health and research.
By the end of this video, you will be able to:
Import CSV files using R's built-in functions and the readr package.
Import Excel files with the readxl package, handling multiple sheets and different file types.
Import Stata (.dta) and SPSS (.sav) files using the haven package, ensuring a smooth transition from other statistical software.
Understand why different packages are needed for different file types and how to handle potential data import issues.
We'll walk through practical examples for each file type, so you'll be able to bring your own public health datasets into R for analysis. Let's get your data loaded and ready to go!
Learn how to perform basic calculations and compare values using *arithmetic operators (+, –, , /, %%) and relational operators (<, >, ==, !=, etc.) in R. This lecture will help you build a strong foundation for data manipulation, filtering, and analytical tasks.
Learn how to keep selected variables in RStudio using dplyr. This video helps you understand data selection and cleaning, improving your ability to organize and focus on relevant information. Perfect for beginners and researchers working with R and RStudio.
Learn how to drop unnecessary variables in RStudio using dplyr. This video helps you understand data cleaning and organization, improving your ability to focus on relevant variables for analysis. Perfect for beginners and researchers working with R and RStudio.
Learn how to keep or drop specific values in your dataset using dplyr’s filter function in RStudio. This lesson helps you clean and refine data for accurate analysis, perfect for beginners and researchers working with R.
Learn how to define value labels in RStudio using the mutate() function. This video helps you make your dataset more readable and organized, improving clarity for analysis. Perfect for beginners and researchers working with R.
Learn how to add and manage variable labels in RStudio to make your dataset more understandable and organized. This lesson helps you improve clarity for analysis, perfect for beginners and researchers using R.
Learn how to generate a new variable in RStudio using mutate() to calculate BMI. This lesson helps you prepare and transform data for analysis, perfect for beginners and researchers using R.
Learn how to recode variables in RStudio using dplyr functions. This lesson helps you modify and standardize your dataset for cleaner analysis, perfect for beginners and researchers working with R.
Explore histograms in RStudio to see the distribution of your data. This video shows techniques to highlight patterns and trends, perfect for beginners and researchers working with R.
Discover how to visualize a single continuous variable using box plots in RStudio. This video highlights data spread, median, and outliers, perfect for beginners and researchers working with R.
Visualize a continuous variable across categories using box plots in RStudio. This video shows how to compare distributions, medians, and outliers for different groups, ideal for beginners and researchers working with R.
Visualize a continuous variable across two categorical variables using box plots in RStudio. This video demonstrates how to analyze group differences, medians, and outliers for multiple categories, perfect for beginners and researchers working with R.
In this lecture, you will learn how to create simple bar diagrams for categorical variables in R using the ggplot2 package. We will cover basic syntax, count-based bar charts, and how to label and interpret the output.
How to Add Axis Labels to a Bar Diagram in RStudio Using ggplot
n this lecture, you will learn how to create grouped bar diagrams for categorical variables in R using ggplot2. We will visualize comparisons across groups, adjust bar positions, and interpret grouped bar charts correctly.
In this lecture, we will learn how to create a bar diagram for one binary variable grouped by one categorical variable using RStudio. This type of bar diagram is very common in surveys, social science research, and data analysis.
A binary variable has only two possible values, such as Yes and No, 0 and 1, or Pass and Fail.
A categorical variable has more than one category, such as gender, education level, or region.
In this lecture, we will learn how to create a bar diagram for one binary variable grouped by two categorical variables using RStudio. This type of visualization helps us compare a binary outcome across multiple groups at the same time.
Learn how to visualize multiple binary variables using bar charts in RStudio with clear, publication-ready output.
Explore univariate analysis in RStudio to summarize all variables in your dataset. This video demonstrates key statistics like mean, median, mode, and range, helping beginners and researchers get a complete overview of their data.
Explore bivariate analysis in RStudio to summarize a continuous variable by a categorical variable. This video demonstrates group statistics, means, and distributions, helping beginners and researchers compare and interpret data effectively.
Explore how to compute percentages for categorical variables and mean and standard deviation for continuous variables in RStudio. This video helps beginners and researchers summarize data effectively for analysis and reporting.
Discover how to calculate p-values and perform Chi-square and t-tests in RStudio. This video helps beginners and researchers test hypotheses, compare groups, and draw meaningful conclusions from data.
Discover how to export tables from RStudio directly into Microsoft Word. This video demonstrates techniques to save, format, and share your data summaries, perfect for beginners and researchers preparing reports.
In this lecture, you will learn how to create scatter plots in RStudio using ggplot2 to visualize the relationship between two continuous variables. We will cover basic syntax, point customization, and interpretation of scatter plots.
In this lecture, you will learn how to calculate and interpret the correlation coefficient between two continuous variables in RStudio. We will cover Pearson and Spearman correlation, direction and strength of correlation, and how to report results.
In this lecture, you will learn how to perform simple linear regression in RStudio to model the relationship between one predictor and one outcome variable. We will fit the model, interpret regression coefficients, confidence intervals, and p-values, and relate the results to scatter plots.
In this lecture, you will learn how to fit a multiple linear regression model in RStudio using more than one independent variable. We will interpret adjusted regression coefficients, confidence intervals, and p-values, and understand how each predictor contributes to the outcome while controlling for others.
In this lecture, you will learn how to generate predicted values and calculate residuals from a linear regression model in RStudio. We will understand what residuals represent, how to extract them, and how they are used for model diagnostics and interpretation.
In this lecture, you will learn how to test the homoscedasticity assumption in linear regression. We will assess constant variance of residuals using residual plots and formal tests (e.g., Breusch–Pagan test) in RStudio and understand how to interpret the results.
In this lecture, you will learn how to assess the normality of residuals in linear regression models. We will use graphical methods (histogram, Q–Q plot) and formal tests (e.g., Shapiro–Wilk test) in RStudio and learn how to interpret the results correctly.
In this lecture, you will learn how to detect multicollinearity in multiple linear regression using the Variance Inflation Factor (VIF) in RStudio. We will calculate VIF values, understand common cut-off points, and interpret their impact on regression coefficients.
In this lecture, you will learn how to present unadjusted (crude) regression coefficients from linear regression models in a publication-ready table using RStudio. We will format coefficients, confidence intervals, and p-values using gtsummary, suitable for theses and journal manuscripts.
In this lecture, you will learn how to present adjusted regression coefficients from multiple linear regression models in a publication-ready format. We will use gtsummary to report coefficients, 95% confidence intervals, and p-values suitable for journal articles, theses, and reports.
In this final lecture, you will learn how to create a single, publication-ready table presenting both unadjusted (crude) and adjusted regression coefficients from linear regression models. We will use gtsummary to format coefficients, 95% confidence intervals, and p-values suitable for journal manuscripts, theses, and reports.
Are you ready to analyze health research data with confidence using R and RStudio?
This comprehensive course is designed to take you from data management to advanced epidemiologic analysis, using real-world health datasets. Whether you are a student, researcher, or professional in public health, epidemiology, or biostatistics, this course will give you the practical skills needed to handle, analyze, and interpret data for research and publication.
You will begin by learning how to import data from Excel, CSV, Stata, and SPSS, and organize it for analysis. The course then guides you through essential data management tasks, including cleaning messy datasets, handling missing values, transforming variables, labeling data, and preparing analysis-ready datasets.
Once the foundation is built, you will move into data visualization using ggplot2, creating clear and publication-quality charts such as histograms, boxplots, and bar graphs. You will also learn how to export figures and tables for reports and manuscripts.
A major focus of the course is statistical analysis in R, including descriptive and inferential analysis, p-values, and summary tables using the gtsummary package. You will then advance to key epidemiologic methods, including:
Linear and multiple regression
Logistic regression and interpretation of odds ratios
Cohort study analysis (risk ratio, Poisson regression, IRR)
Matched case–control analysis (conditional logistic regression)
Survival analysis (Kaplan–Meier curves and Cox regression)
Throughout the course, you will create publication-ready tables and outputs, making your results suitable for theses, dissertations, and journal articles.
This is a hands-on, step-by-step course with real data examples, designed for beginners and intermediate learners. By the end, you will be able to conduct complete epidemiologic data analysis workflows in R, from raw data to final results.
If you want to build strong, practical skills in R programming for health research, this course will give you the confidence to move forward.