*! version 1.3 31May2024

bta2score Beta to score

Syntax

bta2score , [name(string) decimal(numlist) tabulation keepcons replace cstat dstat aic bic gof rsqaure]

Description

The bta2score (stands for beta to score) command creates a rounded item score and a total score from regression coefficients to be used as rapid decision-making tool in urgent clinical conditions. It converts post-estimation coefficients derived from regression commands; regress, glm, logistic, logit, ologit and stcox. It is essential to note that when using ordinal logistic regression to construct score items, only one odds ratio for each variable is required. Each regression coefficient will be converted into a discrete integer or with a specific decimal point, such as 0.5. The command adds the item scores into a total score. This approach is designed for bedside evaluation in urgent clinical conditions, to ensure that the score is promptly available for immediate use, without the use of computer or an application. This is very similar and analogous to the well-known tools like Alvarado score, APGAR score, Ottawa ankle rule, and Glasgow Coma Scale.

The bta2score extracts and rounds regression coefficients (from continuous or indicator (i.), categorical, or binary variables into a discrete integer or with 0.5 score. The algorithm comprises of

1. Division: dividing each regression coefficient by the smallest number of regression coefficient within the multivariable model, retaining the vector (direction) of the negative coefficient.

2. Rounding: rounding up (or down) the divided coefficient with a user-specified nearest integer.

3. Summation: summing the item score to a Newvar variable.

User-prespecify Newvar can build a wide range of decimal-rounded scores, building many easy-to-calculate scores.

Options

name(string) Specify the score name. Default is score.

decimal Specify the item score decimal digits. Default is zero, rounded to an integer.

tabulation Tabulate the item scores and the rounded score. Default is no show.

keepcons Keep the regression constant (_cons) as one of the predictors. Default is excluding the constant term.

replace Replace the previous sum score variable generated by bta2score. Previous estimation will be deleted and replaced. Default is warning before replacing.

cstat Report Harrell's C-statistic for binary endpoint. Compatible with regress, glm, logit, logistic, and stcox.

dstat Report Somer's D-statistic for survival endpoint. Compatible with stcox.

aic Report Akaike's information criterion.

bic Report Bayesian information criterion.

gof Report Hosmer-Lemeshow Goodness-of-fit p-value.

rsquare Report R-square.

Examples

Import Hosmer & Lemeshow low birth weight example dataset

webuse lbw,clear

Estimate logistic regression with potential predictors for low birth weight

logistic low i.race smoke i.ht i.ui

Immediately do after regression with specify name of the new score “lbwscore” predict the probability of low birth weight on the round-to-0.5 score. Show the score assignment table. Also reports AIC, BIC, C-statistic.

bta2score, name(lbwscore) tabulation decimal(0.5) aic bic cstat

Determine discrimination index with AuROC by roctab

roctab low lbwscore, graph detail

Stored results

bta2score stores the following in r():

Scalars

r(cstat) Harrell's C-statistic

r(dstat) Somer's D-statistic

r(aic) Akaike's information criterion

r(bic) Bayesian information criterion

r(gof) Hosmer-Lemeshow Goodness-of-fit p-value

r(rsquare) R-square

Macros

r(name) Score name

r(endpoint) Endpoint variable

Matrix

r(coef) Original coefficient matrix

Authors

Suppachai Lawanaskol, MD

Chaiprakarn hospital, Chiang Mai, Thailand

Email suppachai.lawanaskol@gmail.com

Jayanton Patumanond, MD, DSc

Center of Clinical Epidemiology and Clinical Statistics, Faculty of Medicine, Chiang Mai University, Chiang Mai, Thailand

Email jpatumanond@gmail.com