treepcor: Define a tree used to model correlation matrices using a...

View source: R/treepcor.R

treepcorR Documentation

Define a tree used to model correlation matrices using a shared latent variables method represented by a tree, whose nodes represent the two kind of variables: children and parent. See treepcor.

Description

Define a tree used to model correlation matrices using a shared latent variables method represented by a tree, whose nodes represent the two kind of variables: children and parent. See treepcor.

Usage

treepcor(...)

Arguments

...

a list of formula used as relationship to define a three for correlation modeling, see treepcor(). Parent nodes shall be in the right side while children (or parent with a parent) in the left side.

Details

The children variables are those with an ancestor (parent), and are identified as c1, ..., cn, where n is the total number of children variables. The variables are identified as p1, ..., pm, where the m is the number of parent variables. The main parent (fist) should be identified as p1. Parent variables (except p1) have an ancestor, which is a parent variable.

Value

a treepcor object

Examples

g1 <- treepcor(p1 ~ c1 + c2 - c3)
g1
summary(g1)
plot(g1)
prec(g1)
prec(g1, theta = 0)

g2 <- treepcor(p1 ~ c1 + c2 + p2,
          p2 ~ c3 - c4)
g2
summary(g2)
plot(g2)
prec(g2)
prec(g2, theta = c(0, 0))

g3 <- treepcor(p1 ~ -p2 + c1 + c2,
          p2 ~ c3)
g3
summary(g3)
plot(g3)
prec(g3)
prec(g3, theta = c(0,0))

graphpcor documentation built on June 8, 2025, 10:37 a.m.