**Generate EV forvalues i=1/20{ gen EV_Conf_`i'=ce`i' /10 } **PT Conf_MLE forvalues i=1/20{ gen PT_Conf_MLE_`i'=. replace PT_Conf_MLE_`i'= 1/ ( (beta_mle/(ce`i'/10)^(alpha_mle) - beta_mle)^(1/gamma_mle) + 1) } **EU Conf_MLE forvalues i=1/20{ gen EU_Conf_MLE_`i'=. replace EU_Conf_MLE_`i' = (ce`i'/10)^(r_mle) if r_mle>0 } *analysis of parameters gen alpha_t = abs((alpha_mle-1)/alpha_mle_se) //absolute value of the t-value for alpha gen beta_t = abs((beta_mle -1) / beta_mle_se) // absolute value of the tvalue for beta gen gamma_t = abs((gamma_mle -1) / gamma_mle_se) // absolute value of the tvalue for gamma gen alpha1 = 0 //takes the value 1 if cannot reject H0:alpha=1, 0 otherwise gen beta1=0 gen gamma1=0 replace alpha1= 1 if alpha_t<2 replace beta1= 1 if beta_t<2 replace gamma1=1 if gamma_t<2 gen riskneutral =0 gen linearprob = 0 replace linear=1 if alpha1==1 & gamma1==1 & beta1==1 replace linearprob = 1 if beta1==1 &gamma1==1 **averaging without misleading questions egen ave_suc= rowmean(suc1 suc2 suc3 suc4 suc5 suc6 suc7 suc8 suc9 suc10 suc13 suc14 suc15 suc16 suc19 suc20) egen ave_rep_conf = rowmean( conf_1 conf_2 conf_3 conf_4 conf_5 conf_6 conf_7 conf_8 conf_9 conf_10 conf_13 conf_14 conf_15 conf_16 conf_19 conf_20) egen ave_pt_mle_conf = rowmean( PT_Conf_MLE_1 PT_Conf_MLE_2 PT_Conf_MLE_3 PT_Conf_MLE_4 PT_Conf_MLE_5 PT_Conf_MLE_6 PT_Conf_MLE_7 PT_Conf_MLE_8 PT_Conf_MLE_9 PT_Conf_MLE_10 PT_Conf_MLE_13 PT_Conf_MLE_14 PT_Conf_MLE_15 PT_Conf_MLE_16 PT_Conf_MLE_19 PT_Conf_MLE_20) egen ave_eu_mle_conf = rowmean( EU_Conf_MLE_1 EU_Conf_MLE_2 EU_Conf_MLE_3 EU_Conf_MLE_4 EU_Conf_MLE_5 EU_Conf_MLE_6 EU_Conf_MLE_7 EU_Conf_MLE_8 EU_Conf_MLE_9 EU_Conf_MLE_10 EU_Conf_MLE_13 EU_Conf_MLE_14 EU_Conf_MLE_15 EU_Conf_MLE_16 EU_Conf_MLE_19 EU_Conf_MLE_20) egen ave_ev_conf = rowmean( EV_Conf_1 EV_Conf_2 EV_Conf_3 EV_Conf_4 EV_Conf_5 EV_Conf_6 EV_Conf_7 EV_Conf_8 EV_Conf_9 EV_Conf_10 EV_Conf_13 EV_Conf_14 EV_Conf_15 EV_Conf_16 EV_Conf_19 EV_Conf_20) *egen ave_pt_nl_conf = rowmean( PT_Conf_NL_1 PT_Conf_NL_2 PT_Conf_NL_3 PT_Conf_NL_4 PT_Conf_NL_5 PT_Conf_NL_6 PT_Conf_NL_7 PT_Conf_NL_8 PT_Conf_NL_9 PT_Conf_NL_10 PT_Conf_NL_13 PT_Conf_NL_14 PT_Conf_NL_15 PT_Conf_NL_16 PT_Conf_NL_19 PT_Conf_NL_20) //ambiguity measure gen ambg_averse = 0 replace ambg_averse =1 if amb_opt_2 ==1 & amb_opt_4==4 gen ambg_seeking =0 replace ambg_seeking =1 if amb_opt_2 ==2 & amb_opt_4==3 *Individual regression *Model 1 reg ave_suc ave_rep_conf, robust reg ave_suc ave_ev_conf , robust reg ave_suc ave_eu_mle_conf , robust reg ave_suc ave_pt_mle_conf , robust *Model 2 reg ave_suc ave_rep_conf female age lot_score sss_score, robust reg ave_suc ave_ev_conf female age lot_score sss_score, robust reg ave_suc ave_eu_mle_conf female age lot_score sss_score , robust reg ave_suc ave_pt_mle_conf female age lot_score sss_score , robust * Graphs graph twoway (lfit ave_rep_conf ave_suc) (scatter ave_rep_conf ave_suc ), ytitle(Average Reported Confidence Rate) xtitle(Average Success Rate) title("Individual Success Rates and Reported Confidence") note("controlling for misleading quesions: 4 questions removed") graph twoway (lfit ave_pt_mle_conf ave_suc) (scatter ave_pt_mle_conf ave_suc), ytitle(Average Inferred Confidence under PT) xtitle(Average Success Rate) title("Individual Success Rates and InfConf under PT") note("controlling for misleading quesions: 4 questions removed") graph twoway (lfit ave_eu_mle_conf ave_suc ) (scatter ave_eu_mle_conf ave_suc ), ytitle(Average Inferred Confidence Rate under EUT) xtitle(Average Success Rate) title("Individual Success Rates and InfConf under EU") note("controlling for misleading quesions: 4 questions removed") graph twoway (lfit ave_ev_conf ave_suc) (scatter ave_ev_conf ave_suc ), ytitle(Average Inferred Confidence Rate under EV) xtitle(Average Success Rate) title("Individuals Success Rates and Confidence") note("controlling for misleading quesions: 4 questions removed") twoway (function y=x, range(0.2 1))(scatter ave_rep_conf ave_suc , xscale(range(0.2 1)) ) , xline(0.69, lpattern(dash)) legend(off) xtitle("Average Success") ytitle("Average Confidence") title("Reported Confidence (Individual Level)") caption("Average Bias = -0.262 (p = .451)") twoway (function y=x, range(0.2 1))(scatter ave_ev_conf ave_suc , xscale(range(0.2 1)) ) , xline(0.69, lpattern(dash)) legend(off) xtitle("Average Success") ytitle("Average Confidence") title("Inferred EV Confidence (Individual Level)") caption("Average Bias = -0.200 (p = .000)") twoway (function y=x, range(0.4 1))(scatter ave_eu_mle_conf ave_suc , xscale(range(0.4 1)) ) ,legend(off) xtitle("Average Success") ytitle("Average EU Confidence") twoway (function y=x, range(0.4 1))(scatter ave_pt_mle_conf ave_suc , xscale(range(0.2 1)) ) ,legend(off) xtitle("Average Success") ytitle("Average PT Confidence") //Differences between treatments gen conf_RDU_Rep=. replace conf_RDU_Rep = ave_pt_mle_conf replace conf_RDU_Rep = ave_rep_conf if conf_RDU_Rep ==. ranksum conf_RDU_Rep , by(treatment ) sdtest conf_RDU_Rep , by(treatment ) **Average bias and absolute bias analysis gen nonlin_beta = abs(beta_mle - 1) gen nonlin_gamma = abs(gamma_mle - 1) gen nonlin_alpha = abs(alpha_mle - 1) gen ave_bias_rep_conf = ave_rep_conf - ave_suc gen ave_bias_pt_mle_conf = ave_pt_mle_conf - ave_suc gen ave_bias_eu_mle_conf = ave_eu_mle_conf - ave_suc gen ave_bias_ev_conf = ave_ev_conf - ave_suc gen abs_ave_bias_rep_conf = abs(ave_bias_rep_conf) gen abs_ave_bias_pt_mle_conf= abs(ave_bias_pt_mle_conf) gen abs_ave_bias_eu_mle_conf = abs(ave_bias_eu_mle_conf) gen abs_ave_bias_ev_conf = abs(ave_bias_ev_conf) histogram ave_bias_rep_conf, xtitle("Average Reported Confidence") ytitle("Percentage") histogram ave_bias_ev_conf, xtitle("Average Conf_EV") ytitle("Percentage") histogram ave_bias_eu_mle_conf histogram ave_bias_pt_mle_conf histogram abs_ave_bias_rep_conf histogram abs_ave_bias_ev_conf histogram abs_ave_bias_eu_mle_conf histogram abs_ave_bias_pt_mle_conf sum ave_bias_rep_conf ave_bias_ev_conf ave_bias_eu_mle_conf ave_bias_pt_mle_conf abs_ave_bias_rep_conf abs_ave_bias_ev_conf abs_ave_bias_eu_mle_conf abs_ave_bias_pt_mle_conf reg ave_bias_rep_conf ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_bias_rep_conf r_mle ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_bias_rep_conf r_mle ave_suc female age, robust reg ave_bias_rep_conf alpha_mle beta_mle gamma_mle ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_bias_rep_conf lot_score sss_score ambg_seek_neutral_averse amg_switch, robust display "Adjusted Rsquared = " _result(8) gen female_r = female*r_mle gen female_alpha = female*alpha_mle gen female_beta = female*beta_mle gen female_gamma = female*gamma_mle *Confidence as a dependent variable //age makes the beta significant replace r_mle=. if r_mle<0 reg ave_rep_conf ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_rep_conf r_mle ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_rep_conf r_mle ave_suc female age female_r, robust reg ave_rep_conf alpha_mle beta_mle gamma_mle ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_rep_conf alpha_mle beta_mle gamma_mle ave_suc female age female_alpha female_beta female_gamma, robust reg ave_rep_conf lot_score sss_score ambg_seek_neutral_averse amg_switch, robust display "Adjusted Rsquared = " _result(8) reg ave_rep_conf ave_ce reg ave_rep_conf ave_ce ave_suc female age ambg_averse //bootstraping regress ave_rep_conf alpha_mle beta_mle gamma_mle , vce(bootstrap, reps(10000)) regress ave_rep_conf alpha_mle beta_mle gamma_mle ave_suc , vce(bootstrap, reps(10000)) regress ave_rep_conf alpha_mle beta_mle gamma_mle ave_suc female age ambg_averse conf_general sss_score lot_score, vce(bootstrap, reps(10000)) regress ave_rep_conf nonlin_beta nonlin_gamma nonlin_alpha , vce(bootstrap, reps(10000)) reg ave_ev_conf ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_ev_conf r_mle ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_ev_conf r_mle ave_suc female age female_r, robust reg ave_ev_conf alpha_mle beta_mle gamma_mle ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_ev_conf alpha_mle beta_mle gamma_mle ave_suc female age female_alpha female_beta female_gamma, robust reg ave_ev_conf lot_score sss_score ambg_seek_neutral_averse amg_switch risk_general, robust display "Adjusted Rsquared = " _result(8) reg ave_eu_mle_conf ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_eu_mle_conf lot_score sss_score ambg_seek_neutral_averse amg_switch risk_general, robust display "Adjusted Rsquared = " _result(8) reg ave_pt_mle_conf ave_suc female age, robust display "Adjusted Rsquared = " _result(8) reg ave_pt_mle_conf lot_score sss_score ambg_seek_neutral_averse amg_switch risk_general, robust display "Adjusted Rsquared = " _result(8) //Simulation of risk neutral confidence: What if alpha=beta=gamma=1? //EU model reg ave_rep_conf r_mle ave_suc female age, robust predict ave_rep_conf_predicted_eu replace ave_rep_conf_predicted_eu =. if ave_rep_conf ==. gen ave_rep_conf_riskneutral_eu = _b[r_mle]*1 + _b[ave_suc]*ave_suc + _b[female]*female+_b[age]*age+_[_cons] replace ave_rep_conf_riskneutral_eu =. if ave_rep_conf ==. gen riskneutral_bias_rep_conf_eu =abs( ave_rep_conf_riskneutral_eu - ave_suc) sum riskneutral_bias_rep_conf_eu histogram riskneutral_bias_rep_conf_eu //PT Model reg ave_rep_conf alpha_mle beta_mle gamma_mle ave_suc female age , robust predict ave_rep_conf_predicted_pt replace ave_rep_conf_predicted_pt =. if ave_rep_conf==. gen ave_rep_conf_riskneutral_pt=_b[alpha_mle]*1 + _b[beta_mle]*1 + _b[gamma_mle]*1 +_b[ave_suc ]*ave_suc + _b[female]*female+_b[age]*age+_[_cons] replace ave_rep_conf_riskneutral_pt=. if ave_rep_conf==. gen riskneutral_bias_rep_conf_pt=abs(ave_rep_conf_riskneutral_pt - ave_suc ) sum riskneutral_bias_rep_conf_pt histogram riskneutral_bias_rep_conf_pt histogram abs_ave_bias_rep_conf, title ("Actual miscalibration = 0.131") histogram riskneutral_bias_rep_conf_eu, title ("Simulated miscalibration assuming EU model = 0.166") histogram riskneutral_bias_rep_conf_pt, title ("Simulated miscalibration assuming PT model = 0.354") **Panel regression Graphs logit suc conf_, nolog predict logit_suc_rep_conf xtlogit suc conf_, nolog predict xtlogit_suc_rep_conf graph twoway (scatter suc conf_, jitter(1)) (line logit_suc_rep_conf conf_) (line xtlogit_suc_rep_conf conf_), title("Predicted Probabilities for Reported Confidence") xtitle("Reported Confidence") ytitle("Success") legend(label( 1 "Actual Data(Jittered)") label(2 "Logit") ) logit suc PT_Conf_MLE_, nolog predict logit_suc_PT_Conf_MLE xtlogit suc PT_Conf_MLE_, nolog predict xtlogit_suc_PT_Conf_MLE graph twoway (scatter suc PT_Conf_MLE_, jitter(1)) (line logit_suc_PT_Conf_MLE PT_Conf_MLE_) , title("Predicted Probabilities for PT Confidence_MLE") xtitle("PT Confidence_MLE") ytitle("Success") legend(label( 1 "Actual Data(Jittered)") label(2 "Logit") ) logit suc EU_Conf_MLE_, nolog predict logit_suc_EU_Conf_MLE xtlogit suc EU_Conf_MLE_, nolog predict xtlogit_suc_EU_Conf_MLE graph twoway (scatter suc EU_Conf_MLE_, jitter(1)) (line logit_suc_EU_Conf_MLE EU_Conf_MLE) , title("Predicted Probabilities for EU Confidence") xtitle("EU Confidence") ytitle("Success") legend(label( 1 "Actual Data(Jittered)") label(2 "Logit") ) **TEsting ROC curve difference between EU_MLE and PT_MLE explaining success logit suc PT_Conf_MLE_, nolog lroc, nograph predict xb_pt_mle, xb logit suc EU_Conf_MLE_, nolog lroc, nograph predict xb_eu_mle, xb roccomp suc xb_eu_mle xb_pt_mle, graph summary //almost identical **testing the equality of confidence measures gen ptconf_repconf = . replace ptconf_repconf = PT_Conf_MLE_ if conf_==. replace ptconf_repconf = conf_ if PT_Conf_MLE_ ==. ranksum ptconf_repconf , by(treatment ) gen euconf_repconf = . replace euconf_repconf = EU_Conf_MLE_ if conf_==. replace euconf_repconf= conf_ if EU_Conf_MLE_ == . ranksum euconf_repconf, by(treatment) gen evconf_repconf = . replace evconf_repconf = EV_Conf_ if conf_==. replace evconf_repconf= conf_ if EV_Conf_ == . ranksum evconf_repconf, by(treatment) ttest EU_Conf_MLE_ = PT_Conf_MLE_ ttest EU_Conf_MLE_ = EV_Conf_ ttest EV_Conf_ = PT_Conf_MLE_ **Parameter estimates sum alpha_mle beta_mle gamma_mle histogram alpha_mle , width(0.1) start(0) frequency note("n=86, Median = 1.02") xtitle("Parameter Alpha") histogram beta_mle , width(0.1) start(0) frequency note("n=86, Median = 0.7") xtitle("Parameter Beta") histogram gamma_mle , width(0.1) start(0) frequency note("n=86, Median = 0.42") xtitle("Parameter Gamma") histogram r_mle if r_mle >0 , frequency ytitle("Density") xtitle("Median = 0.54") title("Histogram of Estimated r Coefficient Under EU Model") sum alpha_mle beta_mle gamma_mle if female ==1, detail sum alpha_mle beta_mle gamma_mle if female ==0, detail ranksum alpha_mle, by(female) ranksum beta_mle,by(female) ranksum gamma_mle, by(female) pwcorr alpha_mle alpha_nl beta_mle beta_nl gamma_mle gamma_nl r_nl, sig ttest alpha_mle=alpha_nl if alpha_nl<3 ttest alpha_mle=1 ttest beta_mle=beta_nl ttest gamma_mle=gamma_nl