This function performs Test3.SM

test3sm(X, freq, verbose = TRUE, rounding = 3)

Arguments

X

is a matrix of encounter histories with K occasions

freq

is a vector of the number of individuals with the corresponding encounter history

verbose

controls the level of the details in the outputs; default is TRUE for all details

rounding

is the level of rounding for outputs; default is 3

Value

This function returns a list with first component the overall test and second component a data.frame with 5 columns for components i (2:K-1) (in rows) of test3.smi: component, degree of freedom, statistic of the test, p-value, test performed.

Author

Olivier Gimenez <olivier.gimenez@cefe.cnrs.fr>, Jean-Dominique Lebreton, Rémi Choquet, Roger Pradel

Examples

# read in the classical dipper dataset dipper = system.file("extdata", "ed.inp", package = "R2ucare") dipper = read_inp(dipper,group.df=data.frame(sex=c('Male','Female'))) # Get encounter histories, counts and groups: dip.hist = dipper$encounter_histories dip.freq = dipper$sample_size dip.group = dipper$groups # split the dataset in males/females mask = (dip.group == 'Female') dip.fem.hist = dip.hist[mask,] dip.fem.freq = dip.freq[mask] mask = (dip.group == 'Male') dip.mal.hist = dip.hist[mask,] dip.mal.freq = dip.freq[mask] # for females res.females = test3sm(dip.fem.hist, dip.fem.freq) res.females
#> $test3sm #> stat df p_val #> 2.041 3.000 0.564 #> #> $details #> component stat df p_val test_perf #> 1 2 1.542 1 0.214 Fisher #> 2 3 0 1 1 Fisher #> 3 4 0.499 1 0.48 Fisher #> 4 5 0 0 0 None #> 5 6 0 0 0 None #>