-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hello,
I am trying to pass Fisher's exact test calculation on each row variable compared to the column grouping variable:
summaryTable_hpv_neg <- computeSummaryStatisticsTable(
data = clindats_merged_hpvneg,
var = colnames(clindats_merged_hpvneg)[2:4],
colVar = c("Cohort", "MPS"),
#colVarTotal="Cohort",
#colTotalInclude=T,
stats = list(expression(paste0(statN, " (", round(statPercN, 1), "%)"))),
statsExtra = list(`P value` = function(data, x) fisher.test(table(data$x, data$MPS))$p.value),
statsVarBy="Cohort",
dataTotal = clindats_merged,
subjectVar="patient_ID"
)
So for each row variable, I would like to run a Fisher's test with the MPS column variable to see the association between them.
But I get the following error message:
Error in table(data$x, data$MPS) :
all arguments must have the same length
Could you help me with how should I properly formulate a statistical test in the statsExtra parameter?
Metadata
Metadata
Assignees
Labels
No labels