Attribute VB_Name = "eff_size_dominance" 'Created by Peter Stikker 'Companion website: https://PeterStatistics.com 'YouTube channel: https://www.youtube.com/stikpet 'Donations welcome at Patreon: https://www.patreon.com/bePatron?u=19398076 Public Sub es_dominance_addHelp() Application.MacroOptions _ Macro:="es_dominance", _ Description:="Dominance and a Vargha-Delaney A like effect size measure", _ category:=14, _ ArgumentDescriptions:=Array( _ "range with the numeric scores", _ "optional parameter to set the hypothesized median. If not used the midrange is used", _ "output to show, either " & Chr(34) & "dom" & Chr(34) & "(default), or " & Chr(34) & "vda" & Chr(34)) Application.MacroOptions _ Macro:="es_dominance_arr", _ Description:="Dominance and a Vargha-Delaney A like effect size measure" & vbNewLine & "array function, requires 2 rows and 3 columns as output", _ category:=14, _ ArgumentDescriptions:=Array( _ "range with the numeric scores", _ "optional parameter to set the hypothesized median. If not used the midrange is used") End Sub Function es_dominance(data As Range, Optional hypMed = "none", Optional out = "dom") 'set hypMed to midrange if not provided If hypMed = "none" Then hypMed = (WorksheetFunction.Min(data) + WorksheetFunction.Max(data)) / 2 End If 'sample size n = WorksheetFunction.Count(data) 'proportion of scores above hypMed and below pPlus = WorksheetFunction.CountIf(data, ">" & hypMed) / n pMin = WorksheetFunction.CountIf(data, "<" & hypMed) / n 'dominance is simply the difference dominance = pPlus - pMin res = dominance 'the VDA like effect size If out = "vda" Then VDA = (dominance + 1) / 2 res = VDA End If es_dominance = res End Function Function es_dominance_arr(data As Range, Optional hypMed = "none") 'set hypMed to midrange if not provided If hypMed = "none" Then hypMed = (WorksheetFunction.Min(data) + WorksheetFunction.Max(data)) / 2 End If 'sample size n = WorksheetFunction.Count(data) 'proportion of scores above hypMed and below pPlus = WorksheetFunction.CountIf(data, ">" & hypMed) / n pMin = WorksheetFunction.CountIf(data, "<" & hypMed) / n 'dominance is simply the difference dominance = pPlus - pMin 'the VDA like effect size VDA = (dominance + 1) / 2 'Results Dim res(1 To 3, 1 To 3) res(1, 1) = "hyp. med." res(1, 2) = "dominance" res(1, 3) = "VDA (like)" res(2, 1) = hypMed res(2, 2) = dominance res(2, 3) = VDA es_dominance_arr = res End Function