Learn R Programming

OpenRepGrid (version 0.1.16)

constructD: Calculate Somers' d for the constructs.

Description

Somer's d is an asymmetric association measure as it depends on which variable is set as dependent and independent. The direction of dependency needs to be specified.

Usage

constructD(x, dependent = "columns", trim = 30, index = TRUE)

Value

matrix of construct correlations.

Arguments

x

repgrid object.

dependent

A string denoting the direction of dependency in the output table (as d is asymmetrical). Possible values are "columns" (the default) for setting the columns as dependent, "rows" for setting the rows as the dependent variable and "symmetric" for the symmetrical Somers' d measure (the mean of the two directional values for "columns" and "rows").

trim

The number of characters a construct is trimmed to (default is 30). If NA no trimming occurs. Trimming simply saves space when displaying correlation of constructs with long names.

index

Whether to print the number of the construct (default is TRUE).

References

Somers, R. H. (1962). A New Asymmetric Measure of Association for Ordinal Variables. American Sociological Review, 27(6), 799-811.

Examples

Run this code
if (FALSE) {

constructD(fbb2003) # columns as dependent (default)
constructD(fbb2003, "c") # row as dependent
constructD(fbb2003, "s") # symmetrical index

# suppress printing
d <- constructD(fbb2003, out = 0, trim = 5)
d

# more digits
constructD(fbb2003, dig = 3)

# add index column, no trimming
constructD(fbb2003, col.index = TRUE, index = F, trim = NA)
}

Run the code above in your browser using DataLab