Generates an ENA model by constructing a dimensional reduction of adjacency (co-occurrence) vectors as defined by the supplied conversations, units, and codes.
Usage
ena.set.creator(
data,
codes,
units,
conversation,
metadata = NULL,
model = c("EndPoint", "AccumulatedTrajectory", "SeparateTrajectory"),
weight.by = "binary",
window = c("MovingStanzaWindow", "Conversation"),
window.size.back = 1,
window.size.forward = 0,
include.meta = TRUE,
groupVar = NULL,
groups = NULL,
runTest = FALSE,
...
)Arguments
- data
data.frame with containing metadata and coded columns
- codes
vector, numeric or character, of columns with codes
- units
vector, numeric or character, of columns representing units
- conversation
vector, numeric or character, of columns to segment conversations by
- metadata
vector, numeric or character, of columns with additional meta information for units
- model
character, the ENA model to construct:
EndPoint(default) produces a single adjacency vector per unit summing co-occurrences across all lines;AccumulatedTrajectoryproduces one adjacency vector per unit per conversation, where each successive conversation accumulates prior ones;SeparateTrajectoryproduces one adjacency vector per unit per conversation, each modeled independently- weight.by
"binary" is default, can supply a function to call (e.g. sum)
- window
MovingStanzaWindow (default) or Conversation
- window.size.back
integer, number of lines back from each line to include in the stanza window (default: 1)
- window.size.forward
integer, number of lines forward from each line to include in the stanza window (default: 0). Set to model bidirectional co-occurrence within a window.
- include.meta
logical, if TRUE (default) unit metadata is attached to the resulting ENAdata object and accessible via the set; set to FALSE to omit metadata from the model output
- groupVar
vector, character, of column name containing group identifiers. If column contains at least two unique values, will generate model using a means rotation (a dimensional reduction maximizing the variance between the means of the two groups)
- groups
vector, character, of values of groupVar column used for means rotation or statistical tests
- runTest
logical, TRUE will run a Student's t-Test and a Wilcoxon test for groups defined by the groups argument
- ...
Additional parameters passed to model generation, including
mask(an optional binary matrix of size ncol(codes) x ncol(codes) where 0 suppresses co-occurrence modeling between a pair of codes; seeena.accumulate.data)
Details
This function generates an ena.set object given a data.frame, units, conversations, and codes. After accumulating the adjacency (co-occurrence) vectors, computes a dimensional reduction (projection), and calculates node positions in the projected ENA space. Returns location of the units in the projected space, as well as locations for node positions, and normalized adjacency (co-occurrence) vectors to construct network graphs. Includes options for returning statistical tests between groups of units.
