Learn R Programming

AllelicSeries (version 0.1.1.5)

CalcSumstats: Calculate Summary Statistics

Description

Generate summary statistics from individual-level data. Provide either a list of data as generated by DGP, or all of anno, geno, and pheno.

Usage

CalcSumstats(
  anno = NULL,
  covar = NULL,
  data = NULL,
  geno = NULL,
  pheno = NULL,
  add_intercept = TRUE,
  is_binary = FALSE
)

Value

List containing the following items:

  • ld: A SNP x SNP correlation (LD) matrix.

  • sumstats: A SNP x 5 matrix of summary statistics, including the . annotation, MAF, estimated effect size, standard error, and p-value.

  • type: Either "binary" or "quantitative".`

Arguments

anno

(snps x 1) annotation vector.

covar

(subjects x covars) covariate matrix.

data

List of data containing the annotation vector anno, the covariate data covar, the genotype matrix geno, and the phenotype vector pheno, as returned by DGP. Overrides the other arguments if provided.

geno

(subjects x snps) genotype matrix.

pheno

(subjects x 1) phenotype vector.

add_intercept

Add an intercept if not present in the supplied covariate matrix covar? Default: TRUE.

is_binary

Is the phenotype binary? Default: FALSE.

Examples

Run this code
data <- DGP()
sumstats <- CalcSumstats(data = data)

Run the code above in your browser using DataLab