calc_rp: Helper function that calculates risk preferences from...

Description Usage Arguments Value Examples

View source: R/calc_rp.R

Description

Helper function that calculates risk preferences from individuals observed lottery choice.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
calc_rp(
  utility_function,
  lottery_choice,
  lottery_probs_1,
  lottery_probs_2,
  lottery_payoffs_1,
  lottery_payoffs_2,
  rp_ub,
  rp_lb,
  rp_resolution,
  initial_wealth
)

Arguments

utility_function

a character vector representing the utility function to use for deriving the risk preferences. The only current option is "crra".

lottery_choice

a numeric value representing the observed lottery choice of the survey respondent

lottery_probs_1

a numerical vector representing the probabilities of the first outcome occurring in each lottery

lottery_probs_2

a numerical vector representing the probabilities of the second outcome occurring in each lottery

lottery_payoffs_1

a numerical vector representing the payoffs if the first outcome occurs in each lottery

lottery_payoffs_2

a numerical vector representing the payoffs if the second outcome occurs in each lottery

rp_ub

a numerical value representing the lower bound to consider for the risk preference coefficient.

rp_lb

a numerical value representing the upper bound to consider for the risk preference coefficient.

rp_resolution

a numeric value representing the resolution to use for identifying risk preferences. For example, a value of .01, will search the risk preference parameter space in 0.01 increments. This value can be adjusted to speed up computation if fine resolution is not required.#'

initial_wealth

a numerical value representing the initial wealth to use for each respondent

Value

returns adjusted risk preferences

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
calc_rp(utility_function = "crra",
       lottery_choice = 1,
       lottery_probs_1 = c(1,.5,.225,.125,.025),
       lottery_probs_2 = c(0,.5,.775,.875,.975),
       lottery_payoffs_1 = c(5,8,22,60,300),
       lottery_payoffs_2 = c(0,3,2,0,0),
       rp_ub = 2,
       rp_lb = -2,
       initial_wealth = .00000000000000001,
       rp_resolution = .05)
      

dylan-turner25/RPadjust documentation built on Dec. 20, 2021, 2:17 a.m.