在临床试验中,通常使用SAS来完成统计分析和生成图表,但我们不应该只局限于一种编程方法,而且这个所用的编程语言SAS并不是开源的。毫无疑问SAS能完成的事情,R和Python同样能做;但有些R和Python能做的,SAS却很难完成,我想这就是开源和不开源的区别。
Common Survival analysis of Oncology trials in R
Symbols count in article: 8.7k Reading time ≈ 8 mins.
Time-to-event endpoints are widely used in oncology trials, such as OS and PFS. And survival analysis is a common method for estimating time-to-event endpoints. In this blog, I’d like to make a note of how to summarize the essential results for survival analysis in oncology trials in R and also compare them with SAS.
Evaluation of Best Overall Response per RECIST in R
The Best Overall Response (BOR) is a very common evaluation of efficacy in oncology trials. Usually, it is defined as the best response among all time-point responses from the treatment start until the first disease progression, in the order of CR, PR, SD, PD, and NE per RECIST 1.1. For non-randomized trials, BOR is not only the best among all responses but also requires confirmation for CR and PR to ensure the result is not a measurement error. More details can be found in the RECIST 1.1 document, which I will not expand on here.
Response Rate and Odd Ratio in R and SAS
Symbols count in article: 7k Reading time ≈ 6 mins.
As we know, the objective response rate (ORR) is used as a key endpoint to demonstrate the efficacy of a treatment in oncology and is also valuable for clinical decision making in phase I-II trials, especially in single-arm trials.
Hypothesis testing of MMRM
Contrasts and Hypothesis Tests of emmeans
In the article Definition of least-squares means (LS means), we have known how to compute the LS mean step by step and how to implement it in the emmeans
package that will calculate the estimated mean value for different factor variables and assume the mean value for continuous variables.
Hexo迁移 - 更换ECS服务器
趁着最近阿里云双11的优惠活动,我计划更换下博客所在的ECS服务器(其实为了响应消费降级~),咨询了下售前和售后,最终顺利完成迁移,记录一下迁移过程以备后续所需。
Understanding Mixed Model Repeated Measures (MMRM) in SAS and R
Symbols count in article: 7k Reading time ≈ 6 mins.
Mixed models for repeated measures (MMRM) is widely used for analyzing longitdinal continuous outcomes in randomized clinical trials. Repeated measures refer to multiple measures taken from the same experimental unit, such as a couple of tests over time on the same subject. And the advantage of this model is that it can avoid model misspcification and provide unbiased estimation for data that is missing completely at random (MCAR) or missing at random (MAR).
mcradds R Package
I'm tickled pink to announce the release of mcradds
(version 1.0.1) helps with designing, analyzing and visualization in In Vitro Diagnostic trials.
Releasing R Package to CRAN
Recently, I've been developing my R package - mcradds, which will be my first package released to CRAN. To be honest, finishing coding is just the first step for R package development, whereas I feel like the submission to CRAN is the most challenging for me. This blog is to keep track of something I came across during the submission process to help giving me a reminder when I would develop other packages in next steps. If you are a beginner like me, this blog will be beneficial to you as well.
Convert Plots to Editable Format in R
推荐一个R包(officer
)可以用于生成editable图片在PPT中。这里的editable是指图片中每个元素包括散点、X/Y轴、标签都能修改,常用于图片的再修饰
Multiple Imputation in Non-inferiority and Superiority Trials
In the previous article (Understanding Multiple Imputation in SAS), we talked about how to implement multiple imputation in the SAS procedure to compare the difference between the treatment and placebo groups. Let's look at how to do it in non-inferiority and superiority trials, which differ from common use.
Understanding Multiple Imputation in SAS
Introduction
There are plenty of methods that could be applied to the missing data, depending on the goal of the clinical trial. The most common and recommended is multiple imputation (MI), and other methods such as last observation carried forward (LOCF), observed case (OC) and mixed model for repeated measurement (MMRM) are also available for sensitivity analysis.
Confidence Limits for a Hazard Ratio
This is a brief note about confidence interval of Hazard Ratio.
Simulation-based Inference
网上看到一个学习资料,推荐下。参考资料:Chapter 7 Simulation-based Inference 来自于Book STAT160 R/RStudio Companion / 2021。
其主要介绍了4种推断方法
- One-Proportion Inference
- One-Mean Inference
- Two-proportion inference
- Two-mean inference
Imputing Missing Data in Clinical Trials
Symbols count in article: 4.6k Reading time ≈ 4 mins.
Missing data is inevitable for several reasons during the clinical trials. As we know, missing data can be classified into one of three categories, like MCAR(Missing Completely At Random), MAR(Missing At Random) and MNAR(Missing Not At Random).
How to implement two color scales in ggplot2
As indicated in the title, this article will discuss how to solve this problem in ggplot2
.
Call ChatGPT API or chatgpt package in R
OpenAI于3月1日发布了ChatGPT API,但其只提供了Python中如何调用此API的文档说明。尽管没提到如何使用R来调用,但是毫无疑问R肯定是可以的,所以我用google搜了下。以下是基于网上资料而整理的简短介绍,如何在R中用ChatGPT。
Four ways to split the column in mutate
Here is just a trick note to demonstrate how to split the column when you use the mutate
function from the dplyr
package in R.
Calculation of follow-up time
Survival analysis is often used in tumor clinical trials, and there are usually two estimations that appear in the report: the median survival time and the median follow-up time.