Skip to content

return NaN for a right-tailed test with fewer than two valid values in vartest - #549

Open
AvanishSalunke wants to merge 1 commit into
gnu-octave:mainfrom
AvanishSalunke:vartest
Open

AvanishSalunke wants to merge 1 commit into
gnu-octave:mainfrom
AvanishSalunke:vartest

Conversation

@AvanishSalunke

Copy link
Copy Markdown
Contributor

A right-tailed test on a group with fewer than two non-NaN values returned p = 0 and h = 1. A single value gives no variance estimate, so p and h are now NaN. Other tails are unchanged.

BEFORE:

octave:2> x = [5 NaN NaN];
octave:3> [h, p, ci, stats] = vartest (x, 1, 'tail', 'right')
h = 1
p = 0
...

AFTER:

octave:2> x = [5 NaN NaN];
octave:3> [h, p, ci, stats] = vartest (x, 1, 'tail', 'right')
h = NaN
p = NaN
...

MATLAB:

>> x = [5 NaN NaN];

>> [h, p, ci, stats] = vartest (x, 1, 'tail', 'right')


h =

   NaN


p =

   NaN


...

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant