You are on page 1of 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/276025643

Likert Scales in R - Scale Package Tutorial

Research · May 2015


DOI: 10.13140/RG.2.1.4319.3764

CITATIONS READS
0 2,884

1 author:

Nina Giallousi
Independent
7 PUBLICATIONS   0 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Automatic Item Generation View project

Item Analysis View project

All content following this page was uploaded by Nina Giallousi on 09 May 2015.

The user has requested enhancement of the downloaded file.


Likert Scale Construction in R
Nikolaos Giallousis
Sunday, May 03, 2015

This is a guide to conducting Item Analysis on Likert data. R will need some libraries to work out the
following examples, so make sure you run the following lines in your computer.

install.packages("xlsx")
install.packages("foreign")
install.packages("psych")
install.packages("Hmisc")
install.packages("Scale")

Loading the Scale Library


In order to use the Scale library, you should load it, using the following line.

library(Scale)

Reading in Data

From Excel

library(xlsx)
my_data <- read.xlsx("YouDataFileHere.xlsx", sheetIndex=1)

From SPSS

library(foreign)
my_data <- read.spss("YourDataFileHere.sav", to.data.frame=T)

Minimal Example
If your questionnaire has no reverse items and it has not been administered in various re-orderings of items,
then you can proceed as follows:

my_scale <- Scale(my_data)

1
Re-Ordered Items
If you have administered your questionnaire in one ore more reorderings - and you know which! - you can pass
them to the orders argument, enclosed in c(), separated by commas. If you have more than one reorderings,
you should use a list() to wrap them up. You also need to provide an orders_id argument, i.e. a c() of
integers indicating which order was administered to each participant.

my_scale <- Scale(data=my_data,


orders=list(
# Half of the questionnaires were
# administered in this order.
c(16,19,11,9,1,17,5,18,4,8,2,12,
20,10,14,6,3,13,15,7),
# The second half was administered in
# this one:
c(1,18,4,15,7,8,3,14,20,6,19,16,
12,5,10,13,2,17,11,9)),
orders_id=c(
# participants 1 through 49 received the
# first order
rep(1, 49), # repeat "1" 49 times
# participants 50 through 98 received the
# second one: these are 49 people, who
# all got the second order, thus:
rep(2, 49)), # repeat "2" 49 times
)

Reverse Items
If you have reverse items in the questionnaire, you can pass them to the reverse argument. It needs to be a
c() of integers, indicating the position of the items in the original order.

my_scale <- Scale(my_data, reverse=c(3,4,13,14,18,20))

Adding Item Labels


You may add some labels to be used for items in the data.frame() to be constructed by the Scale library.
If you want to name the items in a repetitive form, you can use the paste() function, in order to spare some
typing.

my_scale <- Scale(my_data, col_names= paste('q', 1:20, sep=''))


# "paste" will create a vector such as c("q1", "q2", ..., "q20")

2
Pre-processing Data
Now, all the work and thought you have put into your questionnaire pays off. You don’t have to do anything
complicated from now on. To pre-process your data, just type:

my_scale_pr <- PreProc(my_scale)

Doing the Analysis


In order to get the Item Analysis, you only need to pass the preprocessed object to the ItemAnalysis()
function:

my_scale_it <- ItemAnalysis(my_scale_pr)

Getting the Report


Pass the output of ItemAnalysis() to ReportTable().

my_table <- ReportTable(my_scale_it)

Item Corr. to scale Factor Loading Mean SD


q12 0.610 0.654 2.245 1.149
q11 0.488 0.547 1.357 0.707
q9 0.464 0.535 2.541 1.067
q5 0.467 0.517 1.878 1.096
q20 0.441 0.511 2.194 0.881
q2 0.433 0.500 1.402 0.862
q18 0.406 0.500 2.633 1.161
q7 0.426 0.482 2.908 1.094
q10 0.430 0.473 2.500 1.318
q14 0.408 0.473 2.357 0.900
q17 0.408 0.458 2.816 1.255
q16 0.410 0.452 2.765 1.275
q6 0.383 0.435 3.000 1.244
q8 0.373 0.432 1.357 0.840
q19 0.383 0.426 2.827 1.276
q13 0.383 0.417 2.330 1.018
q4 0.360 0.411 2.582 1.175
q15 0.315 0.340 2.929 1.221
q3 0.244 0.290 2.286 1.339
q1 0.197 0.227 2.806 1.274

Excluding Items
Either because the program suggested it, or because you studied the report yourself and decided to, you may
want to repeat the analysis without specific items. You can do so by adding an exclude argument.

3
my_scale_it <- ItemAnalysis(my_scale_pr, exclude=c(1, 3, 15))
print(my_scale_it)

Show Best Items


Now that you have an ItemAnalysis object, created by the ItemAnalysis() function, you can use it in a
number of follow-up functions, in order to proceed with your scale construction.

# This will return the label of the best items.


# The labels must have been defined in advance, when creating the ScaleData object.
best_items <- ChooseBest(my_scale_it)
print(best_items)

# This will show the labels and the contents of the items, provided a text
# file with item statements has been defined, when creating the ScaleData object.
items_content <- ShowItems(my_scale_it)
print(items_content)

Get Scores
There is no use in constructing a scale if you don’t score people with it. So, in order to get the scores of the
people in your data set, just use:

my_scores <- GetScores(my_scale_it)


print(my_scores)

Write Outputs in a File


You can write the output either of the report or the scores into a .csv file. All post-analysis functions,
(ReportTable(), GetScores() and ShowItems()) will accept a write_file=TRUE argument, which will write
the output in a file. See the functions’ help files for more options.)

my_table <- ReportTable(my_scale_it, write_file=TRUE)


my_scores <- GetScores(my_scale_it, write_file=TRUE)
my_items <- ShowItems(my_scale_it, write_file=TRUE)

Conclusion
The Scale package has the purpose of quickly giving you the common practice indices of reliability and validity,
in order to facilitate you constructing a scale and use it. So, if your instrument exhibits good properties, go
out and use it. If not - well you know what you have to do!

View publication stats

You might also like