seqgroups: seqgroups

Description Usage Arguments Details Value Author(s) References Examples

Description

Computes a variety of sequential analysis statistics for data that are in segments (e.g, for multiple dyads or groups).

Usage

1
2
3
seqgroups(alldata, labels = NULL, lag = 1, adjacent = TRUE,
          onezero = NULL, tailed = 2, test = "homogeneity", 
          output = "all")

Arguments

alldata

A one-column dataframe, or a vector of code sequences, which can be numeric or strings. Missing values are not permitted.

If alldata is numeric, then the integers must range from "1" to the total number of possible code values (which is not the total number of codes in a sequence), and a number greater than 999 must be used in alldata to separate the codes sequences for different groups/dyads. See "data_seqgroups" for an example.

If alldata consists of strings/characters, then the word "segment" must be used in alldata to separate the code sequences for different groups/dyads. See "data_seqgroups" for an example.

labels

Optional argument for providing labels to the code values. Accepts a list of string variables. If unspecified, codes will be labeled "Code1", "Code2", etc.

lag

The lag number for the analyses.

adjacent

Can adjacent values be coded the same? Enter "FALSE" if adjacent events can never be the same. Enter "TRUE" if adjacent events can always be the same. Enter "TRUE" if some adjacent events can, and others cannot, be the same; then enter the appropriate onezero matrix for your data.

onezero

Optional argument for specifying the one-zero matrix for the data. Useful when some adjacent events can, and others cannot, be the same. Accepts a square matrix of ones and zeros with length ncodes. A "1" indicates that the expected frequency for a given cell is to be estimated, whereas a "0" indicates that the expected frequency for the cell should NOT be estimated, typically because it is a structural zero (codes that cannot follow one another). By default, the matrix that is created by the above commands has zeros along the main diagonal, and ones everywhere else, which will be appropriate for most data sets. However, if your data happen to involve structural zeros that occur in cells other than the cells along the main diagonal, then you must create a onezero matrix with ones and zeros that is appropriate for your data.

tailed

Specify whether significance tests are one-tailed or two-tailed. Options are "1" or "2".

test

Specify whether to run tests for homogeneity of homogeneity or stationarity. Homogeneity should be tested when groups in the data are actually different groups, whereas stationarity should be tested when groups in the data are segments of a single stream of observations. Options are "homogeneity" or "stationarity".

output

Specify the desired output. Options are "pooled" for pooled data only, or "all" for all data sets.

Details

Computes a variety of sequential analysis statistics for data that are in segments (e.g, for multiple dyads or groups. This is the same as the "sequential" function provided in this package, but allows for the data to be segmented. Sequential statistics are calculated for each segment, as well as for the data pooled across all segments.

Value

For each of the groups or segments and for the pooled data, displays the transitional frequency matrix, expected frequencies, transitional probabilities, adjusted residuals and significance levels, Yule's Q values, transformed Kappas (Wampold, 1989, 1992, 1995), z values for the kappas, and significance levels.

Returns a list with the following elements:

freqs

The transitional frequency matrix

expfreqs

The expected frequencies

probs

The transitional probabilities

chi

The overall chi-square test of the difference between the observed and expected transitional frequencies

adjres

The adjusted residuals

p

The statistical significance levels

YulesQ

Yule's Q values, indicating the strength of the relationships between the antecedent and the consequence transitions

kappas

The nonparallel dominance kappas

z

The z values for the kappas

pk

The p-values for the kappas

output

The requested output data

Author(s)

Zakary A. Draper & Brian P. O'Connor

References

O'Connor, B. P. (1999). Simple and flexible SAS and SPSS programs for analyzing lag-sequential categorical data. Behavior Research Methods, Instrumentation, and Computers, 31, 718-726.

Wampold, B. E. (1989). Kappa as a measure of pattern in sequential data. Quality & Quantity, 23, 171-187.

Wampold, B. E. (1992). The intensive examination of social interactions. In T. Kratochwill & J. Levin (Eds.), Single-case research design and analysis: New directions for psychology and education (pp. 93-131). Hillsdale, NJ: Erlbaum.

Wampold, B. E. (1995). Analysis of behavior sequences in psychotherapy. In J. Siegfried (Ed.), Therapeutic and everyday discourse as behavior change: Towards a micro-analysis in psychotherapy process research (pp. 189-214). Norwood, NJ: Ablex.

Examples

1

Example output

Lag Sequential Analysis of data that are in segments (e.g, for multiple dyads or groups


Requested 'tail' (1 or 2) for Significance Tests = 2 



Group/Segment Number: 1 

Cell Frequencies, Row & Column Totals, & N

       LAC RAC RDO LUP LDO RUP Totals
LAC     11  28   6   1   2   3     51
RAC     25   7   3   3   1   1     40
RDO      9   1   4   1   2   0     17
LUP      1   2   2   1   0   3      9
LDO      2   1   2   0   0   0      5
RUP      3   1   0   3   0   1      8
Totals  51  40  17   9   5   8    130


Expected Values/Frequencies

      LAC   RAC  RDO  LUP  LDO  RUP
LAC 20.01 15.69 6.67 3.53 1.96 3.14
RAC 15.69 12.31 5.23 2.77 1.54 2.46
RDO  6.67  5.23 2.22 1.18 0.65 1.05
LUP  3.53  2.77 1.18 0.62 0.35 0.55
LDO  1.96  1.54 0.65 0.35 0.19 0.31
RUP  3.14  2.46 1.05 0.55 0.31 0.49


Transitional Probabilities

     LAC  RAC  RDO  LUP  LDO  RUP
LAC 0.22 0.55 0.12 0.02 0.04 0.06
RAC 0.62 0.17 0.07 0.07 0.03 0.03
RDO 0.53 0.06 0.24 0.06 0.12 0.00
LUP 0.11 0.22 0.22 0.11 0.00 0.33
LDO 0.40 0.20 0.40 0.00 0.00 0.00
RUP 0.38 0.12 0.00 0.38 0.00 0.12


Tablewise Likelihood Ratio (Chi-Square) test = 58.63,  df = 25,  p = 0.00016


Adjusted Residuals

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -3.31  4.79 -0.36 -1.79  0.04 -0.10
RAC  3.62 -2.19 -1.26  0.17 -0.53 -1.16
RDO  1.24 -2.38  1.37 -0.18  1.82 -1.13
LUP -1.79 -0.58  0.84  0.51 -0.62  3.52
LDO  0.04 -0.53  1.82 -0.62 -0.46 -0.58
RUP -0.10 -1.16 -1.13  3.52 -0.58  0.77


Significance Levels for the Adjusted Residuals

       LAC    RAC    RDO    LUP    LDO    RUP
LAC 0.0009 0.0000 0.7214 0.0733 0.9713 0.9176
RAC 0.0003 0.0289 0.2086 0.8628 0.5947 0.2478
RDO 0.2143 0.0171 0.1704 0.8561 0.0686 0.2574
LUP 0.0733 0.5647 0.3990 0.6079 0.5340 0.0004
LDO 0.9713 0.5947 0.0686 0.5340 0.6483 0.5593
RUP 0.9176 0.2478 0.2574 0.0004 0.5593 0.4407


Yule's Q Values

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -0.58  0.74 -0.10 -0.70  0.02 -0.04
RAC  0.61 -0.46 -0.39  0.06 -0.29 -0.53
RDO  0.31 -0.79  0.41 -0.10  0.66 -1.00
LUP -0.70 -0.23  0.34  0.28 -1.00  0.84
LDO  0.02 -0.29  0.66 -1.00 -1.00 -1.00
RUP -0.04 -0.53 -1.00  0.84 -1.00  0.40


Unidirectional Kappas

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -0.47  0.50 -0.11 -0.72  0.01 -0.06
RAC  0.38 -0.43 -0.42  0.04 -0.35 -0.59
RDO  0.22 -0.81  0.12 -0.14  0.31 -1.00
LUP -0.72 -0.27  0.11  0.05 -1.00  0.33
LDO  0.01 -0.35  0.31 -1.00 -1.00 -1.00
RUP -0.06 -0.59 -1.00  0.33 -1.00  0.07


z values for the Unidirectional Kappas

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -3.51  4.68 -0.40 -1.81  0.01 -0.13
RAC  3.52 -2.14 -1.23  0.19 -0.52 -1.14
RDO  1.19 -2.36  1.38 -0.17  1.83 -1.12
LUP -1.81 -0.56  0.85  0.52 -0.62  3.52
LDO  0.01 -0.52  1.83 -0.62 -0.45 -0.58
RUP -0.13 -1.14 -1.12  3.52 -0.58  0.78


Significance Levels for the Unidirectional Kappas

       LAC    RAC    RDO    LUP    LDO    RUP
LAC 0.0005 0.0000 0.6921 0.0704 0.9887 0.8962
RAC 0.0004 0.0324 0.2179 0.8507 0.6034 0.2549
RDO 0.2332 0.0184 0.1668 0.8635 0.0678 0.2615
LUP 0.0704 0.5762 0.3942 0.6036 0.5373 0.0004
LDO 0.9887 0.6034 0.0678 0.5373 0.6509 0.5624
RUP 0.8962 0.2549 0.2615 0.0004 0.5624 0.4375



Group/Segment Number: 2 

Cell Frequencies, Row & Column Totals, & N

       LAC RAC RDO LUP LDO RUP Totals
LAC      5  24   6   2   1   1     39
RAC     23  14   6   1   4   0     48
RDO      9   4   2   0   2   0     17
LUP      0   2   0   1   0   6      9
LDO      2   3   3   0   0   0      8
RUP      0   1   0   5   1   2      9
Totals  39  48  17   9   8   9    130


Expected Values/Frequencies

     LAC   RAC  RDO  LUP  LDO  RUP
LAC 11.7 14.40 5.10 2.70 2.40 2.70
RAC 14.4 17.72 6.28 3.32 2.95 3.32
RDO  5.1  6.28 2.22 1.18 1.05 1.18
LUP  2.7  3.32 1.18 0.62 0.55 0.62
LDO  2.4  2.95 1.05 0.55 0.49 0.55
RUP  2.7  3.32 1.18 0.62 0.55 0.62


Transitional Probabilities

     LAC  RAC  RDO  LUP  LDO  RUP
LAC 0.13 0.62 0.15 0.05 0.03 0.03
RAC 0.48 0.29 0.12 0.02 0.08 0.00
RDO 0.53 0.24 0.12 0.00 0.12 0.00
LUP 0.00 0.22 0.00 0.11 0.00 0.67
LDO 0.25 0.38 0.38 0.00 0.00 0.00
RUP 0.00 0.11 0.00 0.56 0.11 0.22


Tablewise Likelihood Ratio (Chi-Square) test = 92.29,  df = 25,  p = 0


Adjusted Residuals

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -2.80  3.81  0.51 -0.53 -1.11 -1.28
RAC  3.41 -1.40 -0.15 -1.66  0.79 -2.38
RDO  2.21 -1.23 -0.17 -1.21  1.03 -1.21
LUP -2.04 -0.95 -1.21  0.51 -0.80  7.32
LDO -0.32  0.03  2.12 -0.80 -0.75 -0.80
RUP -2.04 -1.66 -1.21  5.96  0.64  1.87


Significance Levels for the Adjusted Residuals

       LAC    RAC    RDO    LUP    LDO    RUP
LAC 0.0051 0.0001 0.6094 0.5977 0.2649 0.1999
RAC 0.0006 0.1609 0.8813 0.0963 0.4289 0.0174
RDO 0.0268 0.2197 0.8633 0.2278 0.3018 0.2278
LUP 0.0418 0.3435 0.2278 0.6079 0.4259 0.0000
LDO 0.7501 0.9722 0.0344 0.4259 0.4547 0.4259
RUP 0.0418 0.0963 0.2278 0.0000 0.5212 0.0609


Yule's Q Values

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -0.60  0.63  0.14 -0.21 -0.52 -0.57
RAC  0.58 -0.26 -0.04 -0.67  0.28 -1.00
RDO  0.51 -0.35 -0.07 -1.00  0.41 -1.00
LUP -1.00 -0.36 -1.00  0.28 -1.00  0.97
LDO -0.13  0.01  0.64 -1.00 -1.00 -1.00
RUP -1.00 -0.67 -1.00  0.95  0.34  0.65


Unidirectional Kappas

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -0.57  0.39  0.08 -0.25 -0.58 -0.63
RAC  0.34 -0.24 -0.06 -0.70  0.20 -1.00
RDO  0.33 -0.37 -0.09 -1.00  0.14 -1.00
LUP -1.00 -0.41 -1.00  0.05 -1.00  0.64
LDO -0.16  0.00  0.28 -1.00 -1.00 -1.00
RUP -1.00 -0.70 -1.00  0.52  0.06  0.16


z values for the Unidirectional Kappas

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -2.75  3.70  0.53 -0.51 -1.10 -1.26
RAC  3.31 -1.61 -0.19 -1.68  0.76 -2.39
RDO  2.23 -1.26 -0.16 -1.20  1.04 -1.20
LUP -2.02 -0.97 -1.20  0.52 -0.79  7.32
LDO -0.30  0.01  2.12 -0.79 -0.74 -0.79
RUP -2.02 -1.68 -1.20  5.96  0.65  1.88


Significance Levels for the Unidirectional Kappas

       LAC    RAC    RDO    LUP    LDO    RUP
LAC 0.0059 0.0002 0.5948 0.6092 0.2721 0.2063
RAC 0.0009 0.1076 0.8477 0.0924 0.4491 0.0167
RDO 0.0257 0.2068 0.8738 0.2317 0.2982 0.2317
LUP 0.0438 0.3312 0.2317 0.6036 0.4297 0.0000
LDO 0.7616 0.9954 0.0338 0.4297 0.4583 0.4297
RUP 0.0438 0.0924 0.2317 0.0000 0.5175 0.0602



Group/Segment Number: 3 

Cell Frequencies, Row & Column Totals, & N

       LAC RAC RDO LUP LDO RUP Totals
LAC     12  10   2   2   0   6     32
RAC      9   5   0   4   3   2     23
RDO      1   0   0   1   1   0      3
LUP      3   5   0  10   1  11     30
LDO      0   2   1   0   0   7     10
RUP      7   0   0  13   5   7     32
Totals  32  22   3  30  10  33    130


Expected Values/Frequencies

     LAC  RAC  RDO  LUP  LDO  RUP
LAC 7.88 5.42 0.74 7.38 2.46 8.12
RAC 5.66 3.89 0.53 5.31 1.77 5.84
RDO 0.74 0.51 0.07 0.69 0.23 0.76
LUP 7.38 5.08 0.69 6.92 2.31 7.62
LDO 2.46 1.69 0.23 2.31 0.77 2.54
RUP 7.88 5.42 0.74 7.38 2.46 8.12


Transitional Probabilities

     LAC  RAC  RDO  LUP  LDO  RUP
LAC 0.38 0.31 0.06 0.06 0.00 0.19
RAC 0.39 0.22 0.00 0.17 0.13 0.09
RDO 0.33 0.00 0.00 0.33 0.33 0.00
LUP 0.10 0.17 0.00 0.33 0.03 0.37
LDO 0.00 0.20 0.10 0.00 0.00 0.70
RUP 0.22 0.00 0.00 0.41 0.16 0.22


Tablewise Likelihood Ratio (Chi-Square) test = 73.31,  df = 25,  p = 0


Adjusted Residuals

      LAC   RAC   RDO   LUP   LDO   RUP
LAC  1.95  2.49  1.71 -2.60 -1.88 -0.99
RAC  1.78  0.68 -0.81 -0.71  1.06 -2.03
RDO  0.35 -0.79 -0.27  0.43  1.69 -1.02
LUP -2.12 -0.04 -0.96  1.52 -1.02  1.62
LDO -1.88  0.27  1.69 -1.80 -0.95  3.37
RUP -0.41 -2.94 -1.00  2.71  1.94 -0.53


Significance Levels for the Adjusted Residuals

       LAC    RAC    RDO    LUP    LDO    RUP
LAC 0.0513 0.0128 0.0871 0.0093 0.0600 0.3206
RAC 0.0749 0.4972 0.4165 0.4756 0.2884 0.0427
RDO 0.7229 0.4290 0.7877 0.6697 0.0918 0.3067
LUP 0.0341 0.9659 0.3371 0.1285 0.3070 0.1055
LDO 0.0600 0.7871 0.0918 0.0714 0.3420 0.0007
RUP 0.6785 0.0033 0.3167 0.0067 0.0524 0.5993


Yule's Q Values

      LAC   RAC   RDO   LUP   LDO   RUP
LAC  0.40  0.53  0.73 -0.71 -1.00 -0.24
RAC  0.40  0.19 -1.00 -0.21  0.36 -0.62
RDO  0.22 -1.00 -1.00  0.26  0.74 -1.00
LUP -0.57 -0.01 -1.00  0.33 -0.48  0.34
LDO -1.00  0.11  0.74 -1.00 -1.00  0.79
RUP -0.10 -1.00 -1.00  0.53  0.55 -0.13


Unidirectional Kappas

      LAC   RAC   RDO   LUP   LDO   RUP
LAC  0.17  0.25  0.56 -0.73 -1.00 -0.26
RAC  0.19  0.05 -1.00 -0.24  0.15 -0.65
RDO  0.12 -1.00 -1.00  0.14  0.28 -1.00
LUP -0.59 -0.05 -1.00  0.14 -0.56  0.15
LDO -1.00  0.03  0.28 -1.00 -1.00  0.60
RUP -0.13 -1.00 -1.00  0.24  0.33 -0.16


z values for the Unidirectional Kappas

      LAC   RAC   RDO   LUP   LDO   RUP
LAC  1.97  2.33  1.72 -2.57 -1.86 -0.96
RAC  1.80  0.58 -0.81 -0.69  1.07 -2.00
RDO  0.36 -0.81 -0.27  0.43  1.69 -1.01
LUP -2.09 -0.15 -0.95  1.54 -1.01  1.64
LDO -1.86  0.21  1.69 -1.79 -0.94  3.38
RUP -0.50 -3.05 -1.01  2.60  1.87 -0.61


Significance Levels for the Unidirectional Kappas

       LAC    RAC    RDO    LUP    LDO    RUP
LAC 0.0486 0.0196 0.0862 0.0102 0.0624 0.3362
RAC 0.0718 0.5630 0.4205 0.4903 0.2837 0.0456
RDO 0.7175 0.4205 0.7893 0.6647 0.0911 0.3111
LUP 0.0369 0.8843 0.3414 0.1229 0.3143 0.1004
LDO 0.0624 0.8333 0.0911 0.0740 0.3460 0.0007
RUP 0.6205 0.0023 0.3111 0.0094 0.0610 0.5442



Pooled Data:


Number of cases/groups/segments: 3 


Likelihood Ratio (Chi-Square) Test of Homogeneity/Stationarity = 91.68,  df = 60,  p = 0.00527


Cell Frequencies, Row & Column Totals, & N

       LAC RAC RDO LUP LDO RUP Totals
LAC     28  62  14   5   3  10    122
RAC     57  26   9   8   8   3    111
RDO     19   5   6   2   5   0     37
LUP      4   9   2  12   1  20     48
LDO      4   6   6   0   0   7     23
RUP     10   2   0  21   6  10     49
Totals 122 110  37  48  23  50    390


Expected Values/Frequencies

      LAC   RAC   RDO   LUP  LDO   RUP
LAC 38.16 34.41 11.57 15.02 7.19 15.64
RAC 34.72 31.31 10.53 13.66 6.55 14.23
RDO 11.57 10.44  3.51  4.55 2.18  4.74
LUP 15.02 13.54  4.55  5.91 2.83  6.15
LDO  7.19  6.49  2.18  2.83 1.36  2.95
RUP 15.33 13.82  4.65  6.03 2.89  6.28


Transitional Probabilities

     LAC  RAC  RDO  LUP  LDO  RUP
LAC 0.23 0.51 0.11 0.04 0.02 0.08
RAC 0.51 0.23 0.08 0.07 0.07 0.03
RDO 0.51 0.14 0.16 0.05 0.14 0.00
LUP 0.08 0.19 0.04 0.25 0.02 0.42
LDO 0.17 0.26 0.26 0.00 0.00 0.30
RUP 0.20 0.04 0.00 0.43 0.12 0.20


Tablewise Likelihood Ratio (Chi-Square) test = 201.68,  df = 25,  p = 0


Adjusted Residuals

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -2.39  6.70  0.90 -3.33 -1.94 -1.84
RAC  5.39 -1.32 -0.59 -1.93  0.69 -3.77
RDO  2.77 -2.09  1.47 -1.34  2.07 -2.45
LUP -3.66 -1.55 -1.34  2.86 -1.20  6.38
LDO -1.48 -0.23  2.80 -1.85 -1.24  2.60
RUP -1.76 -4.01 -2.42  6.96  2.02  1.70


Significance Levels for the Adjusted Residuals

       LAC    RAC    RDO    LUP    LDO    RUP
LAC 0.0167 0.0000 0.3660 0.0009 0.0518 0.0654
RAC 0.0000 0.1856 0.5577 0.0531 0.4886 0.0002
RDO 0.0056 0.0369 0.1421 0.1792 0.0387 0.0142
LUP 0.0003 0.1201 0.1792 0.0043 0.2310 0.0000
LDO 0.1386 0.8160 0.0051 0.0640 0.2158 0.0092
RUP 0.0791 0.0001 0.0154 0.0000 0.0437 0.0893


Yule's Q Values

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -0.29  0.65  0.16 -0.63 -0.52 -0.33
RAC  0.55 -0.17 -0.12 -0.37  0.16 -0.76
RDO  0.44 -0.46  0.34 -0.45  0.49 -1.00
LUP -0.71 -0.29 -0.45  0.48 -0.53  0.76
LDO -0.38 -0.06  0.59 -1.00 -1.00  0.53
RUP -0.31 -0.83 -1.00  0.79  0.45  0.32


Unidirectional Kappas

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -0.26  0.36  0.10 -0.67 -0.58 -0.36
RAC  0.29 -0.17 -0.14 -0.41  0.09 -0.79
RDO  0.29 -0.52  0.07 -0.56  0.14 -1.00
LUP -0.73 -0.34 -0.56  0.15 -0.65  0.33
LDO -0.44 -0.08  0.18 -1.00 -1.00  0.20
RUP -0.36 -0.86 -1.00  0.36  0.15  0.08


z values for the Unidirectional Kappas

      LAC   RAC   RDO   LUP   LDO   RUP
LAC -2.37  6.62  0.91 -3.31 -1.93 -1.83
RAC  5.41 -1.37 -0.58 -1.92  0.70 -3.75
RDO  2.78 -2.11  1.47 -1.34  2.07 -2.44
LUP -3.65 -1.58 -1.34  2.86 -1.19  6.39
LDO -1.47 -0.25  2.80 -1.85 -1.23  2.61
RUP -1.83 -4.09 -2.44  6.85  1.97  1.63


Significance Levels for the Unidirectional Kappas

       LAC    RAC    RDO    LUP    LDO    RUP
LAC 0.0179 0.0000 0.3605 0.0009 0.0530 0.0675
RAC 0.0000 0.1709 0.5649 0.0548 0.4839 0.0002
RDO 0.0055 0.0352 0.1407 0.1813 0.0384 0.0145
LUP 0.0003 0.1143 0.1813 0.0042 0.2329 0.0000
LDO 0.1411 0.8010 0.0050 0.0648 0.2171 0.0091
RUP 0.0675 0.0000 0.0145 0.0000 0.0493 0.1024

LagSequential documentation built on May 16, 2019, 5:09 p.m.