Dear Statalister,
Currently, I am working with a simple dataset but I am not sure whether the basic coding is correct. If I run the commands below, will the values listed as sensitivity and specificity be the actual sensitivity and specificity values? Or do I have to interchange the 0 and 1 values in the foreign variable?
Best
Ian
* Dataset
* Logistic regression command
* Determination of Youdens index
Currently, I am working with a simple dataset but I am not sure whether the basic coding is correct. If I run the commands below, will the values listed as sensitivity and specificity be the actual sensitivity and specificity values? Or do I have to interchange the 0 and 1 values in the foreign variable?
Best
Ian
* Dataset
Code:
webuse auto.dta, clear
Code:
logit foreign price, vce(cluster make)
HTML Code:
. * Logistic regression . logit foreign price, vce(cluster make) Iteration 0: log pseudolikelihood = -45.03321 Iteration 1: log pseudolikelihood = -44.947363 Iteration 2: log pseudolikelihood = -44.94724 Iteration 3: log pseudolikelihood = -44.94724 Logistic regression Number of obs = 74 Wald chi2(1) = 0.20 Prob > chi2 = 0.6558 Log pseudolikelihood = -44.94724 Pseudo R2 = 0.0019 (Std. Err. adjusted for 74 clusters in make) ------------------------------------------------------------------------------ | Robust foreign | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- price | .0000353 .0000791 0.45 0.656 -.0001198 .0001904 _cons | -1.079792 .5537941 -1.95 0.051 -2.165209 .0056241 ------------------------------------------------------------------------------
* Determination of Youdens index
Code:
* Sensitivity and specificity graphs lsens , gensens(sens_price) genspec(spec_price) * Variable for Youden Index gen float youden_price = sens_price + spec_price-1 * Youden index determination egen float max_price = max(youden_price) * Cut-off value, sensitivity and specificity list sens_price spec_price c.price /// if youden_price == max_price
HTML Code:
+-----------------------------+ | sens_p~e spec_p~e price | |-----------------------------| 32. | 0.590909 0.653846 5,379 | +-----------------------------+