permute_resids_trait_cor: Power Simulations

View source: R/residual_permutation_function.R

permute_resids_trait_corR Documentation

Power Simulations

Description

Power Simulations

Usage

permute_resids_trait_cor(
  pheno,
  trait,
  covariates_string,
  gene_exp,
  required_cor,
  seed = NULL,
  outcome_type = "continuous"
)

Arguments

pheno

A data.frame with phenotypes

trait

A continuous/ binary variable to permute while preserving association with covariates

covariates_string

Covariates to adjust for, as a string used in regression model

gene_exp

Selected gene/transcript to simulate as associated with the trait

required_cor

Corelations value simulating the strength of association between trait and gene_exp

seed

Random seed

outcome_type

continuous and binary

Value

A vector permuted trait that is associated with gene_exp

Examples

data(phenotype)
data(ENSG00000000003)
trait<-"Trait.1"; covars="Age+Sex"
permute_resids_trait_cor(pheno= phenotype,trait=trait,
                         covariates_string=covars, required_cor=0.3,
                         gene_exp=ENSG00000000003,seed=NULL, outcome_type="continuous")

nkurniansyah/Olivia documentation built on July 29, 2023, 9:10 a.m.