con_levenshtein_holland: Congruence Index based on the Levenshtein distance

Description Usage Arguments Details Value References Examples

View source: R/con_levenshtein_holland.R

Description

The function computes the location-weighted, cost-sensitive (referring to the hexagon relationships) Levenshtein distance (Levenshtein, 1966) see also Needleman & Wunsch (1970).

Usage

1
con_levenshtein_holland(a, b, costs = "hexa", weights = c(1.5, 1.25, 1))

Arguments

a

a character vector with person Holland codes.

b

a character vector with environment Holland codes.

costs

character with default set to costs = "hexa" to use a matrix with replacement costs based on the RIASEC structure for the calculation of the distance.

weights

a numeric vector with length equal to a and b assigning a weight to the places (1:6) of the letter-codes defined in a and b.

Details

The function finds the distance according to Levenshtein (1966) between two sequences (see Abbott, 1995), which are the Holland codes given in argument a, which is the person code, and argument b, which is the environment code. Computational details can be found in Needleman & Wunsch, (1970).

Value

a numeric with value for congruence.

References

Holland, J.L. 1963. A theory of vocational choice. I. Vocational images and choice. Vocational Guidance Quarterly, 11(4), 232–239.

Levenshtein, V. I. (1966). Binary Codes Capable of Correcting Deletions, Insertions and Reversals. Soviet Physics Doklady, 10, 707.

Abbott, A. (1995, August). Sequence Analysis: New Methods for Old Ideas. Annual Review of Sociology, 21, 93–113.

Needleman, S. B., & Wunsch, C. D. (1970). A general method applicable to the search for similarities in the amino acid sequence of two proteins. Journal of Molecular Biology, 48(3), 443–453. http://doi.org/10.1016/0022-2836(70)90057-4

Examples

1
2
3
4
5
con_levenshtein_holland(a="RIA",b="SEC") # max. difference 
con_levenshtein_holland(a="RIA",b="RIA") # max. similarity
# with 6 characters in Holland-code
w <- c(1.5,1.25,1,0.75,0.5,0.25)
con_levenshtein_holland(a="RIASEC",b="SECRIA", weights=w) # max. difference

holland documentation built on Sept. 5, 2021, 5:08 p.m.