knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Warmth and competence are the two main dimensions of social perception and judgment (Cuddy, Fiske & Glick, 2008). When individuals introduce or describe themselves, their audiences automatically make judgments about their warmth and competence. In this package, we provide tools that estimate warmth and competence social perceptions from natural self-presentational language. We use pre-trained enet regression models to provide numerical representations of warmth and competence perceptions.
This package has yet to be submitted to the Comprehensive R Archive Network (Hornik, 2021), so it is currently only available through Github. To install the package, use the following code in your R session:
devtools::install_github("bushraguenoun/warmthcompetence")
library("warmthcompetence") spacyr::spacy_initialize()
Note that some features depend spacyr which must be installed separately through Python. To install spacyr, follow the instructions here: https://www.rdocumentation.org/packages/spacyr/versions/1.2.1
This package contains two main functions: warmth and competence. These functions can be used as described below:
competence_scores <- competence(text_vector, ID_vector, metrics = "scores") warmth_scores <- warmth(text_vector, ID_vector, metrics = "scores")
In the code above, text_vector
is the vector of texts that will be assessed for warmth or competence. ID_vector
is a vector of IDs that will be used to identify the warmth or competence scores. The metrics argument allows users to decide what metrics to return. Users can return the warmth or competence scores (metrics = "scores"
), the features that underlie the warmth or competence scores (metrics = "features"
), or both the warmth or competence scores and the features (metrics = "all"
). The default choice is to return the warmth or competence scores.
We ran a study in which 393 participants were randomly assigned to either the warmth or competence condition and asked to write a short introduction of themselves that presented them as a [warm/competent] person. Then, we had three independent judges blind to participant condition rate each of the introductions for warmth and competence on a scale of 1 to 10.
The study data can be accessed by calling "vignette_data". This command will return a dataframe with all of the data collected from the study. The columns of this dataframe are the following: 1) bio: This column contains the participant introductions. 2) ResponseId: This column contains participant identifiers. 3) condition: This column contains participant condition in the study (warmth versus competence). 4) RA_warm_AVG: Three independent judges rated their perceptions of warmth for each participant introduction on a scale of 1 (extremely low warmth) to 10 (extremely high warmth). This column is the average across all three independent judges (α = 0.76). The individual RA ratings are in the following columns: warm_1, warm_2, and warm_3. 5) RA_comp_AVG: Three independent judges rated their perceptions of competence for each participant introduction on a scale of 1 (extremely low competence) to 10 (extremely high competence). This column is the average across all three independent judges (α = 0.79). The individual RA ratings are in the following columns: comp_1, comp_2, and comp_3.
Can our warmth model predict the average warmth ratings of the independent judges?
First we run the functions on the study data.
data("vignette_data") competence_scores <- competence(vignette_data$bio, vignette_data$ResponseId) warmth_scores <- warmth(vignette_data$bio, vignette_data$ResponseId) both_scores <- dplyr::inner_join(competence_scores, warmth_scores, by = c("ID" = "ID")) all_data <- dplyr::left_join(vignette_data, both_scores, by = c("ResponseId" = "ID"))
Then, we explore whether the warmth model predicts the warmth ratings of the independent judges.
warmth_model <- lm(RA_warm_AVG ~ warmth_predictions , data = all_data) summary(warmth_model)
As can be seen above, the predictions of the warmth model positively predict the independent judges' ratings.
Can our competence model predict the average competence ratings of the independent judges?
competence_model <- lm(RA_comp_AVG ~ competence_predictions , data = all_data) summary(competence_model)
As can be seen above, the predictions of the warmth model positively predict the independent judges' ratings.
Are model predictions of competence higher for the participants asked to present themselves as a competent person compared to a warm person?
t.test(competence_predictions ~ condition, data = all_data)
As can be seen above, the model significantly predicted that participants in the competence condition expressed more competence compared to those in the warmth condition.
Now, are model predictions of warmth higher for the participants asked to present themselves as a warm person compared to a competent person?
t.test(warmth_predictions ~ condition, data = all_data)
As can be seen above, the model significantly predicted that participants in the warmth condition expressed more warmth compared to those in the competence condition.
In this example, our pre-trained enet regression models predicted the ratings of independent human judges and participant judges. Feel free to use these models on your own data and reach out with any comments, questions, or concerns!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.