This functions evaluates many qpadm models simultaneously by keeping the target population and the rightfix populations fixed, and distributing the leftright populations by keeping some in the set of left population and adding the remaining populations to the right populations. (See details for an example of how models are generated)

qpadm_rotate(
  f2_blocks,
  leftright,
  target,
  rightfix = NULL,
  full_results = FALSE,
  verbose = TRUE
)

Arguments

f2_blocks

3d array of blocked f2 statistics, output of f2_from_precomp.

leftright

Populations which will be distributed between left and right

target

Target population

rightfix

Populations which will be on the right side in all models

full_results

Return all output items which are returned by qpadm. By default (full_results = FALSE), weights and several other statistics will not be computed for each model, making it faster and the output more readable. If full_results = TRUE, the output will be a nested data frame where each row is one qpadm model, and each column has one data frame item from the regular qpadm output (weights, f4, rankdrop, popdrop).

verbose

Print progress updates

Value

A data frame with Chi-squared statistics and p-values for each population combination

Details

If leftright consists of the populations L1, L2, L3, L4; rightfix is the population R; and target is T, the following models will be genrated:

(left), (right), (target)
(L1), (L2, L3, L4, R), (T)
(L2), (L1, L3, L4, R), (T)
(L3), (L1, L2, L4, R), (T)
(L4), (L1, L2, L3, R), (T)
(L1, L2), (L3, L4, R), (T)
(L1, L3), (L2, L4, R), (T)
(L1, L4), (L2, L3, R), (T)
(L2, L3), (L1, L4, R), (T)
(L2, L4), (L1, L3, R), (T)
(L3, L4), (L1, L2, R), (T)

Examples

if (FALSE) {
pops = dimnames(example_f2_blocks)[[1]]
qpadm_rotate(example_f2_blocks, leftright = pops[1:4],
             target = pops[5], rightfix = pops[6:7])
}