I am trying to get my benferroni adjusted p value to my cbinded list of OR and CI and face two issues:
- when I extract p-values from my logistic regression I get the intercept as well, however I proceed with transformation regardless of that. I do not want the intercept when I extract the p-value, how do I do this?
I have tried this:
#get logistic regression
d_ch <- glm(diabetes_type_one ~ chills, data = test, family = binomial)
# extract the p-values for adjusting
d_ch_pval <- summary(d_ch)$coefficients[,4]
#apply benferroni
d_ch_padj <- p.adjust(d_ch_pval, method = "bonferroni")
#I am attaching to the list ordinal ratio and confidence intervals
exp(cbind(OR = coef(d_ch), confint(d_ch), pvalues = d_ch_padj))
- As you my observe my pvalue is also exponentiated which I do not want this to happen. I want to keep my benferroni adjusted pvalue intact of exponentiation but want to add it alongside the OR and CI.
this is a fake dataset:
structure(list(diabetes_type_one = structure(c(1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L), .Label = c("No",
"Yes"), class = "factor"), chills = structure(c(1L, 1L, 1L, 2L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L,
1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 1L), .Label = c("No",
"Yes"), class = "factor")), row.names = c(NA, -50L), class = c("tbl_df",
"tbl", "data.frame"))
Would you please help?