cstar {cstar} | R Documentation |
cstar computes the minimum actionable effect size under a kinked linear loss function with user-specified degree of risk aversion.
cstar(regobject, r)
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). |
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.
Esarey and Danneman (2014). A Quantitative Method for Substantive Robustness Assessment. Political Science Research and Methods.
# 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)