[R] Composite index reliability questions - cronbach()
nick.petschek at gmail.com
Fri Sep 4 23:27:46 CEST 2015
I have two questions on using cronbach() from the psy() package.
My simplified situation is the following: I have a survey of 10 questions
(column names are "Q1", "Q2", etc.) that went out to 100+ people. I have
the responses to the questions, plus additional variables (demographics,
location, etc.) in a data frame (named "JDC"). I want to build composite
indices from these 10 questions. I plan to use two steps to create the
indices. First, grouping the questions by what makes intuitive sense given
what they ask, and second, by testing the reliability of these groupings
Let's say I think Q1, Q3, and Q5 will make a good index. With my limited
knowledge of R, I would think there's a way to say "run the reliability on
these three variables in this dataframe". However, I have so far only been
able to test the reliability of *adjacent *variables. For example, I could
to test Q1, Q2, and Q3. Is there a way to test non-adjacent variables?
I realize I could do something like:
*trust <- jdc[, c("Q2", "Q7", "Q8")]*
but that adds a few extra steps, and I have tons of questions and indices
which would make that very cumbersome, especially since I will go through
several iterations in testing potential indices.
Is there a way to refer to the column name when using cronbach(), instead
of just the location of the variable? For example:
This works: *cronbach(jdc[,1:3])*
This doesn't:* cronbach(jdc[Q1, Q2, Q3])*
Thanks in advance for any insights, answers, words of encouragement, or
alternate ways I could solve this puzzle.
[[alternative HTML version deleted]]
More information about the R-help