*! version 0.1.0 11Aug2021

Title

macroF -- Compute macroF

Syntax

macroF [if] [in] [, options]

pred(macroF##pred:str) Variable name containing predicted classification coded as 0/1.

true(macroF##true:str) Variable name containing true classification coded as 0/1.

Description

macroF Computes the macroF evaluation criterion for multi-class outcomes.

Options

pred(str) Variable name containing predicted classification coded as 0/1.

true(str) Variable name containing predicted classification coded as 0/1.

Examples

Example: Predict 3 types of insurance. Convert probabilities for each to a single variable with the predicted category. Compute macroF.

. use https://www.stata-press.com/data/r17/sysdsn1

. mlogit insure nonwhite age male

. predict p1 p2 p3

. gen maxp=max(p1,p2,p3)

. gen pred=.

. replace pred=1 if p1==maxp

. replace pred=2 if p2==maxp

. replace pred=3 if p3==maxp

. tab pred,m

. macroF, pred(pred) true(insure)

Authors

Matthias Schonlau <schonlau@uwaterloo.ca>