npc {permutest} | R Documentation |
Run NPC
Description
This function takes a data frame and group and outcome column names as input and returns the nonparametric combination of tests (NPC) omnibus p-value
Usage
npc(
df,
group_col,
outcome_cols,
strata_col = NULL,
test_stat = "diff_in_means",
perm_func = permute_group,
combn = "fisher",
shift = 0,
reps = 10000,
perm_set = NULL,
complete_enum = FALSE,
seed = NULL
)
Arguments
df |
A data frame |
group_col |
The name of the column in df that corresponds to the group label |
outcome_cols |
The names of the columns in df that corresponds to the outcome variable |
strata_col |
The name of the column in df that corresponds to the strata |
test_stat |
Test statistic function |
perm_func |
Function to permute group, default is permute_group which randomly permutes group assignment |
combn |
Combining function method to use, takes values 'fisher', 'tippett', or 'liptak', or a user defined function |
shift |
Value of shift to apply in one- or two-sample problem |
reps |
Number of iterations to use when calculating permutation p-value |
perm_set |
Matrix of permutations to use instead of reps iterations of perm_func |
complete_enum |
Boolean, whether to calculate P-value under complete enumeration of permutations |
seed |
An integer seed value |
Value
The omnibus p-value
Examples
data <- data.frame(group = c(rep(1, 4), rep(2, 4)),
out1 = c(0, 1, 0, 0, 1, 1, 1, 0),
out2 = rep(1, 8))
output <- npc(df = data, group_col = "group",
outcome_cols = c("out1", "out2"), perm_func = permute_group,
combn = "fisher", reps = 10^4, seed=42)