Learn R Programming

DySeq (version 0.13)

StateTrans: StateTrans

Description

Produces a state transition table for dyadic binary sequences.

Usage

StateTrans(x, first = TRUE, dep.lab = c("1", "0"), indep.lab = c("1-1", "1-0", "0-1", "0-0"))

Arguments

x
Dataframe or matix containing combined sequences, see help(StateExpand)
first
logical value indicating if the first sequence should used as dependend variable (TRUE) or the second (FALSE)
dep.lab
two-element string vector with labels for dependend variable (first entry corresponds to the value zero, the second to one)
indep.lab
four-element string vector with labels for the combined variable (order corresponds to the order of the StateExpand function)

Details

That is, the behavior of interest in interval t, is mapped against the combination of the observed behaviors in the preceding interval (t - 1). Hence, the total absolute frequency equals the number of time intervals minus 1. And the number of obtained tables is equal the number of sequence-pairs.

printing the output will display mean frequencies. For inspecting individual cases use [[original-rownumber]].

For an extensive overview see Kenny, Kashy and Cook (2006). The original idea stems from (to our knowledge) Bakeman and Gottman (1997).

References

  • Bakeman, R., & Gottman, J. M. (1997)
  • Kenny, D. A., Kashy, D. A., & Cook, W. L. (2006)

Examples

Run this code

# Example 1: Sequences from couples cope

data(CouplesCope)
my.s<-StateExpand(CouplesCope, 2:49, 50:97)

# First sequence is dependend variable 
# - what behavior preceeds stress signals?
StateTrans(my.s) 

# Second sequence is dependend variable 
# - what behavior preceeds dyadic coping signals?
StateTrans(my.s, FALSE) 

# investigating a single case
StateTrans(my.s, FALSE)[[41]] 

Run the code above in your browser using DataLab