[R] Composite index reliability questions - cronbach()

Jim Lemon drjimlemon at gmail.com
Sat Sep 5 13:23:30 CEST 2015

Hi Nick,
If you haven't just made a typo on your example in QUESTION 2, the "This
doesn't" line should read:


Without the quotes, R looks for three objects named Q1, Q2 and Q3 and
probably doesn't find them.


On Sat, Sep 5, 2015 at 7:27 AM, Nick Petschek <nick.petschek at gmail.com>

> Hi All,
> 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
> using cronbach().
> 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
> do:
> *cronbach(jdc[,1:3])*
> 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")]*
> *cronbach(trust)*
> 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.
> Nick
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list