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

How to simultaneously change linetype and color in sjPlot in R?

I am trying to create a plot that shows a regression interaction between variables. Note that both variables are continuous. I am trying to modify the plot so that it shows the each line with a different color and a different linetype (solid,…
0
votes
1 answer

Showing multiple plots with selected terms with plot_model()

I am currently following this guide: https://mran.microsoft.com/snapshot/2020-03-10/web/packages/sjPlot/vignettes/plot_model_estimates.html I copied and pasted the following for the…
hy9fesh
  • 589
  • 2
  • 15
0
votes
1 answer

How to color-code sjPlot::model_plots by positive/negative coefficients when making gridded plots?

I'd like to plot multiple models side-by-side using sjPlot::plot_models. Yet, when I run the following code: set.seed(10) a <- sample(c("low", "medium", "high"), 100, replace = T) b <- rnorm(100) c <- rnorm(100) mod1 <- lm(b ~ a) mod2 <- lm(c ~…
Tea Tree
  • 882
  • 11
  • 26
0
votes
1 answer

tab_model() from sjplot produces "Error: 'is_empty_object' is not an exported object from 'namespace:insight'"

Even when I use the example dataset from the sjplot package I get the error "Error: 'is_empty_object' is not an exported object from 'namespace:insight'". Any ideas of what could be causing it? For example, this error comes up when I run the…
Benji
  • 207
  • 2
  • 9
0
votes
1 answer

Change order of factor levels in sjPlot interaction plot

I have the following kind of interaction plot made with sjPlot, showing an interaction between two categorical variables. The levels seem to appear alphabetically in the plot - however, I would like them ordered low -> average -> high. The code…
0
votes
0 answers

sjPlot::tab_model: How to adjust the format of the confidence interval?

I would like to know how to transform the format of the confidence interval output from sjPlot::tab_model. I want to have the confidence intervals shown in [] square breaks, with the numbers separated by a comma. This is an example of the default CI…
T Song
  • 13
  • 4
0
votes
1 answer

sjPlot plot_model not displaying interaction names

I am running a generalised linear model with a lot of factors and their interactions. modelFINAL<- glmer(treatment ~ (1|Household_ID)+(1|Case)+(1|Villages)+ ProductionSystem*disease+ …
0
votes
1 answer

Can plot_models be used with type="pred"?

I tried to use the following code to produce figures depicting the predicted values for specific variables. However, I get the error: Error in (show.zeroinf && minfo$is_zero_inflated) || minfo$is_dispersion : invalid 'y' type in 'x || y' Can…
mango123
  • 29
  • 5
0
votes
1 answer

sjplot plot_model with own color palette

I apologize if this is a very basic question, but I'm having trouble defining colors when using plot_model in sjplot. As an example, I have run a simple multilevel regression model where 76 participants represent clusters. Each participant responded…
Sointu
  • 107
  • 3
0
votes
0 answers

plot_models() panel size and/or label spacing issue

plot_models() function from library(sjPlot) does not seem to allow label offsets apart from spacing which make vertical adjustments. Please advise on how to prevent label cutoffs vertically and horizontally. Here is the model list object. Herewith…
Rion Lerm
  • 19
  • 5
0
votes
0 answers

How to add legend labels using sjPlot in R

I am trying to manually add labels to my legend using sjPlot in R. Currently, the legend is showing the numerical value of each category (1-7), but I would like the legend labels to read Strong Democrat, Democrat, Lean Democrat, Independent, Lean…
0
votes
0 answers

unable to loop writing tables with tab_df

Splitting a large table into smaller ones, I tried to export all my output as .csv and then as .doc files. My code works for the first but not for the second. ####Given a Tibble called data: namen <- unique(data$Fundort) for (i in…
Tuck
  • 3
  • 2
0
votes
0 answers

Why does this piecewise linear mixed model not produce equal estimates at the knot

I am wondering if someone could help me interpret my piecewise lmm results. Why does ggpredict() produce different estimates for the knot at 10 weeks (end of tx; see ‘0’ in graph at end)? I've structured the data like so: bpiDat <- bpiDat %>% …
0
votes
2 answers

Unable to use sjPlot's plot_model function — two errors

I have a script that usually allows me to plot Odds Ratios with plot_model. However, when I tried to run it today, I got two errors. When using plot_model on a model that runs, RStudio told me the function could not be found. I ensured sjPlot was…
Nick Byrd
  • 163
  • 1
  • 14
0
votes
0 answers

save output from R as a table

I want to save output from my R markdown in a table format that I can directly add in my publication. The code does wilcoxson signed rank test on multiple variables at the same time. I want to export the output I get from the modellist into a table…