Tutorial · LRST

Getting Started with LRST

A practical introduction to the Longitudinal Rank-Sum Test: what question it answers, how to shape the data, how to run the R package, and how to interpret the output.

What question does LRST answer?

LRST is a global test

It asks whether one group tends to perform better overall across multiple longitudinal outcomes and follow-up visits.

It is not an endpoint-specific model

It does not replace a model designed to estimate one particular mean difference, one specific time-point contrast, or an individual trajectory.

If your scientific question is about the overall multivariate longitudinal profile, LRST is a natural choice. If you want a visual explanation first, see the companion research note.

Install the package from GitHub

devtools::install_github("djghosh1123/LRST") library(LRST)

The current package documentation uses the GitHub version directly.

LRST expects longitudinal arrays

For the documented two-arm workflow, provide one array for the placebo group and one array for the treatment group.

npatients
Koutcomes
Ttime points
dim(X_c) # n_placebo × K outcomes × T time points dim(Y_c) # n_treatment × K outcomes × T time points
Important: the current lrst.2arm() implementation treats the first time point as baseline and constructs the test from the follow-up visits.

The basic two-arm analysis

fit <- lrst.2arm(X_c, Y_c) fit$p.value

The function takes the two arrays directly. No extra wrapper is required.

T.statGlobal test statistic.
T.sdEstimated standard error.
p.valueGlobal p-value for the treatment comparison.
UVisit-level score vector used to build the global statistic.
cov.UEstimated covariance matrix for those longitudinal scores.
thetaEstimated relative treatment effects across outcomes and follow-up visits.

How should you read the result?

If the global p-value is small

There is evidence of an overall difference between groups across the multivariate longitudinal profile.

Then go back to the science

Inspect individual outcomes and visits to understand where the signal is coming from and whether it is clinically meaningful.

Do not interpret a significant LRST result as meaning every endpoint improved or every visit showed a treatment effect. The test is global.

Estimate power from the two arrays

estimated_Power(0.05, X_c, Y_c)

The documented function returns estimated power at the chosen significance level using the observed placebo and treatment arrays.

Extend the workflow beyond two groups

For multiple treatment arms, keep the placebo array separate and provide the treatment arms as a list.

Y <- list(X_dose_1, X_dose_2) lrst.MultiArm(X_c, Y)

The current function returns p, the selected arm index v, and the final statistic T.

Things to check before trusting the output

Outcome direction is inconsistentMake sure higher or lower values have been aligned so treatment benefit has a consistent direction across outcomes.
The array dimensions do not matchBoth groups must contain the same number of outcomes and time points.
You treat the global p-value as an effect sizeThe p-value answers a hypothesis-testing question. It is not itself a clinical magnitude.
You skip endpoint-level interpretationLRST summarizes the global signal, but the clinical story still lives in the individual outcomes and visits.

Go deeper

Use the visual research note for intuition, the GitHub repository for software, and the publication page for the methodological papers.