Published

An unused column changes bioinfokit’s Z-test significance decision

Two missing notes change a Z-test p-value from 0.0398 to 0.0660, although all ten measurements remain identical and complete.

The measurements stay the same; the decision changes

A note column should not affect a test of a separate measurement column. We reproduced a case in bioinfokit where adding two missing notes changes a two-sided Z-test p-value from 0.0398 to 0.0660. All ten measurements are unchanged and complete, yet the result crosses the conventional 5% threshold.

Tasuku Kobayashi submitted bioinfokit issue #73 on November 9, 2026. Upstream confirmation and a repair are pending.

Ten measurements and two missing notes

The synthetic example has a measurement mean of 10 and tests a population mean of 9.35, assuming a known population standard deviation of 1. The second call adds only an unused metadata column; its final two entries are missing.

import pandas as pd
from bioinfokit.analys import stat

df = pd.DataFrame({"x": [9,10,11,10,9,10,11,10,9,11]})
for data in [df, df.assign(note=["ok"] * 8 + [None] * 2)]:
    out = stat()
    out.ztest(df=data, x="x", x_std=1, mu=9.35, test_type=1)
    print(out.result[3])
InputReported sample sizeTwo-sided p-value
Measurement column alone100.03983261924474133
Same measurements, two missing notes80.06599205505934737
Reference for either input100.03983261924474133

The independent reference uses z = (10 − 9.35) / (1 / √10), giving 2.0554804791. Twice the standard-normal upper-tail probability gives the first p-value. The added notes have no role in that calculation.

Keep the mean and sample size on the same observations

The one-sample branch calculates the mean from the selected column but counts rows that have no missing value anywhere in the dataframe. It mixes a mean based on ten measurements with a standard error based on eight. The sample-size label and confidence interval change as well.

The report proposes using one cleaned measurement vector for the mean, sample size, standard error and confidence interval. A regression check should ensure that unrelated columns cannot change the result. The earlier missing-value fix in PR #40 concerned ttest, not this ztest branch.

We reproduced the behavior in bioinfokit 2.1.4 and unmodified upstream source at d7df2c9, using Python 3.12.14, pandas 3.1.1, NumPy 2.5.4, SciPy 1.18.1 and statsmodels 0.15.0.

This constructed example demonstrates an ordinary missing-metadata failure condition, not a measured occurrence rate or an affected real study. The Z-test assumes a known population standard deviation. The investigation illustrates why verification must check that reported quantities use the same observations; it does not establish a SciGround production incident, new product support or an upstream-adopted repair. The public report retains the reproducer and current disposition.