Publications by Keith Goldfeld

Bayesian proportional hazards model for a stepped-wedge design

31.03.2025

We’ve finally reached the end of the road. This is the fifth and last post in a series building up to a Bayesian proportional hazards model for analyzing a stepped-wedge cluster-randomized trial. If you are just joining in, you may want to start at the beginning. The model presented here integrates non-linear time trends and cluster-specific rand...

5185 sym R (6787 sym/9 pcs) 2 img

Accounting for ties in a Bayesian proportional hazards model

19.03.2025

Over my past few posts, I’ve been progressively building towards a Bayesian model for a stepped-wedge cluster randomized trial with a time-to-event outcome, where time will be modeled using a spline function. I started with a simple Cox proportional hazards model for a traditional RCT, ignoring time as a factor. In the next post, I introduced a n...

8191 sym R (3408 sym/7 pcs) 6 img

A Bayesian proportional hazards model with a penalized spline

03.03.2025

In my previous post, I outlined a Bayesian approach to proportional hazards modeling. This post serves as an addendum, providing code to incorporate a spline to model a time-varying hazard ratio non linearly. In a second addendum to come I will present a separate model with a site-specific random effect, essential for a cluster-randomized trial. Th...

4916 sym R (5460 sym/6 pcs) 4 img

Estimating a Bayesian proportional hazards model

10.02.2025

A recent conversation with a colleague about a large stepped-wedge design (SW-CRT) cluster randomized trial piqued my interest, because the primary outcome is time-to-event. This is not something I’ve seen before. A quick dive into the literature suggested that time-to-event outcomes are uncommon in SW-CRTs-and that the best analytic approach is ...

8886 sym R (8125 sym/13 pcs) 2 img

Thinking about covariates in an analysis of an RCT

27.01.2025

I was recently discussing the analytic plan for a randomized controlled trial (RCT) with a clinical collaborator when she asked whether it’s appropriate to adjust for pre-specified baseline covariates. This question is so interesting because it touches on fundamental issues of inference—both causal and statistical. What is the target estimand i...

9543 sym R (5197 sym/14 pcs)

Can ChatGPT help construct non-trivial statistical models? An example with Bayesian “random” splines

07.10.2024

I’ve been curious to see how helpful ChatGPT can be for implementing relatively complicated models in R. About two years ago, I described a model for estimating a treatment effect in a cluster-randomized stepped wedge trial. We used a generalized additive model (GAM) with site-specific splines to account for general time trends, implemented using...

10620 sym R (4165 sym/10 pcs) 14 img

An IV study design to estimate an effect size when randomization is not ethical

02.09.2024

An investigator I frequently consult with seeks to estimate the effect of a palliative care treatment protocol for patients nearing end-stage disease, compared to a more standard, though potentially overly burdensome, therapeutic approach. Ideally, we would conduct a two-arm randomized clinical trial (RCT) to create comparable groups and obtain an ...

13728 sym R (8765 sym/17 pcs) 6 img

Generating binary data by specifying the relative risk, with simulations

01.07.2024

The most traditional approach for analyzing binary outcome data is logistic regression, where the estimated parameters are interpreted as log odds ratios or, if exponentiated, as odds ratios (ORs). No one other than statisticians (and maybe not even statisticians) finds the odds ratio to be a very intuitive statistic, and many feel that a risk diff...

4666 sym R (3856 sym/8 pcs)

simstudy: another way to generate data from a non-standard density

03.06.2024

One of my goals for the simstudy package is to make it as easy as possible to generate data from a wide range of data distributions. The recent update created the possibility of generating data from a customized distribution specified in a user-defined function. Last week, I added two functions, genDataDist and addDataDist, that allow data generati...

3064 sym R (4673 sym/13 pcs) 12 img

simstudy 0.8.0: customized distributions

20.05.2024

Over the past few years, a number of folks have asked if simstudy accommodates customized distributions. There’s been interest in truncated, zero-inflated, or even more standard distributions that haven’t been implemented in simstudy. While I’ve come up with approaches for some of the specific cases, I was never able to develop a general solu...

4209 sym R (1949 sym/7 pcs) 4 img