Questions tagged [sjplot]

sjPlot is a collection of several plotting and table output functions for data visualization o R.

About

Its a collection of several plotting and table output functions for data visualization. Results of several statistical analyses (that are commonly used in social sciences) can be visualized using this package, including simple and cross tabulated frequencies, histograms, box plots, (generalized) linear models (forest plots), PCA, correlations, cluster analyses, scatter plots etc.

Links

280 questions
1
vote
1 answer

Overlay of forest plot from ZINB model

I want an overlay of a forest plot from the ZINB models of full and the subset of data using the sjPlot package. As you may know, the ZINB model produces two models: one for the count model and one for the zero-inflated model. plot_model works fine…
skpak
  • 79
  • 6
1
vote
1 answer

Plotting random effects with lmer and sjPlot

I am currently running a mixed effects model using lmer in which random slopes and correlated random intercepts are estimated. After fitting the model I would like to plot the result allowing from random slopes and intercepts as well as one overall…
J.Karl
  • 45
  • 4
1
vote
0 answers

using sjPlot with different random covariance structure

In a mixed model design, I changed the random covariance structure to diagonal: library(sjPlot) library(nlme) model<- lme(fixed= DV~ IV1*IV2+ IV3 + IV4 + IV5, control=list(opt="nlminb"), data=data, random =…
Elad
  • 33
  • 6
1
vote
1 answer

How to change ci_method to "wald" in a logistic regression in R

I need to run a logistic regression on a dataset with approximately 1,000,000 data points. I ran a model logit_results <<- glm(y ~ p1 + p2 + p3, data = df,family="binomial", na.action = "na.exclude") I…
phil
  • 55
  • 4
1
vote
1 answer

Renaming Factor on Axis in sjPlot for Forest Plot in R

I have a logistic regression that I'm trying to plot on a forest plot using plot_model from sjPlot. I'm able to rename the continuous variable names on the Y-axis to look nice - but how do I rename when there's a factor? i.e. I don't want it to say…
John Ryan
  • 343
  • 1
  • 9
1
vote
1 answer

Sjplot: How to plot (or label) for interactions plot with more than 9 interation elements

I want to plot the interaction in a case with a continuous variable and more than 9 elements. But as you can see below, the templates can only accommodate 9 colors; the rest come out gray ... so we don't know which is which. Is there a way to have…
daaronr
  • 507
  • 1
  • 4
  • 12
1
vote
1 answer

Weird output of tab_model() with glmmTMB

I am getting a weird output when I use the tab_model() function of the sjPlot package in connection with the glmmTMB function of the glmmTMB package to fit a generalized linear mixed model with a beta-family response. The intercept and the marginal…
Effigy
  • 145
  • 7
1
vote
1 answer

Get sjPlot in R to show and sort estimates

I am trying to make an interaction plot in sjPlot showing percent probabiliites of my outcome under two conditions of my predictive variable. Everything works perfectly, except the show.values = T and sort.est = T arguments, which don't seem to do…
SageandSun
  • 47
  • 5
1
vote
1 answer

R: APA regression tables with mipo/mice objects

I have historically used sjPlot to create APA-style regression tables that export directly as a docx. Unfortunately, models based on imputed data (mipo objects) are not currently compatible with tab_model. I am looking for a function similar to…
jrcalabrese
  • 2,184
  • 3
  • 10
  • 30
1
vote
0 answers

How to prevent `plot_model()` from __sjPlot__ package in __R__ extrapolate values

I have just realised that plot_model() from sjPlot in R extrapolates values if you try to visualise lines (or curves) of a covariate for different levels of some factor. In this particular case, one level has a maximum that is far below the maximum…
striatum
  • 1,428
  • 3
  • 14
  • 31
1
vote
1 answer

knit sjplot as html output

I am using sjPlot::tab_xtab to create some tables in rmarkdown (they look great!). However, the tables are generated as individual html pages in my browser, and not as a single html file. Similar to this problem here. According to the documentation,…
NewBee
  • 990
  • 1
  • 7
  • 26
1
vote
1 answer

How to plot a subset of plot_model x-axis items in ggplot2 without filtering data before plotting?

I would like to use sjPlot::plot_model to generate some marginal effects plots that are later modified slightly. Specifically, I would like to run a regression with an ordered categorical predictor. I would then like to run plot_model on the…
Omar Wasow
  • 1,870
  • 24
  • 24
1
vote
0 answers

xlim(), scale_x_continuous(), don't change axis limits on plot_summs() when plotting density

I can't get the plot_summs() function from the jtools package to centre on zero by manipulating the x limits. It works fine without the density plots as such: test<-lm(mpg ~ cyl, data = mtcars) plot_summs(test)+xlim(-5,5) But once I add in…
sleepy
  • 93
  • 9
1
vote
1 answer

Reorder groups of factor for sjPlot::plot_model in R

I am plotting the interaction effects of a complex model from lme4::glmer using sjPlots::plot_model. I'd like to change the ordering of the panels of a categorical factor. E.g. below I would like the order to be 'switch' and then 'maintain' rather…
HJT
  • 307
  • 1
  • 9
1
vote
1 answer

Sjplot non-numeric argument to binary operator bug?

I think there is a glitch in the sjplot package, but wanted to ask what people thought first. Here is my code that produces an error, which from my understanding should work just fine library(sjmisc) data(efc) efc <- to_factor(efc, c161sex, e42dep,…
rj44
  • 165
  • 7