Opens in a new tab

Home / Resources / AI in Research

Missing Data in AI-Assisted Analysis:
Why Your Sample Size Changed

With missing data in AI-assisted analysis, a sample size that shrinks between the dataset, the descriptive table and the regression model does not automatically mean the AI or the statistical software made an error. Different procedures may exclude records with missing values or use different subsets of participants. The essential check is to establish which observations entered each analysis, why they were excluded, and whether the missing-data strategy is defensible (Carpenter & Smuk, 2021; Little & Rubin, 2019).

AI in Research
TERMSListwise deletion
NEEDSSample-flow log
REPORTN for each model
GUIDELINECarpenter and Smuk
COMMON ERRORSilent dropped rows

AI can draft data-cleaning and analysis syntax. But the dataset, software defaults and missing-data decisions determine the actual analyzed sample, regardless of whether a human or AI drafted the code.

Why might the same study have several sample sizes?

A dataset of 150 participants shrinking to 141 and 132 observations as variables with missing values enter the analysis.
WORKED EXAMPLE (HYPOTHETICAL VALUES)

Sample flow in a teaching example (hypothetical values)

Imagine a hypothetical teaching example, not a published study or OnlineSPSS client case:

Stage Participants Why the count changed
Enrolled 150 Starting study group
Completed eligibility checks 146 4 were ineligible
Had a recorded primary outcome 141 5 had no recorded outcome
Had complete outcome and model covariates 132 9 more lacked at least one required covariate

A descriptive table might include 146 participants for age, 141 for outcome summaries, and 132 for a complete-record regression. These counts can all be internally consistent, but the author must explain which denominator applies to each result. The numbers here are invented solely to illustrate arithmetic: 150 − 4 − 5 − 9 = 132.

What is listwise deletion, and when does it happen?

Listwise deletion, also called complete-case or complete-record analysis, uses only observations with all values required by a particular analysis. Some statistical procedures use this by default, while others use available-case summaries, maximum likelihood or other approaches. An AI assistant might draft a function that drops rows with missing covariates without explicitly alerting the researcher.

Importantly, complete-case analysis is not always wrong. Its suitability depends on the substantive model, the reasons data are missing and the target of inference. Carpenter and Smuk (2021) explain conditions under which complete-record analysis may be valid, as well as situations where it can create bias or lose efficiency. A fixed rule such as “always impute missing data” is no more reliable than “always delete missing rows.”

Missing data in AI-assisted analysis: what to verify in the script

  • Does the script filter eligibility or study groups before the model?
  • Is there a dropna, na.omit, complete-case filter or procedure-specific exclusion?
  • Are outcomes, exposures and covariates missing for different participants?
  • Is the same sample used in comparisons that are meant to be comparable?
  • Are missing values represented consistently rather than coded as valid zeros or special numbers?
  • For repeated measures, is loss of an entire participant being confused with a missing observation at one time point?
  • Do the Methods, tables, flow diagram and model outputs report the correct denominators?

If the data are sensitive, run these checks within the approved analytical environment, using generic AI-suggested syntax if appropriate.

How do you decide whether missing-data treatment is appropriate?

Start by describing missingness separately for the primary outcome, key exposure and covariates. Investigate whether participants with complete and incomplete data differ on observed characteristics, and consider plausible reasons for missingness. Concepts such as missing completely at random, missing at random and missing not at random are assumptions about missingness, not labels that can always be established by a single statistical test (Little & Rubin, 2019).

Potential approaches include complete-record analysis, likelihood-based models, multiple imputation or sensitivity analyses. The correct option depends on the model, the assumptions and which estimand the study is attempting to recover (Carpenter & Smuk, 2021).

How should the sample-size change be reported?

A defensible Methods description identifies the analysis sample, exclusions and missing-data strategy. A Results section then reports denominators that correspond to the stated models.

Illustrative reporting wording (replace with actual results):

REPORTING TEMPLATE

The primary analysis used [N] observations with [outcome] and required predictors available. Missing values were handled using [method], according to [study rationale]. The number of observations included in each model is reported in [table/figure]. [Any sensitivity analysis] examined whether conclusions were sensitive to the missing-data assumptions.

Do not claim a sensitivity analysis occurred unless it did. For AI-assisted workflows, the audit record can also note which script operation produced the exclusions and which qualified reviewer approved the treatment. Independent Statistical Review covers analyses prepared with AI assistance.

Frequently asked questions

The two analyses may apply different filters, missing-value rules, variables or weighting methods. Compare the executed scripts and analysis-sample flags before concluding that either system calculated incorrectly.

No. Some exclusions are justified, and missingness does not imply bias under every model or assumption. The question is whether the process changes the intended inference or precision (Carpenter & Smuk, 2021).

AI can draft code for multiple imputation, but the imputation model, substantive-model compatibility, diagnostics and assumptions require statistical review. Executable syntax alone does not establish validity.

Independent Statistical ReviewDo participant counts differ across your tables? A statistician traces which observations entered each model and checks the missing-data approach.

Request an Assessment

Independent Statistical Review

In Independent Statistical Review, an in-house PhD-level statistician checks method, assumptions, reproducibility and reporting. One fixed project fee is set after review, with the scope confirmed before work begins. Project information is not published.

References

Last reviewed November 2026 by the OnlineSPSS Statistical Team. Worked examples use hypothetical values and are not client data.

NEXT STEP

Need this done for
your study?

Share your research in about a minute and receive a complimentary assessment the same day: scope, timeline and one fixed fee.

No Commitment Required

Strictly Confidential

Fixed Project Fee

In-House PhD-Level Statisticians

Same-Day Response

Serving Researchers Since 2014