Learn R Programming

pwSEM (version 1.0.0)

DAG.to.MAG.in.pwSEM: Title DAG.to.MAG.in.pwSEM

Description

Title DAG.to.MAG.in.pwSEM

Usage

DAG.to.MAG.in.pwSEM(full.DAG, latents = NA, conditioning.latents = NULL)

Value

A binary (0/1) matrix holding the MAG

Arguments

full.DAG

The DAG with latent variables, usually produced with the DAG() function of the ggm package

latents

A character vector giving the names of the latent variables in the DAG

conditioning.latents

A character vector giving the names of those latents, listed in the "latents" argument, that serve as conditioning variables for sampling (i.e. selection bias).

Examples

Run this code
library(ggm)
full.dag<-DAG(x1~L1,x2~x1,x3~x2+L1,x4~x3,L2~x2+x4)
DAG.to.MAG.in.pwSEM(full.DAG=full.dag,latents=c("L1","L2"),
conditioning.latents=c("L2"))

Run the code above in your browser using DataLab