cstar: Compute cstar from least squares results

Description Usage Arguments Value References Examples

View source: R/ols_cstar_loss.r

Description

cstar computes the minimum actionable effect size under a kinked linear loss function with user-specified degree of risk aversion.

Usage

1
cstar(regobject, r)

Arguments

regobject

Results from a run of a linear regression model, e.g. from the lm() command.

r

The degree of loss aversion; must be a non-negative number. This parameter maps to gamma in Esarey and Danneman (2014).

Value

A vector of expected values for the utility of acting on the evidence encapsulated by the betas and standard errors of the estimated regression, given the researcher's stated level of loss aversion.

References

Esarey and Danneman (2014). A Quantitative Method for Substantive Robustness Assessment. Political Science Research and Methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# generate synthetic OLS data
x <- rnorm(50)
error <- rnorm(50)
y <- 1 + 1.5*x + error

# estimate model
OLSmodel <- lm(y~x)

# obtain expected utility of acting on validity of beta,
# conditional on a loss-aversion factor of 2
cstar(OLSmodel, 2)

# examine the sensitivity to choice of loss-aversion factor
loss_aversion_values <- c(1, 2, 3, 4)
eu <- NULL
for(i in loss_aversion_values){
  eu <- c(eu, cstar(OLSmodel, i)[2])
  }
plot(loss_aversion_values, eu)

cstar documentation built on May 1, 2019, 8:44 p.m.