gwsem (version 0.1.5)

buildTwoFac: Build a model suitable for a two factor genome-wide association study

Description

Build a model suitable for a two factor genome-wide association study

Usage

buildTwoFac(phenoData, F1itemNames, F2itemNames, covariates = NULL, ...,
  fitfun = c("WLS", "ML"), minMAF = 0.01, modelType = c("RAM",
  "LISREL"), gxe = NULL)

Arguments

phenoData

phenotype data with one individual per row

F1itemNames

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

F2itemNames

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

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: buildOneFacRes, buildOneFac, buildOneItem

Examples

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

Run the code above in your browser using DataCamp Workspace