TwoSample.Q.Cov.Estimator.Sequential.LR: Function to calculate stage-wise test statistics, variances,...

View source: R/TwoSample.Q.Cov.Estimator.Sequential.LR.R

TwoSample.Q.Cov.Estimator.Sequential.LRR Documentation

Function to calculate stage-wise test statistics, variances, and correlation for two-sample generalized log-rank statistics.

Description

Computes the stage-wise generalized log-rank statistics and their variance estimates at a set of interim analysis calendar times. At each analysis, administrative censoring is applied at the specified calendar time, event times are converted from the calendar-time scale to the event-time scale (time since enrollment), and the generalized log-rank statistics is evaluated over [0, tau]. When multiple analysis are requested, the function also estimates the correlation matrix of the stage-wise statistics.

Usage

TwoSample.Q.Cov.Estimator.Sequential.LR(data, tau = 3, calendars)

Arguments

data

A data.frame generated by TwoSample.generate.sequential().

tau

Positive numeric value specifying the upper bound of event time (time since enrollment) for integration of the statistic. Default is 3.

calendars

Numeric vector of interim analysis calendar times (in years) at which to compute stage-wise statistics and variance estimates.

Value

A list containing stage-wise estimates. If length(calendars) > 1, the returned list includes:

  • Qs: Numeric vector of stage-wise generalized log-rank statistics evaluated at each calendar time in calendars.

  • vars: Numeric vector of estimated variances corresponding to Qs.

  • total.ns: Numeric vector giving the total enrolled sample size contributing data at each calendar time.

  • corr.matrix: Estimated correlation matrix of the stage-wise statistics.

  • nss: List of length length(calendars) giving the group-specific sample sizes at each analysis.

If length(calendars) == 1, the list contains Qs, vars, and total.ns.

Examples


df <- TwoSample.generate.sequential(sizevec = c(200, 200), beta.trt = 0,
calendar = 5, recruitment = 3, random.censor.rate = 0.05, seed = 2026)
TwoSample.Q.Cov.Estimator.Sequential.LR(data = df, calendars = c(2.5, 3.5, 4.5))


gsMeanFreq documentation built on Feb. 17, 2026, 1:07 a.m.