xmu_gsem_subset_covstruc: Subset a GenomicSEM Covariance Structure to Selected Traits

View source: R/xmuGSEM.R

xmu_gsem_subset_covstrucR Documentation

Subset a GenomicSEM Covariance Structure to Selected Traits

Description

Filters a covstruc object containing genetic covariance ($S$), sampling covariance ($V$), and optionally genomic control ($I$) matrices down to a specified subset of traits. It ensures proper alignment of the vech-ordered elements of the sampling covariance matrix $V$.

Usage

xmu_gsem_subset_covstruc(covstruc, keep_vars)

Arguments

covstruc

A list containing the genetic covariance matrix ⁠$S⁠, the sampling covariance matrix ⁠$V⁠, and optionally the genomic control matrix ⁠$I⁠.

keep_vars

Character vector of trait names to retain in the subset.

Value

A list in the same format as covstruc containing only the subsetted and aligned elements for the traits in keep_vars.


umx documentation built on Oct. 11, 2026, 5:07 p.m.