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

Colored ribbons and different linetypes in sjPlot plot_model()

I want to use plot_model() from the sjPlot package to plot predicted values of a model with both different linetypes and colored ribbons. I also want the linetypes and ribbon colors to show up in the legend. I did find a way to make this work using…
captain
  • 543
  • 1
  • 3
  • 20
1
vote
1 answer

How to plot multiple glmer models into one single plot?

I have two glmer models with two covariates each that I'm trying to plot into a single figure. MWE: ## generalized linear mixed model library(lattice) cbpp$response <- sample(c(0,1), replace=TRUE, size=nrow(cbpp)) gm1 <- glmer(response ~ size +…
Marcelo Villa-Piñeros
  • 1,101
  • 2
  • 12
  • 24
1
vote
4 answers

How to run a frequency table in R for a set of variables like you would say FREQUENCIES var1 TO var10 in SPSS?

I'm trying to run a set of frequency tables in R without having to write the code for every single variable. For example, using the mtcars data in SPSS I would so something like: FREQUENCIES mpg TO vs And it would give me the 8 frequency tables…
Carley
  • 63
  • 6
1
vote
1 answer

Different line colors in forest plot output from sjPlot R package

I am preparing forest plots with regression coefficients using sjPlot package. How can I customize the line color of regression coefficients to have one color for each coefficient? I have tried to use the argument colors = c("blue", "red", "black")…
Jhonny
  • 15
  • 6
1
vote
2 answers

ggplot2 or sjPlot sum stacked barplot columns

I am running R version 3.5.2 (2018-12-20) -- "Eggshell Igloo" on a MacBook Pro, OS 10.14.2. I have tried a few methods to get these plots. My preferred method was trying to create a stacked barplot of my data (factor grouped over time, my x axis…
1
vote
0 answers

ggeffects & dummy coding; sjPlot & odds ratios

I am currently examining marginal effects of some fixed effects factors in a mixed effects logistic. To do so, I've employed the ggpredict function of the tremendously helpful ggeffects package. I then also used the tab_model function of the…
jjcii
  • 139
  • 3
  • 10
1
vote
2 answers

Plotting random subset of individual quadratic growth curves in R from lme or lmerMod object?

I would like to plot a random subset of 10 individual's quadratic growth curves from lme4 or nlme in R using either ggplot2 or sjPlot. I know how to do this for a linear line, but not a quadratic one. Obviously the plot below with 105 participants…
1
vote
0 answers

Plot marginal effects on original scale using plot_model()

Im trying to plot marginal effects from a model (done with lme4) using plot_model() Models (2 versions of same model) look like Version 1: m1 <- glmer(Y~Xs*Zs+(1|random.factor), family=binomial(), data=dat) Version 2: m2 <-…
Nina
  • 11
  • 3
1
vote
1 answer

No labels in sjplot tab_df

I am trying to build a table with sjplot and the tab_df function but fail to get the label names in the table: library(sjPlot) library(stargazer) Region<-c("Berlin", "Hamburg", "Berchtesgarden") Sensor<-c("Riegl ", "Riegl ", "Riegl…
S.K.
  • 157
  • 2
  • 10
1
vote
0 answers

Encoding in sjplot by using a Rmd-file (knitR)

I am using the sj packages within R Markdown. However, I am encountering encoding problems. My problem: If you run the following lines, you'll get one cross table with encoding problems and a second cross table, which solves this…
Julian B.
  • 43
  • 5
1
vote
2 answers

sjPlot installation and rlang error in R

I've spent all day trying to install sjPlot and I've been searching the forum + other forums but can't seem to find a solution to my problem. Essentially, when I try to install the sjPlot package, I get the following output: >…
mmarttin
  • 11
  • 3
1
vote
1 answer

R: Encoding of labelled data and knit to html problems

First of all, sorry for not providing a reproducible example and posting images, a word of explanation why I did it is at the end. I'd really appreciate some help - comments or otherwise, I think I did my best to be as specific and concise as I…
blazej
  • 1,678
  • 3
  • 19
  • 41
1
vote
1 answer

sjplot for Poissson regression with an offset term

I was wondering if anyone knows whether sjPlot can be used for a Poisson model with an offset term. I tried to do that and I received a message saying that it cannot find the name of offset term. Any help would be appreciated! M
mikip
  • 13
  • 3
1
vote
0 answers

sjPlot glmer - how to plot standard error instead of CI bands?

I've run glmer and can happily plot predicted values for fixed effects interactions. I'd like to see the error band representing std error instead of confidence interval. Is there a way to do this? So far, I've run: model1 <- glmer (choseG ~ group…
1
vote
0 answers

Probability plots for logistic regression estimated with survey/svyglm including polynoms

I'm trying to visualize a second-order polynomial in a logistic regression model estimated with the svyglm command in R's survey package to account for survey weights. In particular, I'm searching for conditional effect and probability plots.…
SnyderSeb
  • 11
  • 1