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
0 answers

Add raw data points to jp.int (sjPlot)

For my manuscript, I plotted a lme with an interaction of two continuous variables: Create data mydata <- data.frame( SID=sample(1:150,400,replace=TRUE),age=sample(50:70,400,replace=TRUE), sex=sample(c("Male","Female"),200, replace=TRUE),time=…
user6121484
  • 143
  • 2
  • 15
1
vote
0 answers

Error in sjp.grpfrq and sjt.grpmean command in sjPlot package. Different result

I am trying to create different kind of variables to teach basic statistic, i am doing analysis considering a numeric variable and a categorical variable. i start creating my variables: f is the factor and x is numeric. f <-…
Victor Espinoza
  • 318
  • 1
  • 9
1
vote
1 answer

axis.title = is not working in sjp.lmer() in the sjPlot package

I'm doing some plotting of some mixed models I've been running and am pulling my hair out trying to make sjp.lmer() change the x and y axis labels of a fixed effect. If I'm missing something simple, please let me know! This is my…
Cole Robertson
  • 599
  • 1
  • 7
  • 18
1
vote
1 answer

sjp.likert command in sjplot, factor or numeric?, why two different results?

I am obtaining 2 different results from my data using the sjp.likert command, this is my code: library(sjPlot) l <- c(1,2,2,2,3,3,4,4,5,5,5,4,3,2,2) lab <- c("strongly not agree", "not agree", "Neutral", "Agree", …
Victor Espinoza
  • 318
  • 1
  • 9
1
vote
1 answer

R: sjp.glmer changing x-axis lim, y-axis label from percentage to decimal, and confidence band colors

I've been using the sjPlot package in R for a while and I'm thoroughly enjoying it. Recently however, I've run into some problems that I can't figure myself. (1) Using sjp.glmer(fe.prob), the x-axis labels/spacing seems to be derived from the…
Sakuski
  • 13
  • 3
1
vote
1 answer

crosstab output getting displayed in viewer pane only and not in Shiny app

I am generating a cross table output (contingency table). My requirement is to have column percentages along with row and column totals. I found this package "sjPlot" which gives very good output with colour features and was meeting my requirement.…
user1412
  • 709
  • 1
  • 8
  • 25
1
vote
1 answer

Curvilinear plots with sjplot

I have a mixed model (using nlme) with time and time quadratic (time2). How can I let sjp.int (of sjplot) ask to plot it curvilinear? model = lme(MR ~ Age* time + sex*time + ed* time+ time* HMD+time2*HMD, random=~1|subject,…
user6121484
  • 143
  • 2
  • 15
1
vote
1 answer

save multiple plots r into separate jpg

Dear Stackoverflow'ers! I have simple database, app. 130 variables, 1500 records and lots of similar plots to create. I try to avoid save them by hand. The for loop works perfectly for plots (in RStudio). Here are the data as .csv on dropbox. data…
Maciej B.
  • 373
  • 1
  • 4
  • 13
1
vote
0 answers

Update to version 3.3.0 gives problems with car and sjPlot

today I upgraded to R 3.3.0... oh boy.. wish I stayed at the previous version. The last few hours I have been trying to solve some issues to install car and sjPlot, but problems remain. When installing sjPlot everything goes fine, but when setting…
user6121484
  • 143
  • 2
  • 15
1
vote
0 answers

sjPlot CSS not rendering in Knitr spin() Doc

I am trying to integrate sjPlot's lmer html table into a knitr html document compiled with spin() but in rendering the css is lost. I am following instructions here: http://www.strengejacke.de/sjPlot/sjt.lmer/. Here is my code: #+…
1
vote
1 answer

How to add an expression to the title of sjp.grpfrq function

How can I generate a title like this for sjp.grpfrq function? As example, I can generate a text like that with: plot.new() a <- TeX(sprintf("%s (%s, $N_{HIGH}$=%d/$N_{TOTAL}$=%d)", "Whatever", "Blah", 10, 20)) text(0.5,0.5,a) But I cannot use…
user2641103
  • 704
  • 9
  • 25
1
vote
1 answer

ggplot: showing % instead of counts in charts of categorical variables with multiple levels

I would like to create a barplot like this: library(ggplot2) # Dodged bar charts ggplot(diamonds, aes(clarity, fill=cut)) + geom_bar(position="dodge") However, instead of counts, I want to have the percentage of observations falling into each…
grueb
  • 123
  • 11
1
vote
1 answer

How to get two likert variables properly into one (ggplot2) sj.likert plot of the sjPlot package?

I have a dataframe with two likert variables. I want to plot these two variables by using the sjp.likert function of the sjPlot package. The plot doesn't make sense. My data (mydf) looks like this: structure(list(var1 = c(1, 1, 5, NA, 3, NA, 1, NA,…
rdatasculptor
  • 8,112
  • 14
  • 56
  • 81
0
votes
1 answer

How to plot two glms in one plot with double axis?

Imagine that I have the sample data below: RespVar1 <- runif(n=18, min=55, max=120) RespVar2 <- runif(n=18, min=0.3, max=0.5) PredVar <- c(-2, -1, 0, 1, 2, 3) df <- data.frame(RespVar1, RespVar2, PredVar) Where I run these models: M1 <-…
Teresa
  • 15
  • 3
0
votes
1 answer

Add legend to sjPlot model outputs modified with ggplot_build

I have two models, and I want to plot their estimates (using sjPlot), combining them in one plot. I create my models: data(iris) mod1 <- glmmTMB::glmmTMB(Sepal.Length ~ Petal.Length + Petal.Width + (1|Species), data =…
LT17
  • 227
  • 1
  • 8