## Nominal Serial Randomness

You can test the randomness of a series of nominal values (consisting of only two possible values) using the StatsNPNominalSRTest operation. The input can be either numeric or text wave. For example, the numeric wave data0 consists of random values 1 and 0. To run the test execute:

StatsNPNominalSRTest/T=1/Q data0

The results are displayed in the Non-parametric Serial Randomness table:

N | 100 |

m | 51 |

n | 49 |

u | 48 |

alpha | 0.05 |

P-Value | 0.618874 |

Critical_low | 40 |

Critical_high | 62 |

In this case the first nominal value appears 51 times, the second appears 49 times. The number of runs is 48 which yields a P-value greater than our chosen significance value (alpha). At this significance level the critical limits on the number of runs are 40 and 62. The hypothesis of serial randomness must therefore be accepted.

Note that you get the same result if you use the text wave tdata as the input for the operation. The wave tdata was derived from the numeric wave using the command (select the blue line below and type Ctrl-Enter):

tdata=SelectString(data0[p],"","No","Yes")

A slight variation on data0 is given in the wave data1. Here the test results are different:

StatsNPNominalSRTest/T=1/Q data1

The results are displayed in the Non-parametric Serial Randomness table:

100 | |

m | 51 |

n | 49 |

u | 38 |

alpha | 0.05 |

P-Value | 0.0117356 |

Critical_low | 40 |

Critical_high | 62 |

Although data1 contains the same number of entries for the first and second nominal values the number of runs is smaller than the critical low value. The hypothesis of serial randomness is rejected with P-value of 0.011.