I am working on a report that will display the results of some Likert scale data. I want to use the skim() function from the skimr package to utilize the spark graphs/histogram visual. The issue is that my response options range from 1 to 5 on each question, but some of my questions only collected responses in the 3 to 5 range (response options 1 and 2 were not selected). The histogram shows five columns and the range seems to represent 3, 3.5, 4, 4.5, 5 rather than from 1 to 5. How do I tell skimr to display option 1 through 5? Thanks for any help in advance.
Example:
Data:
Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8
1 3 3 3 1 3 4 4
5 5 5 4 2 5 5 5
5 5 5 5 5 5 5 5
5 5 5 4 2 5 5 5
5 5 5 4 2 5 5 5
I use the following code:
skim(Data)
I want the historgrams ("hist"column) to show Reponses 1 through 5. But for variables 2,3,4, 6,7,8 it is only showing values of 3 or 4 through 5. Is there any way to adjust this?
You seem to have a bit of a misconception.
Let's take your unchanged data in the form of
tibbleand put it in theskimfunction.We get this on the output
However, you do write that your data is on the Likert scale. And for such data it makes no sense to count the mean, standard deviation, etc. because what does it mean that the average for the variable
Var1is 4.2? I can't interpret it.Then we have to mutate all variables to the factor type.
output
It makes a little more sense now. It can be seen that for the variable
Var1we have 4 answers5, one answer1and zero remaining, regardless of what the answer type5means.However, there are no histograms now. Well, we can easily produce them ourselves.
Finally, a little hint. When working with data, call it more meaningful. Enter the same values according to your scale. So I changed your variables a bit to questions and the answer values to the following levels "definitely yes, yes, I don't know, no, definitely not".
output
Now your histogram will be much clearer, don't you think?