umxGSEM_label_ldsc: Label or Assemble S, V, I, N into an LDSC-style covstruc list

View source: R/umxGSEM.R

umxGSEM_label_ldscR Documentation

Label or Assemble S, V, I, N into an LDSC-style covstruc list

Description

Takes an existing covstruc list (from GenomicSEM) OR loose S and V matrices, validates them, and applies strict OpenMx WLS-compliant dimnames (var_X, poly_Y_X). This guarantees that external GenomicSEM data correctly aligns with OpenMx's WLS engine.

Usage

umxGSEM_label_ldsc(
  covstruc = NULL,
  S = NULL,
  V = NULL,
  I = NULL,
  N = NULL,
  traits = NULL,
  overwrite = FALSE
)

Arguments

covstruc

An optional list with at least matrix S (genetic covariance).

S

A genetic covariance matrix (if assembling from loose matrices).

V

An asymptotic covariance matrix (if assembling from loose matrices).

I

An optional intercept matrix.

N

An optional sample size matrix or vector.

traits

Character vector of trait names. Default: colnames(S), else rownames(S), else paste0("T", seq_len(ncol(S))).

overwrite

If FALSE (default), only fill missing dimnames; if TRUE, replace existing dimnames.

Value

A list with matrices S, V, (and optionally I, N) properly labelled.

See Also

Psych_LDSC, umxGSEM()

Other GSEM: Anthro_LDSC, Psych_LDSC, plot.umx_GWAS(), umxGSEM(), umxGSEM_GWAS(), umxGSEM_dl_tutorial_files(), umxGSEM_ldsc(), umxGSEM_munge(), umxGSEM_std(), umxGSEM_sumstats(), umxSummary.MxDataStatic(), umxSummary.list()

Examples

data(Psych_LDSC)
# Re-apply labels safely
Psych_LDSC = umxGSEM_label_ldsc(Psych_LDSC)
colnames(Psych_LDSC$V)[1:3]

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