strengejacke / sjPlot

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

requesting a few arguements for tab_model() #445

Open frankcsliu opened 5 years ago

frankcsliu commented 5 years ago

Previous version sjt.glm() has a few arguments that become unavailable in tab_model(). I like to ask to bring string.est, string.obs, and string.interc back.

Plus, it will be handy to have exp.coef= back if I want to keep regression coefficients rather than showing odd ratios. Thanks.

strengejacke commented 5 years ago

exp.coef is now named transform. The other options are indeed missing, as I thought they're rarely needed. However, I could re-implement them.

frankcsliu commented 5 years ago

Thanks! The availability of the updated package (including this issue and the one I posted for sjmisc::frq() regarding wrights) will help my students who are working with the packages when finalizing their projects.

frankcsliu commented 5 years ago

Following my previous request, it will be nice to have show.loglik and string.dv back. Thanks.

strengejacke commented 5 years ago
dwervin commented 5 years ago

string.est = "Estimate" does not work. Logit model still shows Log-Odds.

strengejacke commented 5 years ago

Thanks, should be fixed now.

dwervin commented 5 years ago

I updated the sjPlot package this morning, but no change for the table heading. It still shows Log-Odds.

Here is what I am calling:

tab_model(mylogit, show.est=TRUE, string.est = "Estimate",transform = NULL, digits = 4 )

strengejacke commented 5 years ago

Updated from GitHub or CRAN?

dwervin commented 5 years ago

I updated from CRAN.

frankcsliu commented 4 years ago

I like to add a request for "encoding=" for this function. The html table output needs this feature as much as it does for tab_xtab(). The whole class of my students are looking forward to this feature so that they could present their findings results smoothly by the end of the semester. Thanks for your attention!

frankcsliu commented 3 years ago

I am still wondering if the feature above (encoding for tab_model() ) will be considered. Thanks.

sedaerdem commented 3 years ago

shows.obs = TRUE is not working for me. Is there an alternative way to show the number of observations? Thanks

strengejacke commented 3 years ago

hm, can't reproduce:

library(sjPlot)
#> #refugeeswelcome
library(sjmisc)
data(efc)
efc <- to_factor(efc, c161sex, e42dep, c172code)
m <- lm(neg_c_7 ~ pos_v_4 + c12hour + e42dep + c172code, data = efc)

tab_model(m, show.obs = TRUE)
  Negative impact with 7
items
Predictors Estimates CI p
(Intercept) 17.66 16.03 – 19.29 \<0.001
Positive value with 4
items
\-0.67 \-0.77 – -0.56 \<0.001
average number of hours
of care per week
0.01 0.01 – 0.02 \<0.001
elder’s dependency:
slightly dependent
0.84 \-0.09 – 1.78 0.077
elder’s dependency:
moderately dependent
1.74 0.81 – 2.66 \<0.001
elder’s dependency:
severely dependent
3.10 2.11 – 4.09 \<0.001
carer’s level of
education: intermediate
level of education
0.13 \-0.44 – 0.69 0.655
carer’s level of
education: high level of
education
0.70 \-0.02 – 1.42 0.057
Observations 818
R2 / R2 adjusted 0.298 / 0.292

tab_model(m, show.obs = FALSE)
  Negative impact with 7
items
Predictors Estimates CI p
(Intercept) 17.66 16.03 – 19.29 \<0.001
Positive value with 4
items
\-0.67 \-0.77 – -0.56 \<0.001
average number of hours
of care per week
0.01 0.01 – 0.02 \<0.001
elder’s dependency:
slightly dependent
0.84 \-0.09 – 1.78 0.077
elder’s dependency:
moderately dependent
1.74 0.81 – 2.66 \<0.001
elder’s dependency:
severely dependent
3.10 2.11 – 4.09 \<0.001
carer’s level of
education: intermediate
level of education
0.13 \-0.44 – 0.69 0.655
carer’s level of
education: high level of
education
0.70 \-0.02 – 1.42 0.057
R2 / R2 adjusted 0.298 / 0.292

Created on 2021-01-08 by the reprex package (v0.3.0)

sedaerdem commented 3 years ago

Thanks @strengejacke. I see these examples, and I was thinking whether it is because I am using MaxLik for my models? I wonder whether there are cases which tab_model() does not support..

frankcsliu commented 3 years ago

I am still wondering if the feature above (encoding for tab_model() ) will be considered. Thanks.

I see this feature was added into the newest version of sjPlot (2.8.7). Thank you @strengejacke.