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

How to avoid the adding of the column "ModelLik" when tab_df() is used to export the AIC table

As example two LMM. lme1 <- lme(mpg ~ cyl + disp, random = ~1|disp, method = "ML", data = mtcars) lme2 <- lme(mpg ~ cyl * disp, random = ~1|disp, method = "ML", data =…
Matthew
  • 95
  • 1
  • 8
1
vote
1 answer

sjPlot::plot_model - plot a 3-way interaction in a 2x2 panel figure and change the labels of fixed effects

I have a GLMM with a three-way interaction (see 'm' below). The interaction term includes one continuous (A) and two categorical (B &C) fixed factors. Factors B and C each have 2 levels, 0 & 1. The model also includes two random factors (a & b) and…
1
vote
1 answer

figure caption on sjPlot

Does anyone know how to add a figure caption using sjPlot? This is the code I have and I've tried multiple ways to add a figure caption, but has not been successful. plot_model(mm1,type="pred", title = "Random Intercept and Fixed…
1
vote
1 answer

Build (or delete) panels of ggplot facet one at a time

I am working on a presentation in which it would be helpful to "build" up the elements of a facetted ggplot object. For example, with a two panel facetted plot, I would like to be able to show the first, left-side panel in a slide, still formatted…
Omar Wasow
  • 1,870
  • 24
  • 24
1
vote
1 answer

How to change facet options with sjPlot plot_model with multiple moderators or interactions

I have a plot in which I'd like to show models of how three terms are related across three different categorical subgroups. sjPlot::plot_model automatically creates a kind of faceting with three plots in one row. In general, this works well. For a…
Omar Wasow
  • 1,870
  • 24
  • 24
1
vote
2 answers

order.terms does not reorder terms in sjPlot's plot_model

I have code to graph a simple three-level one factor regression and I can't convince sjPlot to reorder the terms on the X-axis and I wondered if anyone could help me figure out what is going on. My code: m0 <- lmer(ans ~ type + (1|subject/target),…
Katie
  • 808
  • 1
  • 11
  • 28
1
vote
1 answer

How to reverse the legend order in a plot created with sjPlot

I use the data of mtcars to build a lmer model as below. The problem is that when I use sjplot::plot_model to plot marginal effect plot, I found the order of legend is reversed. The expected order is that the low value is at the bottom and the large…
PeterPanPan
  • 151
  • 4
1
vote
1 answer

sjPlot is loaded but R complains that it could not find sjt.corr function

Does anyone have a clue for why stj.corr fails here? library(sjPlot) view_df(cars) # works fine sjt.corr(cars)# produces error Error in sjt.corr(cars) : could not find function "sjt.corr"
Avi Kluger
  • 91
  • 6
1
vote
1 answer

How to mark the y-values of data points in a given ggplot object?

I'm trying to annotate the y-values of data points in a given ggplot object, after the fact. To have a reproducible example, I'll create a model on mtcars data, using lm(), and plot using…
Emman
  • 3,695
  • 2
  • 20
  • 44
1
vote
0 answers

rescaling x axis in plot_models from sjPlot

I have a problem with changing the x axis in plot_models function. I have a number of linear regression models for which I want to plot the estimates. I'm using plot_models from sjPlot function but I've encountered a problem with the x axis. It is…
Honestiore
  • 53
  • 3
1
vote
0 answers

statistical test to compare 1st/2nd differences based on output from ggpredict / ggeffect

I want to conduct a simple two sample t-test in R to compare marginal effects that are generated by ggpredict (or ggeffect). Both ggpredict and ggeffect provide nice outputs: (1) table (pred prob / std error / CIs) and (2) plot. However, it does…
1
vote
1 answer

How to generate clustered standard errors in SJplot package?

I'm tiring to plot the output of a model using the sjPlot package. I want the standard errors on the plot to reflect the clustered standard errors I'm using in my model. I was wondering what the appropriate call for the plot_model function is if I…
Sharif Amlani
  • 1,138
  • 1
  • 11
  • 25
1
vote
1 answer

Editing the y axis on a sjplot in R (plot_model)

I am having trouble with my y axis on this sjplot I have created. I am not sure why the values are arranged like that (see image) and was wondering if anyone could help me e.g. set my y axis to start at…
1
vote
2 answers

Plot in R: Gap beginning and end of the x-axis - how to remove?

That is my code plot_model(mylogit, type = "pred", terms = c("ScoreEnvAtt [all]", "Guilt")) + scale_colour_discrete(guide = guide_legend(title = "Guilt"), labels = c("Low", "Medium", "High")) + scale_fill_discrete(guide = guide_legend(title =…
Mariella
  • 21
  • 4
1
vote
1 answer

specific manipulation of axis limits and scales in sjplot::plot_model of logistic glmer that generally preserves plot_model output

Sorry if this is a double post, I've seen some similar posts but haven't found the exact solution I'm looking for. I fit a glmer model to some reaction time data of the form: m19 <- glmer(response ~ trial_z*stim + cond + (1 + stim | subj_idx), …
Nate Hall
  • 64
  • 1
  • 7