Home
About
Projects
Publications
Teaching
Book
Programming
Blog
Upcoming Events
Other links
Contact

Mark Bounthavong

Home
About
Projects
Publications
Teaching
Book
Programming
Blog
Upcoming Events
Other links
Contact
Mark Bounthavong
September 28, 2024
R Programming

Tips and Tricks (Guide) with R and RStudio

Mark Bounthavong
September 28, 2024
R Programming

I wrote a collection of tips and tricks (guide) for R and RStudio (link). This is a work in progress, and I plan to update this in the fiture.

Tagged: R programming, RStudio, guide

Newer PostLinear spline (piecewise) models in Stata
Older PostDistributions in cost-effectiveness analysis

Subscribe

Sign up with your email address to receive news and updates.

We respect your privacy.

Thank you! If you have questions, please feel free to email internal.validity.blog@gmail.com


Categories

Biographies

Commentaries

Cost-effectiveness models

Data visualization

Drug pricing

Econometrics

Excel programming

GIS

MEPS

Methods

Microeconomics

News

Podcasts

R Programming

Stata programming

Statistics & Probabilities


Use the search tool to find a specific blog


Previous blogs

  • May 2025
    • May 26, 2025 Transform data from wide to long format using R May 26, 2025
  • April 2025
    • Apr 30, 2025 Generate data using the simstudy package in R Apr 30, 2025
  • March 2025
    • Mar 30, 2025 Medication adherence estimations using R - Part 1 Mar 30, 2025
  • February 2025
    • Feb 26, 2025 Propensity score matching in R Feb 26, 2025
  • January 2025
    • Jan 30, 2025 Stata - marginsplot & mplotoffset commands for plotting average marginal effects Jan 30, 2025
  • December 2024
    • Dec 25, 2024 Prepost analysis with continuous data using R - Part 1 Dec 25, 2024
  • November 2024
    • Nov 30, 2024 Some cool website on study design and biostatistics Nov 30, 2024
  • October 2024
    • Oct 28, 2024 Linear spline (piecewise) models in Stata Oct 28, 2024
  • September 2024
    • Sep 28, 2024 Tips and Tricks (Guide) with R and RStudio Sep 28, 2024
  • August 2024
    • Aug 25, 2024 Distributions in cost-effectiveness analysis Aug 25, 2024
  • July 2024
    • Jul 28, 2024 Staggered difference-in-differences using R Jul 28, 2024
  • June 2024
    • Jun 23, 2024 Mediation analysis using R Jun 23, 2024
  • May 2024
    • May 18, 2024 Using Excel VBA macros to conduct one-way sensitivity analyses and tornado diagram May 18, 2024
  • April 2024
    • Apr 28, 2024 R - Loading data from Google drive Apr 28, 2024
  • March 2024
    • Mar 25, 2024 Presentations with R Markdown - Part 3: Changing font colors Mar 25, 2024
  • February 2024
    • Feb 26, 2024 Survival Analysis - Immortal Time Bias with Stata Feb 26, 2024
  • January 2024
    • Jan 25, 2024 Constructing a Markov model for cost-effectiveness analysis using Excel: A tutorial Jan 25, 2024
  • December 2023
    • Dec 27, 2023 MEPS Tutorial - Some of my helpful notes Dec 27, 2023
  • November 2023
    • Nov 24, 2023 MEPS tutorial on interrupted time series analysis in R Nov 24, 2023
    • Nov 19, 2023 MEPS tutorials on linkage files and trend analysis Nov 19, 2023
  • October 2023
    • Oct 29, 2023 Interrupted time series analysis (ITSA) with Stata Oct 29, 2023
  • September 2023
    • Sep 30, 2023 Exact matching using R - MatchIt package Sep 30, 2023
  • August 2023
    • Aug 20, 2023 Building a book using the bookdown package in R - Part 2: Chapters and References Aug 20, 2023
  • July 2023
    • Jul 24, 2023 Building a book using the bookdown package in R - Part 1 Jul 24, 2023
  • June 2023
    • Jun 29, 2023 Building an HTML Presentation using R Markdown - Part 2 Jun 29, 2023
  • May 2023
    • May 10, 2023 Tweedie GLM model in R for Cost Data May 10, 2023
  • April 2023
    • Apr 30, 2023 Two-part models in R - Application with cost data Apr 30, 2023
  • March 2023
    • Mar 29, 2023 Building an HTML Presentation Using R Markdown Mar 29, 2023
  • February 2023
    • Feb 27, 2023 Interpreting regression models Feb 27, 2023
  • January 2023
    • Jan 12, 2023 MEPS Tutorial - Part 3: Applying survey weights using R Jan 12, 2023
    • Jan 6, 2023 MEPS Tutorial - Part 2: Merging Data with R Jan 6, 2023
  • December 2022
    • Dec 24, 2022 MEPS Tutorial - Part 1: Loading Data into R Dec 24, 2022
  • November 2022
    • Nov 30, 2022 ISPOR New Professionals Fireside Chat -- Networking At Conferences Nov 30, 2022
    • Nov 29, 2022 R Markdown: Adding icons using the "fontawesome" package -- a short tutorial Nov 29, 2022
  • October 2022
    • Oct 30, 2022 Stata tutorial: Adding the 95% Confidence Interval to a Two-way Line Plot Oct 30, 2022
  • September 2022
    • Sep 29, 2022 ISPOR New Professionals Fireside Chat -- Finding Sponsorship and Mentorship in the Workplace Sep 29, 2022
  • August 2022
    • Aug 20, 2022 R plotly - Bar Charts Aug 20, 2022
  • July 2022
    • Jul 30, 2022 Hosting an R Markdown HTML file on a GitHub page Jul 30, 2022
  • June 2022
    • Jun 29, 2022 Sample size estimation using the odds ratio in a case-control study Jun 29, 2022
  • May 2022
    • May 31, 2022 ISPOR 2022 North American conference (May 15-18, 2022) -- My experience May 31, 2022
  • April 2022
    • Apr 29, 2022 Communicating data effectively with data visualization: Part 41 (Color Blind Friendly Palette) Apr 29, 2022
  • March 2022
    • Mar 15, 2022 Communicating data effectively with data visualization: Part 40 (Percentage of population with COVID-19 vaccination) Mar 15, 2022
  • February 2022
    • Feb 9, 2022 Survival analysis in R Feb 9, 2022
  • January 2022
    • Jan 31, 2022 R tutorials on confounding/interaction and linear regression model - Updates Jan 31, 2022
    • Jan 18, 2022 Communicating data effectively with data visualization: Part 39 (Heatmaps of COVID-19 deaths) Jan 18, 2022
  • December 2021
    • Dec 30, 2021 Sample size estimation and Power analysis in R Dec 30, 2021
    • Dec 19, 2021 Logistic regression in R - Part 2 (Goodness of fit tests) Dec 19, 2021
    • Dec 5, 2021 Logistic regression in R Dec 5, 2021
  • November 2021
    • Nov 10, 2021 Visualizing linear regression models using R - Part 2 Nov 10, 2021
  • October 2021
    • Oct 28, 2021 Visualizing linear regression models using R - Part 1 Oct 28, 2021
  • September 2021
    • Sep 26, 2021 R tutorial on using the epitools package to assess confounding and interaction Sep 26, 2021
  • August 2021
    • Aug 30, 2021 Reproduction number—COVID-19 Aug 30, 2021
  • July 2021
    • Jul 30, 2021 Forest plots in R Jul 30, 2021
  • June 2021
    • Jun 24, 2021 Communicating data effectively with data visualizations: Part 38 (Replicating the LA Times COVID-19 tracker) Jun 24, 2021
  • May 2021
    • May 31, 2021 Communicating data effectively with data visualizations: Part 37 (visualization COVID vaccinations by race, gender, and age) May 31, 2021
  • April 2021
    • Apr 27, 2021 Communicating data effectively with data visualizations: Part 36 (Scatter plots and Moving Averages for COVID-19 vaccination) Apr 27, 2021
  • March 2021
    • Mar 26, 2021 Communicating data effectively with data visualizations: Part 35 (Heat maps – COVID-19 Deaths by Week and State) Mar 26, 2021
  • February 2021
    • Feb 22, 2021 Communicating data effectively with data visualizations: Part 34 (Progress bars in Excel) Feb 22, 2021
  • January 2021
    • Jan 20, 2021 Communicating data effectively with data visualizations: Part 33 (Bar charts with secondary axis) Jan 20, 2021
  • December 2020
    • Dec 16, 2020 Communicating data effectively with data visualizations: Part 32 (John W. Tukey short biography) Dec 16, 2020
  • November 2020
    • Nov 18, 2020 Communicating data effectively with data visualizations: Part 31 (Visualizing COVID-19 deaths using sparklines) Nov 18, 2020
  • October 2020
    • Oct 20, 2020 Communicating data effectively with data visualizations: Part 30 (Butterfly charts) Oct 20, 2020
  • September 2020
    • Sep 22, 2020 Communicating data effectively with data visualizations: Part 29 (Forest plots) Sep 22, 2020
  • August 2020
    • Aug 21, 2020 Communicating data effectively with data visualizations: Part 28 (Scatter plot) Aug 21, 2020
  • July 2020
    • Jul 20, 2020 Communicating data effectively with data visualizations: Part 27 (Building a COVID-19 surveillance dashboard using Power BI) Jul 20, 2020
  • June 2020
    • Jun 26, 2020 Communicating data effectively with data visualizations: Part 26 (COVID-19 choropleth) Jun 26, 2020
  • May 2020
    • May 19, 2020 Communicating data effectively with data visualizations: Part 25 (Moving averages) May 19, 2020
    • May 8, 2020 Formulating a good research question May 8, 2020
  • April 2020
    • Apr 18, 2020 Communicating data effectively with data visualizations: Part 24 (Mortality Curves) Apr 18, 2020
  • March 2020
    • Mar 19, 2020 Communicating data effectively with data visualizations: Part 23 (Epidemic Curves) Mar 19, 2020
  • February 2020
    • Feb 10, 2020 Communicating data effectively with data visualizations: Part 22 (How to create a double axes figure in Excel) Feb 10, 2020
  • January 2020
    • Jan 30, 2020 Medical Expenditure Panel Survey (MEPS) Guide - Part 1 Jan 30, 2020
  • December 2019
    • Dec 13, 2019 Communicating data effectively with data visualizations: Part 21 [Examples of famous (and infamous) data visualizations] Dec 13, 2019
  • November 2019
    • Nov 9, 2019 Communicating data effectively with data visualizations: Part 20 (Enhance your data visualization with labels and contrast) Nov 9, 2019
  • October 2019
    • Oct 17, 2019 Communicating data effectively with data visualizations—Part 19 (Doughnut charts) Oct 17, 2019
  • September 2019
    • Sep 14, 2019 Biography: Florence Nightingale Sep 14, 2019
  • August 2019
    • Aug 21, 2019 Communicating data effectively with data visualizations—Part 18 (Histograms) Aug 21, 2019
  • July 2019
    • Jul 29, 2019 Communicating data effectively with data visualization – Part 17 (Multivariate Dimensions) Jul 29, 2019
  • June 2019
    • Jun 22, 2019 Communicating data effectively with data visualization – Part 16 (UpSet diagrams) Jun 22, 2019
  • May 2019
    • May 16, 2019 Communicating data effectively with data visualization – Part 15 (Diverging Stacked Bar Chart for Likert scales) May 16, 2019
  • April 2019
    • Apr 28, 2019 Communicating data effectively with data visualization – Part 14 (Gantt Charts) Apr 28, 2019
  • March 2019
    • Mar 14, 2019 Communicating data effectively with data visualization - Part 13 (Box and Whisker Diagrams) Mar 14, 2019
  • February 2019
    • Feb 19, 2019 Cobb-Douglas production function and costs minimization problem Feb 19, 2019
  • January 2019
    • Jan 6, 2019 Using Stata’s bysort command for panel data in time series analysis Jan 6, 2019
  • December 2018
    • Dec 10, 2018 Is my d20 killing me? – using the chi square test to determine if dice rolls are bias Dec 10, 2018
  • November 2018
    • Nov 17, 2018 Communicating data effectively with data visualization - Part 12 (Waffle Charts) Nov 17, 2018
  • October 2018
    • Oct 20, 2018 Communicating data effectively with data visualization - Part 11 (Waterfall charts) Oct 20, 2018
  • September 2018
    • Sep 18, 2018 Developing choropleths using the United States Veterans Integrated System Network (VISN) shapefiles Sep 18, 2018
  • August 2018
    • Aug 30, 2018 Using inverse probability of treatment weights & Marginal structural models to handle time-varying covariates Aug 30, 2018
    • Aug 13, 2018 Communicating data effectively with data visualizations - Part 10 (Heat Maps) Aug 13, 2018
  • July 2018
    • Jul 16, 2018 Communicating data effectively with data visualizations - Part 9 (Cleveland Plots) Jul 16, 2018
    • Jul 16, 2018 Communicating data effectively with data visualizations - Part 8 (Slope graphs) Jul 16, 2018
    • Jul 3, 2018 Estimating marginal effects using Stata Part 1 – Linear models Jul 3, 2018
  • May 2018
    • May 27, 2018 CHOICE Blog: Trump Administration’s Blueprint to Address Drug Prices May 27, 2018
    • May 27, 2018 Communicating data effectively with data visualizations - Part 7 (Using Small Multiples or Panel Charts in Excel) May 27, 2018
    • May 26, 2018 Communicating data effectively with data visualizations - Part 6 (Tornado diagram) May 26, 2018
  • April 2018
    • Apr 14, 2018 Communicating data effectively with data visualizations - Part 5 (Colors) Apr 14, 2018
    • Apr 6, 2018 Understanding the potential risks and opportunities with naloxone Apr 6, 2018
  • March 2018
    • Mar 15, 2018 Generating Survival Curves from Study Data: An Application for Markov Models (Part 2 of 2) Mar 15, 2018
    • Mar 15, 2018 Generating Survival Curves from Study Data: An Application for Markov Models (Part 1 of 2) Mar 15, 2018
  • February 2018
    • Feb 18, 2018 Counting and Data Manipulation for an ITSA Feb 18, 2018
    • Feb 1, 2018 Excel macro to convert cell values in a pivot table from COUNT to SUM Feb 1, 2018
  • January 2018
    • Jan 24, 2018 Communicating data effectively with data visualization - Part 4 (Time series) Jan 24, 2018
  • November 2017
    • Nov 15, 2017 Communicating data effectively with data visualization – Part 3 (Truncated Axis and Area as Quantity) Nov 15, 2017
  • October 2017
    • Oct 14, 2017 Communicating data effectively with data visualization – Part 2 (Distortions, Scales, and Volume) Oct 14, 2017
  • September 2017
    • Sep 9, 2017 Communicating data effectively with data visualizations - Part 1 (Principles of Data Viz) Sep 9, 2017
  • August 2017
    • Aug 8, 2017 Veterans Health Administration reduces opioid use with Academic Detailing Aug 8, 2017
  • March 2017
    • Mar 19, 2017 Illustrating Value, Prioritizing Evaluation, Saving Lives Mar 19, 2017
    • Mar 19, 2017 Empirical Bayes estimates Mar 19, 2017

Back to Top

Powered by Squarespace