nonStanTest: non standardization test

Description Usage Arguments Details Value Author(s) Examples

View source: R/nonStanTest.R

Description

Allows the user to test a dataset of observed sequences to determine the probability that these sequences could have arisen due to chance. Acknowledgements: CPC St Andrews/Edinburgh.

Usage

1
nonStanTest(lifecourseSequences, sequenceUnits)

Arguments

lifecourseSequences

A dataset (matrix form) consisting of sequences.

sequenceUnits

A vector containing the possible sequence states.

Details

This is an approach to answering the question of whether or not the observed sequences for a given set of lifecourses could have arisen due to chance. This is achieved by comparing the observed sequences to a set of randomly simulated sequences .For each observed sequence A, there is a corresponding simulated sequence, B. B is constructed by assigning at random, an order to the observed states in A. The simulated sequences serve as a null distribution for the test.

Value

A p value (LeftTailed_pval) representing the probability that the observed test statistic (corresponding to the observed data) is greater than those obtained under the null hypothesis. A p value (RightTailed_pval) representing the probability that the observed test statistic (corresponding to the observed data) is less than those obtained under the null hypothesis.

The test statistics obtained under the null hypothesis are also provided.

Author(s)

Glenna Nightingale

Examples

1
2
3
4
5
6
7
8
data(mydata) 
# obtaining the in-built data derived from BHPS data.
bbc = mydata
bbcseq = bbc[,2:14]   
# removing the first column which contains the ID for the persons involved.
balphabet =c("non-mover","mover within gb")   
#nll = nonStanTest(bbcseq,balphabet) 
# obtaining the null distribution and p values                            

lifecourse documentation built on May 2, 2019, 4:18 a.m.