Likert-Plots and Grouped Likert-Plots #Rstats - R-Bloggers

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

R news and tutorials contributed by (750) R bloggers

Home
About
RSS
add your blog!
Learn R
R jobs���
Contact us

Welcome!
Follow @rbloggers 74.8K

Here you will find daily


news and tutorials
about R, contributed by
over 750 bloggers.
There are many ways to
follow us -
By e-mail:
Your e-mail here
Subscribe

On Facebook:
R blog…
76 mil curtidas

Curtir Página

Seja o primeiro de seus


amigos a curtir isso.

If you are an R blogger


yourself you are invited
to add your own R
content feed to this site
(Non-English R
bloggers should add
themselves- here)

Jobs for R-
users
Customer Success
Representative
Movement
Building Analyst
Business
Intelligence
Analyst
Innovation Fellow
Postdoctoral
position Stats,
Comp. Biol. @
Madrid, Spain.

Recent Posts
Create Animation
in R : Learn by
Examples
Predicting Car
Battery Failure
With R And H2O
– Study
Practical Data
Science with R,
half off sale!
Rstudio & ThinkR
roadshow – June 6
– Paris
[R]eady for
Production: a
Joint Event with
RStudio and
EODA
Royal Society of
Biology:
Introduction to
Reproducible
Analyses in R
Spotlight on: Julia
Silge, Stack
Overflow
Comparing
Frequentist,
Bayesian and
Simulation
methods and
conclusions
Analysing the
HIV pandemic,
Part 4:
Classification of
lab samples
MRAN snapshots,
and you
Deep (learning)
like Jacques
Cousteau – Part 5
– Vector addition
New Color Palette
for R
Easy quick PCA
analysis in R
Create a CLI for R
with npm
Bug when
Creating
Reference Maps
with Choroplethr

Other sites
SAS blogs
Jobs for R-users

Likert-plots and grouped Likert-


plots #rstats
May 8, 2019
By Daniel

Like 230 Share Share

(This article was first published on R – Strenge Jacke!, and kindly contributed to R-
bloggers)

 Share  Tweet

I’m pleased to anounce an update of my sjPlot-package, a package for


Data Visualization for Statistics in Social Science. Thanks to the help
of Alexander, it is now possible to create grouped Likert-plots. This is
what I want to show in this post…

First, we load the required packages and sample data. We want to plot
several items from an index, where all these items are 4-point Likert
scales. The items deal with coping of family caregivers, i.e. how well
they cope with their role of caring for an older relative.

To find the required variables in the data set, we search all variables
for a specific pattern. We know that the variables from the COPE-
index all have a cop in their variable name. We can easily search for
variables in a data set with the find_var()-function.

1 library(sjPlot)
2 library(sjmisc)
3 data(efc)
4
5 # find all variables from COPE-Index, which al
6 # have a "cop" in their variable name, and the
7 # plot the items as likert-plot
8 mydf <- find_var(efc, pattern = "cop", out = "
9 plot_likert(mydf)

The plot is not perfect, because for those values with just a few
answers, we have overlapping values. However, there are quite some
options to tweak the plot. For instance, we can increase the axis-range
(grid.range), show cumulative percentage-values only at the ende of
the bars (values = "sum.outside") and show the percentage-sign
(show.prc.sign = TRUE).

1 plot_likert(
2 mydf,
3 grid.range = c(1.2, 1.4),
4 expand.grid = FALSE,
5 values = "sum.outside",
6 show.prc.sign = TRUE
7 )

The interesting question is, whether we can reduce the dimensions of


this scale and try to extract principle components, in order to group
single items into different sub-scales. To do that, we first run a PCA on
the data. This can be done, e.g., with sjt.pca() or sjp.pca().

1 # creates a HTML-table of the results of an PC


2 sjt.pca(mydf)

Principal Component Analysis


Component Component
1 2

do you feel you cope well as caregiver? 0.29 0.60


do you find caregiving too demanding? -0.60 -0.42
does caregiving cause difficulties in
-0.69 -0.16
your relationship with your friends?
does caregiving have negative effect on
-0.73 -0.12
your physical health?
does caregiving cause difficulties in -0.64 -0.01
your relationship with your family?
does caregiving cause financial
-0.69 0.12
difficulties?
do you feel trapped in your role as
-0.68 -0.38
caregiver?
do you feel supported by
-0.07 0.64
friends/neighbours?
do you feel caregiving worthwhile? 0.07 0.75

Cronbach’s α 0.78 0.45

varimax-rotation

As we can see, six items are associated with component one, while
three items mainly load on the second component. The indices that
indicate which items is associated with which component is returned
by the function in the element $factor.index. So we save this in an
object that can be used to create a grouped Likert-plot.

1 groups <- sjt.pca(mydf)$factor.index


2 plot_likert(mydf, groups = groups, values = "s

There are even mote options to tweak the Likert-plots. Find the full
documentation at
https://strengejacke.github.io/sjPlot/index.html.

 Share  Tweet

To leave a comment for the author, please follow the link and comment on their blog:
R – Strenge Jacke!.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such
as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation),
programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping)
statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site?
Choose your flavor: e-mail, twitter, RSS, or facebook...
Like 230 Share Tweet Share

Comments are closed.

Search R-bloggers
Search.. Go

Most visited articles of the


week
1. How to write the first for loop in R
2. R Studio Shortcuts and Tips – part 2
3. Learning R: The Ultimate Introduction
(incl. Machine Learning!)
4. Modern Data Science with R: A review
5. 5 Ways to Subset a Data Frame in R
6. Part 2: Simple EDA in R with inspectdf
7. R – Sorting a data frame by the contents
of a column
8. Using apply, sapply, lapply in R
9. Installing R packages

Sponsors
Our ads respect your privacy. Read our
Privacy Policy page to learn more.

Contact us if you wish to help support R-


bloggers, and place your banner here.

Jobs for R users


Customer Success Representative
Movement Building Analyst
Business Intelligence Analyst
Innovation Fellow
Postdoctoral position Stats, Comp. Biol.
@ Madrid, Spain.
Lead Data Scientist @ Washington,
District of Columbia, U.S.
PhD Fellowship @ Wallace University,
US
Full list of contributing R-bloggers
R-bloggers was founded by Tal Galili, with gratitude to the R community.
Is powered by WordPress using a bavotasan.com design.
Copyright © 2019 R-bloggers. All Rights Reserved. Terms and Conditions for this website

You might also like