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
3
votes
1 answer

Changing a geom_ribbon fill color

I have a mixed effects linear model and I want to plot it using the sjPlot package. I have added a geom-ribbon layer for the CI of each reg line, but I just can't figure how to change it's fill color. Idealy I'd want each ribbon to be the same color…
3
votes
2 answers

Knitting output from sjPlot::tab_model() or other html tables into PDF document

As the heading describes, I am trying to to find a way to knit output from sjPlot::tab_model() and other HTML tables into a PDF document generated from LaTeX using knitr. I am therefore looking for a an alternative function to tab_model() that…
Pål Bjartan
  • 793
  • 1
  • 6
  • 18
3
votes
1 answer

sjPlot - change plot line colors to black/white

I am plotting a regression model with sjPlot's plot_model(). I want to change my line colors from sjPlot theme (red & blue lines) to black & white or grayscale. However, when I utilize set_theme(theme_bw()), the plot appearance does not change…
MKS.bln
  • 33
  • 5
3
votes
1 answer

sjPlot for robust regression?

Is there someone who know if sjp.Int works for robust regressions? Basic plotting works, but the confidence intervals do not work? Error= Error in seq.default(from = best$lmin, to = best$lmax, by = best$lstep) : 'from' must be of length 1 In…
user6121484
  • 143
  • 2
  • 15
3
votes
1 answer

Change line width (thickness) sjPlot sjp.int R

I would like to change the width of the lines (thicker lines) in an sjp.int plot. I tried all help arguments, but somehow could not find it. Example code: require(ggplot2) require(sjPlot) head(diamonds) test<-lm(price ~ carat*depth,…
LaNeu
  • 105
  • 14
2
votes
0 answers

Add fixed effect row to tab_model from sjPlot (r)

I am trying to add rows to a regression plotted in sjPlot using the tab_model function. I would like to add rows beneath the predictors, which I fill with an "x" if the fixed effect is present, and leave blank if not. These would be for year and…
flâneur
  • 633
  • 2
  • 8
2
votes
1 answer

Recreating three-way interaction plot from sjplot in ggplot

I used sjPlot to plot a significant three-way interaction from a glm model using a Gamma distribution. The DV is continuous, two of the IVs are continuous, and one is categorical. I'd love to have the plot be faceted by the categorical variable,…
2
votes
0 answers

merging plots from 2 models from sjplot

I need two models' plots combined into one graph, as seen in the image below. model 1 estimate's top line and model 2 estimates's bottom line. I create the graph using one model, but I'm not sure how to incorporate an estimate from another…
skpak
  • 79
  • 6
2
votes
1 answer

Account for offset variables in plot_model() of sjPlot package

I am creating a Poisson-distributed generalized linear model using an offset variable (in my case, the number of seconds of roe deers displaying vigilant behaviors as the response variable and the total number of seconds stayed at the plot as the…
Ariel C
  • 25
  • 3
2
votes
1 answer

Neither order.terms or scale_x_discrete reorders terms in sjPlot's plot_model()

I'm trying to make some model plots using plot_model() function in the sjPlot package. The default is to have the terms alphabetically, which isn't logical for my data (animal behavior in response to enrichments and in baselines). The function…
AMMD
  • 21
  • 1
2
votes
2 answers

R || Adjusting x-axis in sjPlot::plot_model()

I want to graph an interaction effect between two variables with one outcome in R. While I can successfully produce a graph using sjPlot:plot_model(), the interaction plot does not resize when I adjust the x-axis values. Instead, the graph that's…
Zach W
  • 21
  • 2
2
votes
0 answers

Tab_model is slow for large mixed models -- what can I do?

I like the tab_model from sjPlot very much but I can't seem to get past a hurdle. I am using a very large mixed model, millions of data points, and somehow getting my tab_model output is taking forever. I've tried changing the df.method to "Wald",…
Mitch M
  • 21
  • 1
2
votes
1 answer

How to change x axis scale from numbers to words in R

I have the following code: library(sjPlot) v1 <- rbinom(100, size=1, p=0.5) v2 <- rnorm(1:100) v3 <- rnorm(1:100) v4<- rbinom(100, size=1, p=0.5) mydf<- data.frame(v1, v2, v3, v4) mydf$v4 <- as.factor(mydf$v4) mydf$v1 <-…
Santiago99
  • 143
  • 4
2
votes
1 answer

Plotting predicted model results for averaged models (lm, glm or glmm)

I used MuMIn::model.avg to average several models* and I am interested in plotting the predicted results of the conditional (not full) model average. I tried both ggeffects::ggpredict and sjPlot::plot_model, and both only give the full model…
Ron Efrat
  • 41
  • 3
2
votes
1 answer

R: use mice mipo/data.frame object with sjPlot tab_model

I'm trying to get a table output for a pooled logistic model with imputed datasets from mice so I can see and report the standardized and exponentiated estimates and model fit statistics, but it seems like tab_model will not take a mipo/data.frame…
L. Tucker
  • 523
  • 2
  • 12
1
2
3
18 19