---
title: "Reference for `gst` package"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Reference for `gst` package}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

<!-- Modified 2026-10-08 by Xiao Ni in https://github.com/xni7/gst. Original work copyright 2025 Sarepta Therapeutics Inc., Apache License 2.0. -->

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```


## Operational Effect Size

### Ordinary Least Squares (OLS)

$$\Lambda_{OLS} = \mathbf{J}^T \lambda / \sqrt{\mathbf{J}^T \mathbf{R} \mathbf{J}} \qquad$$
$$
T_{OLS} = \frac{\mathbf{J}^T\mathbf{Z}}{\sqrt{\mathbf{J}^T\hat{\mathbf{R}}\mathbf{J}}} = \frac{\sum_{k=1}^m Z_k}{\sqrt{\sum_{k,k'=1}^m \hat{R}_{kk'}}}
$$

### Generalized Least Squares (GLS)

$$
\Lambda_{GLS} = \frac{\mathbf{J}^T\mathbf{R}^{-1}\lambda}{\sqrt{\mathbf{J}^T\mathbf{R}^{-1}\mathbf{J}}}
$$

$$
T_{GLS} = \frac{\mathbf{J}^T\hat{\mathbf{R}}^{-1}\mathbf{Z}}{\sqrt{\mathbf{J}^T\hat{\mathbf{R}}^{-1}\mathbf{J}}}
$$


## Type I Error

### Equal $n$ and $df = 2n-2$
$$Pow(n, \Lambda) = P\left\{T\left(\sqrt{\frac{n}{2}}\Lambda, 2n - 2\right) > t_{\alpha,2n-2}\right\} \qquad$$


### General Case

$$Pow(n, \Lambda) = P\left\{T\left(\sqrt{\frac{n_0n_1}{n_0 + n_1}}\Lambda, df\right) > t_{\alpha,df}\right\} \qquad$$

Degrees of freedom ($df$):

- Dallow (2008): $n_0 + n_1 - 2$

- O'Brien (1984): $n_0 + n_1 - 2*m$ ,

- Logan and Tamhane (2004): $0.5(n_0 + n_1 - 2)/(1 + 1/m^2)$ 


## P-value Combination

### Fisher's Method (1932)
Letting $p_1, p_2, \ldots, p_k$ denote the individual (one- or two-sided) p-values of the $k$ hypothesis tests to be combined, the test statistic is then computed with

$$X^2 = -2 \sum_{i=1}^k \ln(p_i).$$

Under the joint null hypothesis, the test statistic follows a chi-square distribution with $2k$ degrees of freedom which is used to compute the combined p-value.

Fisher's method assumes that the p-values to be combined are independent. If this is not the case, the method can either be conservative (not reject often enough) or liberal (reject too often), depending on the dependence structure among the tests. In this case, one can adjust the method to account for such dependence (to bring the Type I error rate closer to some desired nominal significance level).

### Stouffer's Method (1949)

Letting $p_1, p_2, \ldots, p_k$ denote the individual (one- or two-sided) p-values of the $k$ hypothesis tests to be combined, the test statistic is then computed with

$$z = \sum_{i=1}^k z_i/\sqrt{k}$$

where $z_i = \Phi^{-1}(1 - p_i)$ and $\Phi^{-1}(\cdot)$ denotes the inverse of the cumulative distribution function of a standard normal distribution. Under the joint null hypothesis, the test statistic follows a standard normal distribution which is used to compute the combined p-value.

Stouffer's method assumes that the p-values to be combined are independent. If this is not the case, the method can either be conservative (not reject often enough) or liberal (reject too often), depending on the dependence structure among the tests. In this case, one can adjust the method to account for such dependence (to bring the Type I error rate closer to some desired nominal significance level).

### Adjustment of dependence

Adjustment Based on the Effective Number of Tests based on Nyholt, 2004

$$m = 1 + (k - 1) \frac{1 - Var(ev)}{k}$$

where $ev$ is eigenvalues of correlation matrix $R$ among tests, and $k$ is the number of tests


## Reference

Luo X, Li L, Savenkov O, Liu W, Ni X, Tang W, Guo W. Multiple Comparisons Procedures for Analyses of Joint Primary Endpoints and Secondary Endpoints. Pharmaceutical Statistics. 2025;24(3):e70010. doi: 10.1002/pst.70010.

Dallow NS, Leonov SL, Roger JH. Practical usage of O'Brien's OLS and GLS statistics in clinical trials. Pharm Stat. 2008 Jan-Mar;7(1):53-68. doi: 10.1002/pst.268. PMID: 17390306



