Description Usage Arguments Value Note Author(s) References Examples
Calculate Somers' d for the constructs. d is an assymetric association measure as it depends on which variable is set as dependent and independent. The direction of dependency needs to be specified.
1 2 | constructD(x, dependent="c", trim=30, index=T, col.index=F, digits=1,
output=1)
|
x |
|
dependent |
A string denoting the direction of dependency in the output
table (as d is assymetrical). Possible values are |
trim |
The number of characters a construct is trimmed to (default is
|
index |
Whether to print the number of the construct
(default is |
col.index |
Logical. Wether to add an extra index column so the
column names are indexes instead of construct names. This option
renders a neater output as long construct names will stretch
the output (default is |
digits |
Numeric. Number of digits to round to (default is
|
output |
The type of output printed to the console. |
matrix
of construct correlations.
Thanks to Marc Schwartz for supplying the code to calculate Somers' d.
Mark Heckmann
Somers, R. H. (1962). A New Asymmetric Measure of Association for Ordinal Variables. American Sociological Review, 27(6), 799-811.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
constructD(fbb2003) # columns as dependent (default)
constructD(fbb2003, "c") # row as dependent
constructD(fbb2003, "s") # symmetrical index
# surpress 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)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.