This function calculates the element-wise/decomposed deflection for an Actor, Behavior, Object event.

element_deflection(
  d,
  equation_key = NULL,
  equation_gender = NULL,
  eq_df = NULL,
  ...
)

Arguments

d

data that has been reshaped by the events_df

equation_key

is a string that corresponds to an equation key from actdata from actdata

equation_gender

is a string that corresponds to the gender for the equation

eq_df

is an optional parameter if you are using your own equation dataframe

Value

dataframe in long format, with one row for each element-dimension of the event, columns for fundamental sentiment and transient impression, the difference between the fundamental sentiment and the transient impression (difference) and the squared difference, the element's contribution to deflection.

Examples


d <- tibble::tibble(actor = "ceo", behavior = "advise", object = "benefactor")
d <- reshape_events_df(df = d, df_format = "wide",
dictionary_key = "usfullsurveyor2015", dictionary_gender = "average")
#> Joining, by = c("term", "component")
element_deflection(d = d, equation_key = "us2010", equation_gender = "average")
#> Adding missing grouping variables: `event_id`
#> # A tibble: 9 × 9
#>   event_id element  term       component dimen…¹ estim…² trans…³ diffe…⁴ sqd_d…⁵
#>      <int> <chr>    <chr>      <chr>     <chr>     <dbl>   <dbl>   <dbl>   <dbl>
#> 1        1 actor    ceo        identity  E          0.71   1.92    1.21   1.46  
#> 2        1 actor    ceo        identity  P          3.22   2.05   -1.17   1.37  
#> 3        1 actor    ceo        identity  A          1.48   0.387  -1.09   1.20  
#> 4        1 behavior advise     behavior  E          2.57   1.80   -0.768  0.590 
#> 5        1 behavior advise     behavior  P          2.28   2.72    0.436  0.190 
#> 6        1 behavior advise     behavior  A          0.28   0.387   0.107  0.0115
#> 7        1 object   benefactor identity  E          1.97   2.46    0.486  0.236 
#> 8        1 object   benefactor identity  P          1.98   0.860  -1.12   1.25  
#> 9        1 object   benefactor identity  A          0.1    0.899   0.799  0.639 
#> # … with abbreviated variable names ¹​dimension, ²​estimate, ³​trans_imp,
#> #   ⁴​difference, ⁵​sqd_diff