strengejacke / sjPlot

sjPlot - Data Visualization for Statistics in Social Science
https://strengejacke.github.io/sjPlot
603 stars 91 forks source link

Display attributes with same name on same column #867

Closed aneshodza closed 1 year ago

aneshodza commented 1 year ago

I was trying to display a tab_model, where the column is our output. When I mapped my functions the tab_model displayed a new column for every row. Is there any way to display all of them onto the same column? Related to this stack overflow question. This is how the table looks at the moment:

image
strengejacke commented 1 year ago

Do you have a reproducible example?

aneshodza commented 1 year ago

@strengejacke I used tab_model(female_slm, smkban_slm, age_slm, show.ci = 0, show.p = 0) to display the table, where *_slm are glm(smoker~ attribute). When I swap the x and y values It fails, because age isn't boolean, so I wanted to have one column called smoker, where everything displays. Instead, the table creates a separate column for every row.

strengejacke commented 1 year ago

It creates a column for each model, so the behaviour is expected. Else, you need to include all your variables in one model.

aneshodza commented 1 year ago

I know that it is expected behavior, but I tried to change it into the other behavior. I wondered if there was a parameter I could pass or if I have to put everything into one model.

strengejacke commented 1 year ago

I'm afraid the function is not designed to work that way, so there's currently no possibility to achieve what you would like to have - except putting all relevant variables into one model.