Simulation
11 posts
Why linear mixed-effects models are probably not the solution to your missing data problems
Linear mixed-effects models are often used for their ability to handle missing data using maximum likelihood estimation. In this post I will present a simple example of when the LMM fails, and illustrate two MNAR sensitivity analyses: the pattern-mixture method and the joint model.
Heterogeneous treatment effects and homogeneous outcome variances
Recently there has been a couple of meta-analyses investigating heterogeneous treatment effects by analyzing the ratio of the outcome variances in the treatment and control group. The argument made in these articles is that if individuals differ in their response, then observed variances in the treatment and control group in RCTs should differ. In this post I explore this argument and provide a counterargument.
Mediation, confounding, and measurement error
In this post, I give a brief simulation-based example of how confounding and measurement error impacts the estimation of direct and indirect effects in a mediation analysis.
Change over time is not "treatment response"
The term "treatment response" is both easy to understand and simultaneously often used when causal language is clearly unwarranted. In this post, I present a non-technical example of when a naïve subgroup analysis leads to the wrong conclusion that a subgroup of patients is treatment non-responders.
New paper: The consequences of ignoring therapist effects in longitudinal data analysis
In this post, I summarize our recent paper on the consequences of ignoring therapist effects in longitudinal data analysis, which presents the results of a large simulation study.
Estimating treatment effects and ICCs from (G)LMMs on the observed scale using Bayes, Part 1: lognormal models
In this post I show how to make marginal inferences on the untransformed scaled when using multilevel models with a non-linear transformation applied to the dependent variable (a log-transformation is used as an example). Cluster-specific versus population-average (conditional versus marginal) effects are compared using both average effects on the untransformed scale and using relative (multiplicative) effects.
Do you really need a multilevel model? A preview of powerlmm 0.4.0
The next version of powerlmm (0.4.0) will soon be released, besides bug fixes this version also includes several new simulation features. In this post I will show two examples that cover the major new features.
Confounded dose-response effects of treatment adherence: fitting Bayesian instrumental variable models using brms
Non-randomized comparisons are common in RCTs. In this post I show some examples of confounding and collider bias, using treatment adherence as an example. I present a small simulation study that show that common regression models used in clinical psychology, makes little sense, and that Bayesian instrumental variable regression can be easily fit using the R package brms.
Are parallel simulations in the cloud worth it? Benchmarking my MBP vs my Workstation vs Amazon EC2
In this post I compare the performance of Amazon EC2 instances vs my HP workstation and my MacBook Pro, when doing Monte Carlo simulations.
Calculating the Overlap of Two Normal Distributions Using Monte Carlo Integration
In this post I show how to calculate the overlap of two normal distributions using simulations.
Monty Hall Simulations
In this post I use R to simulate the classic monty hall-problem and visualize the results with ggplot2.