generate.simple.sample.outcomes.matrix: Returns a matrix of outcome samples, either permutations of...

View source: R/instability_scans.R

generate.simple.sample.outcomes.matrixR Documentation

Returns a matrix of outcome samples, either permutations of the actual data or drawn from the null model of no locus effect

Description

This function draws simple bootstraps or permutations from a data set and returns a specified number of outcome samples.

Usage

generate.simple.sample.outcomes.matrix(
  formula,
  data,
  pheno.id = "SUBJECT.NAME",
  method = c("bootstrap", "permutation"),
  use.REML = TRUE,
  num.samples,
  seed = 1
)

Arguments

formula

An lm style formula with functions of outcome and covariates contained in data frame.

data

A data frame with outcome and potential covariates. Should also have IDs that link to IDs in the genome cache, often with the individual-level ID named "SUBJECT.NAME", though others can be specified with pheno.id.

pheno.id

DEFAULT: "SUBJECT.NAME". The is the individual-level ID that is associated with data points in the phenotype data. Generally this should be unique for each data point.

method

DEFAULT: "bootstrap". "bootstrap" specifies that bootstrap samples are drawn from a simple Gaussian based on the formula argument. "permutation" specifies simple permutations, essentially re-mixing the actual outcome vector.

use.REML

DEFAULT: TRUE. Determines whether the variance components for the parametric sampling are based on maximizing the likelihood (ML) or the residual likelihood (REML).

num.samples

The number of parametric bootstrap samples to return.

seed

DEFAULT: 1. The sampling process is random, thus a seed must be set for samples to be consistent across machines.

Examples

generate.simple.sample.outcomes.matrix()

gkeele/miqtl documentation built on June 13, 2022, 4:20 p.m.