Closed tianfeiwei closed 2 years ago
I see the problem, but I don't quite understand the example (seems a little strange to me). You can get the result you want by sorting the mtcars
data first, like this:
mtcars$wtf <- ifelse(mtcars$wt > 3, 1, 0)
mtcars <- mtcars[order(mtcars$wtf),]
table1(~ mpg | wtf, data = mtcars, extra.col=list(`P-value`=pvaluetemp), extra.col.pos = c(3))
EDIT: If you really prefer to input the value manually, you can do it using an anonymous function, like this:
table1(~ mpg | wtf, data = mtcars, extra.col=list(`P-value`=\(...) "0.756"), extra.col.pos = c(3))
Thank you, this helps a lot!
Hi Benjamin, thanks a lot for making such a great package. It's extremely handy. I was trying to make my own tweaks of p-value function for logistic regression model, but the final p-value seems not match with my manually calculated p-values. Could you please guide me on this?
but
summary(glm(wtf ~ mpg+disp + hp + drat,data=mtcars,family = binomial(link = "logit")))$coef[2,4]
gives me 0.7562281.Not sure what did I do wrong? Or is there any alternative ways to just manually input values as
extra.custom.col=list(
P-value=c(0.756))
? Thanks