Learn R Programming

baserater (version 0.1.2)

extract_base_rate_items: Create base-rate items from groups x descriptions typicality matrix

Description

This function processes a typicality matrix to identify base-rate items by comparing typicality scores of descriptions between all unique pairs of groups.

Usage

extract_base_rate_items(typicality_matrix)

Value

A data frame with the following columns:

Group1

The group with the higher typicality score for the description.

Group2

The group with the lower typicality score.

Description

The description (e.g., adjective) being compared.

Score1

The typicality score for Group1.

Score2

The typicality score for Group2.

StereotypeStrength

The log-ratio: log(Score1 / Score2). Always >= 0.

Arguments

typicality_matrix

A numeric matrix or data frame where rows are groups and columns are descriptions. If a data frame, the first column is assumed to contain the group names.

Details

For each pair of groups and each description (e.g., adjective), it identifies which group received the higher typicality score. The output includes the names of both groups, their scores, and the log-ratio between the higher and lower score.

It can be quite slow for large matrices, as the number of items becomes very large.

By construction, the returned Group1 always has a higher or equal typicality score than Group2 for a given description. This ensures that the resulting StereotypeStrength (defined as log(Score1 / Score2)) is always positive or zero, and represents the strength of the stereotypical association in favor of Group1.

Examples

Run this code
mat <- matrix(runif(9, 1, 100), nrow = 3,
              dimnames = list(c("GroupA", "GroupB", "GroupC"),
                              c("smart", "brave", "greedy")))
extract_base_rate_items(mat)

Run the code above in your browser using DataLab