I need to categories a variable into three categories and I have associated cost for each wrong decision.
Suppose I have a continuous variable X (which need to be categorized as 1, 2 and 3) and categorical variable Y (with true disease categories 1, 2 and 3) and for each wrong decision there is a cost. I want to estimate a and b which minimize overall cost.
To be specific
recode X min/a=1 a/b=2 b/max=3
gen cost=0 if X-Y=0
replace cost=1 if X-Y=1
replace cost=2 if X-Y=-1
replace cost=20 if abs(X-Y)=2
egen total_cost=sum(cost)
I want to estimate values of a and b which can minimize the total cost.
Please help me.
Suppose I have a continuous variable X (which need to be categorized as 1, 2 and 3) and categorical variable Y (with true disease categories 1, 2 and 3) and for each wrong decision there is a cost. I want to estimate a and b which minimize overall cost.
To be specific
recode X min/a=1 a/b=2 b/max=3
gen cost=0 if X-Y=0
replace cost=1 if X-Y=1
replace cost=2 if X-Y=-1
replace cost=20 if abs(X-Y)=2
egen total_cost=sum(cost)
I want to estimate values of a and b which can minimize the total cost.
Please help me.
Comment