Session Ready
Exercise

The Humor Styles Questionnaire dataset

Two data frames - hsq and hsq_correl - have been loaded. hsq contains the Humor Styles Questionnaire [HSQ] dataset, which includes responses from 1071 participants on 32 questions. We also calculated the polychoric correlation for you using the mixedCor() function of the psych package:

hsq_correl <- mixedCor(humor_styles, c=NULL, p=1:32)

Polychoric correlation is the correlation between ordinal variables. Above, we indicated that columns 1 to 32 are ordinal by specifying p, and that there are no numeric variables by setting c to NULL.

Another way of calculating polychoric correlations is by using the hetcor() function of the polycor package. It stores the correlation matrix in the correlations attribute of the calculated object.

Instructions
100 XP
  • Since hsq is already loaded on your workspace, go ahead and check out its dimensionality.
  • Now, let's inspect the structure of the correlation object hsq_correl.
  • Get the correlation matrix by calling the relevant attribute of hsq_correl and store its value to hsq_polychoric.
  • Check on the colored representation of the correlation matrix of hsq_polychoric with the help of the ggcorrplot package, and get an intuition as to whether the dataset could potentially be factored.