Percentage of All Non-Overlapping Data (PAND)#

The pand function calculates the Percentage of All Non-Overlapping Data (PAND) for single-case experimental designs. PAND is a non-parametric effect size measure that quantifies the proportion of non-overlapping data points between two phases.

Function Overview#

The pand function computes PAND values along with several related statistics including chi-square tests and effect sizes.

Arguments#

  • data: DataFrame or list of DataFrames containing single-case data

  • dvar: Name of dependent variable column (default: “values”)

  • pvar: Name of phase variable column (default: “phase”)

  • decreasing: If True, lower values in Phase B indicate improvement (default: False)

  • phases: Tuple of phases to compare (default: (“A”, “B”))

  • method: Calculation method (“sort” or “minimum”, default: “sort”)

The function prints all results directly and does not return a value.

import scia as sc
📖 scia 1.101.0.dev6 - For Documentation, visit: https://ahsankhodami.github.io/scia/intro.html

Example 1: Single-Case PAND Calculation#

# Create a single-case AB design
df = sc.create_scd(
    values=[5, 7, 8, 5, 7, 12, 16, 18, 15, 14, 19],
    phase_starts={"A": 1, "B": 6}
)

# Compute PAND
sc.pand(df)
Percentage of all non-overlapping data

Method: sort

PAND = 100.00%
Φ = 1.000  ;  Φ² = 1.000

11 measurements (5 Phase A, 6 Phase B) in 1 cases
Overlapping data: n = 0 ; percentage = 0.00 

2 x 2 Matrix of percentages
          A         B
A  0.454545  0.000000
B  0.000000  0.545455 

2 x 2 Matrix of counts
   A  B
A  5  0
B  0  6 

Chi-Squared test:
X² = 11.000, df = 1, p = 0.001 

Fisher exact test:
Odds ratio = inf, p = 0.002 

Example 2: Multiple-Case PAND Calculation#

# Create multiple cases
case1 = sc.create_scd(values={"A": [5, 7, 8, 5, 7], "B": [12, 16, 18, 15, 14, 19]})
case2 = sc.create_scd(values={"A": [3, 4, 5, 3], "B": [6, 7, 8, 9, 10, 11, 12]})
case3 = sc.create_scd(values={"A": [6, 8, 7, 8, 7, 8], "B": [10, 12, 13, 14, 15]})

# Compute PAND for all cases
sc.pand([case1, case2, case3])
Percentage of all non-overlapping data

Method: sort

PAND = 57.58%
Φ = 0.144  ;  Φ² = 0.021

33 measurements (15 Phase A, 18 Phase B) in 1 cases
Overlapping data: n = 14 ; percentage = 42.42 

2 x 2 Matrix of percentages
          A         B
A  0.242424  0.212121
B  0.212121  0.333333 

2 x 2 Matrix of counts
   A   B
A  8   7
B  7  11 

Chi-Squared test:
X² = 0.689, df = 1, p = 0.407 

Fisher exact test:
Odds ratio = 1.796, p = 0.494 

Notes#

  • PAND values range from 0% (complete overlap) to 100% (complete separation)

  • The function also provides chi-square test results and effect sizes (Phi)

  • For decreasing outcomes (where lower values indicate improvement), set decreasing=True

  • Two calculation methods are available: “sort” (default) and “minimum”