pi0_model: Formulates the model for the proportion of null tests

View source: R/pi0_model.R

pi0_modelR Documentation

Formulates the model for the proportion of null tests

Description

pi0_model helps generate the model for the proportion of truly null tests. For more details, refer to the vignette.

Usage

pi0_model(z, indep_snps = NULL, basis.df = 3, knots = NULL)

Arguments

z

matrix: informative variables that impact the power of the p-values (rows are tests and columns are different informative variables). Currently, there must be no missing values.

indep_snps

vector Boolean indicating the set of independent SNPs

basis.df

integer: the degrees of freedom for the natural cubic spline on each variable. Default is 3 at equally space intervals.

knots

vector: Specify the location of the knots in natural cubic spline. Note that the knots are specified using quantiles by default. Default is NULL and uses basis.df at equally space intervals.

Details

We note that this function is specifically designed for informative p-values and other complex models should be created outside this function.

Value

A list with the following entries:

  1. fmod: model formula

  2. zt: matrix of rank-transformed informative variables

Author(s)

Andrew Bass

See Also

sffdr

Examples

data(bmi)

p <- sumstats$bmi
z <- as.matrix(sumstats[, -1])

# For p-values, you want to specify the lower quantiles
fmod <- pi0_model(z, knots = c(0.005, 0.01, 0.025, 0.05, 0.1))


sffdr documentation built on April 4, 2025, 1:41 a.m.