Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
3w ago
It’s not uncommon to see covariates in a regression model that should not be there. For example, measurements that occur after the treatment assignment are included into a regression model as baseline covariates. Rather, one should consider a mediation analysis. I wrote a tutorial on how to perform mediation analysis using R on my RPubs site (link). I know that I make this mistake at times. This tutorial helped me to carefully consider which covariates to include in a regression model and which ones to consider for mediation analysis ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
5M ago
I wrote a tutorial on how to handle immortal time bias with survival analysis using Stata. In the tutorial, I used a time-varying predictor for the grouping variable and assigned the period before exposure to the control group. This was inspired by the paper Redelmeier and Singh wrote on “Surival in Academy Award-Winner Actors and Actresses.” There was a lot of debate about the rigor of their analyses, and Sylvestre and colleagues re-analyzed the data with immortal time bias in mind. This tutorial uses data from Sylvestre and colleagues to re-create their results. The tutorial is on my RPubs p ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
8M ago
I wrote a short tutorial on how to perform an interrupted time series analysis in R. I had a challenging time working on this because I wasn’t familiar with all the nuances of the ITSA. More importantly, I wasn’t able to leverage my Stata skills to do this in R. I’m used to the Stata margins command, which is great for creating constrasts. R has its own version of the margins command, but it lacks some of Stata’s features such as the pwcompare, which I use a lot in Stata. However, I found a workaround with linear splines, and I have uploaded this to my RPubs site (link). I hope you find this u ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
8M ago
I create two MEPS tutorials recently. One is on the use of condition-event linkage files to capture the disease-specific costs. I used migraine as a motivating example. In this tutorial, I go through the steps to identify migraine-related costs assocaited with office-based visits and inpatient night stays. In the second tutorial, I review how to perform simple trend analysis with linear regressio models. I pooled MEPS data from 2016 to 2021 and apply the approriate primary sampling units and strata from the pooled file. The first tutorial is located on my RPubs page (MEPS Tutorial 4 - Using c ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
10M ago
Recently, I was asked to help create a matching algorithm for a retrospective cohort study. The request was to perform an exact match on a single variable using a 2 to 1 ratio (unexposed to exposed). Normally, I would use a propensity score match (PSM) approach, but the data did not have enough variables for each unique subject. With PSM, I tend to build a logit (or probit) model using variables that would be theoretically associated with the treatment assignment. However, this approach requires enough observable variables to construct these PSM models. For this request, there were a few varia ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
1y ago
I wrote a tutorial on using a Tweedie distribution for a GLM gamma model for cost data in R. Unlike Stata, R is very particular with zeroes when constructing GLM models. Hence, I opted to use the Tweedie distribution to mix and match the link function with the Gamma distribution. I settled on the identity link because it doesn’t involve retransformation and is each to interpret. My tutorial is available on my RPubs site and GitHub site ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
1y ago
I wrote a short explanation on how to interpret regression models. I have posted this on RPubs, and the code is saved on my GitHub site ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
1y ago
I’m familiar Stata and have been using it whenever I worked on MEPS data. However, R is another powerful statistical program that researchers can use to evaluate and analysis MEPS data. Hence, I wanted to start writing tutorials on how to use R to analyze MEPS data. The first tutorial provide instructions on how to load MEPS data into R. You can find the tutorial on my RPubs page (link ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
1y ago
I wrote a short tutorial on how to use an odds ratio to estimate the sample size needed for a case-control study. The tutorial is located on my RPubs page (link) The R Markdown source code is located on my GitHub site (link ..read more
Mark Bounthavong Blog » Statistics And Probability
by Mark Bounthavong
1y ago
I wrote a tutorial on how to visualize linear regression models using R. In the tutorial I used the lm() command and the predict3d package to generate the models and visualize them using R. You can view the RPubs tutorial here. (NOTE: on 30 January 2022, I updated this tutorial and it can be found in my RPubs page here.) I created this tutorial using R Markdown, and the codes are available on my GitHub site (link ..read more

OR