sjPlot icon indicating copy to clipboard operation
sjPlot copied to clipboard

requesting a few arguements for tab_model()

Open frankcsliu opened this issue 6 years ago • 15 comments

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.

frankcsliu avatar Dec 14 '18 04:12 frankcsliu

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.

strengejacke avatar Dec 14 '18 06:12 strengejacke

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 avatar Dec 14 '18 07:12 frankcsliu

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

frankcsliu avatar Dec 22 '18 03:12 frankcsliu

  • [x] string.est
  • [ ] string.obs
  • [x] string.interc
  • [ ] string.dv
  • [x] show.loglik

strengejacke avatar Jan 27 '19 18:01 strengejacke

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

dwervin avatar May 09 '19 05:05 dwervin

Thanks, should be fixed now.

strengejacke avatar May 09 '19 06:05 strengejacke

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 )

dwervin avatar May 09 '19 14:05 dwervin

Updated from GitHub or CRAN?

strengejacke avatar May 09 '19 16:05 strengejacke

I updated from CRAN.

dwervin avatar May 09 '19 18:05 dwervin

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 avatar Apr 16 '20 15:04 frankcsliu

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

frankcsliu avatar Dec 05 '20 02:12 frankcsliu

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

sedaerdem avatar Jan 07 '21 22:01 sedaerdem

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)

strengejacke avatar Jan 07 '21 23:01 strengejacke

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..

sedaerdem avatar Jan 08 '21 10:01 sedaerdem

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.

frankcsliu avatar Mar 02 '21 13:03 frankcsliu