gwsem (version 0.1.5)

buildOneFacRes: Build a model suitable for a single factor residual genome-wide association study

Description

Build a model suitable for a single factor residual genome-wide association study

Usage

buildOneFacRes(phenoData, itemNames, factor = F, res = itemNames,
  covariates = NULL, ..., fitfun = c("WLS", "ML"), minMAF = 0.01,
  modelType = c("RAM", "LISREL"), gxe = NULL)

Arguments

phenoData

phenotype data with one individual per row

itemNames

a vector of phenotypic item names that load on the latent factor

factor

whether to estimate a regression from the SNP to the latent factor (default FALSE)

res

character vector. Which indicators to estimate a regression to

covariates

a vector of data column names to use as covariates

...

Not used. Forces remaining arguments to be specified by name.

fitfun

the name of the fit function to optimize

minMAF

minimum minor allele frequency. Only used when fitfun=WLS

modelType

whether to use the RAM or LISREL parameterization

gxe

a vector of data column names. Creates additional data columns named paste0('snp_',columnName) that are the product of the SNP and the data in columnName

Value

A MxModel

Details

You can pass the result of this function to GWAS to run a GWAS.

Ordinal indicator thresholds are setup by setupThresholds. Covariates adjustments are setup by setupCovariates. You can plot the model using omxGraphviz.

See Also

Other model builder: buildOneFac, buildOneItem, buildTwoFac

Examples

Run this code
# NOT RUN {
pheno <- list()
for (i in 1:5) pheno[[paste0('i',i)]] <- rnorm(500)
pheno <- as.data.frame(pheno)
buildOneFacRes(pheno, colnames(pheno))
# }

Run the code above in your browser using DataLab