st: Sample tree

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/APFAfunctions.R

Description

Builds the sample tree of a discrete longitudinal dataset.

Usage

1
st(iD)

Arguments

iD

iD a data frame whose variables are factors. Any missing values are treated as additional factor levels.

Details

Sample trees are constructed as follows. Suppose $N$ observations pf $p$ discrete variables $(x_1, ..., x_p)$ are given. Starting with $N$ observations at the root node, edges branches out to nodes at the first level. The number of branches corresponds to number of distinct values of $x_1$, and the count on each edge correspond to the frequency of occurrence of the respective value. From each node at level one, edges branch out to level two, based on the distinct values of $x_2$ given $x_1$. The process continues up to level $p$.

Value

An igraph object containing the sample tree.

Note

further notes

Author(s)

Smitha Ankinakatte

References

Ankinakatte, S. and Edwards, D. Modelling discrete longitudinal data using acyclic probabilistic finite automata. Submitted to C.S.D.A.

Examples

1
2
3
4
5
6
7
data(Wheeze)
G <- st(Wheeze)
E(G)$arrow.size <- 0.6
V(G)$size <- 10
V(G)$label <- ''
E(G)$label <- E(G)$count
plot(G)

gRapfa documentation built on May 2, 2019, 6:54 a.m.