Introduction

The goal of this research project is to measure the level of self-compassion as well as the self-care of BSW and MSW students in a Social Work Program at a regional University. We will be using the following two reliable and validated instruments to measure their level of self-compassion and self-care as they immerse themselves in the helping profession. We hope to see how the SC of the students correlates to other independent variables i.e. undergrad/grad program social work, age, education level, religiosity, spirituality, gender, etc.

  1. The Self-Compassion Scale
  2. The Gratitude Questionnaire

The purpose of our research is to study the perception of self-compassion in social work students and how it can link to self-care as well as success in the social work program and field. This will help provide students with self-care practices during their training to thrive in the profession in the future.

Data Management and Analyzing Survey Instruments


The next chart illustrates the data management workflow to create the analytic data set.

The original survey data have three components, a self-compassion scale and gratitude questionnaire instruments, and some demographic questions.

The three components have different portions of missing values. We split the original data set into three subsets of data and impute the missing values related to the self-compassion and gratitude data based on the survey instruments. Since there are only a few missing values, we replace the missing values in each survey question with the mode of the associated survey item. We create indexes of the two instruments separately to aggregate the information in the two survey data sets.

Since R does not have a function to find the model of a given data set, I write the following function to find the model of a data set.

We will perform both principal component analysis (PCA) and exploratory factor analysis (EFA).

Handling Missing Values Self-Compassion Instrument

This instrument contains only the data associated with the 12 items in the survey instrument. In the original data file, the 12 variables are named Q2_1, Q2_2, …, Q2_12. We impute the missing value by replacing the missing value in each of the 12 items with the mode of the corresponding survey items. Since there are only a few missing values in this instrument, this imputation will not impact the subsequent PCA and EFA.

Handling Missing Values in Gratitude Scale

The gratitude questionnaire contains only the variables associated with gratitude questions. The variables used in the original data file are Q3_1, Q3_2, …, Q3_6. We use the same mode imputation method to fill in the missing values as used in the above self-compassion survey data. The gratitude questionnaire has even fewer missing values. Any imputation will not impact any subsequent analysis.

Since Likert scales of the Q3_3 and Q3_6 were in reverse order in the design. We transform back the usual order and create a new dataset using the same variable names.

Handling Demographic Variables

The demographic variables have two issues: missing values and imbalance categories. Since the size of the data set is slightly close to 120, imputing missing values in a meaningful way is crucial to maintain the sample size and the statistical power of all subsequent association analyses. About 15 records in the data sets do not have demographic information. Therefore these records were deleted from the final data.

A few missing values occurred in the years of education and employment that are imputed using the auxiliary information in the variables of age, the years of education, and the length of employment.

The major issue of these categorical variables is the imbalance category. The following modifications to the original demographic variables are utilized.

Q8_1 Q8_2 Q8_3 Q8_5 Q8_6 Q9 Q11 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20
21 15.0 0.0 0 5 2 1 1 1 9 4 4 1 3 2
26 21.0 4.0 0 2 2 1 2 2 8 4 6 2 3 3
28 20.0 4.5 0 2 2 1 2 2 9 4 6 2 3 5
30 21.0 7.5 0 2 2 1 1 2 9 6 6 2 3 3
26 6.0 4.0 0 2 2 1 6 2 9 4 7 2 1 3
23 17.0 7.0 1 5 2 1 2 1 9 3 4 1 3 4
29 18.0 0.0 0 0 2 1 6 1 9 6 99 2 1 2
22 17.0 0.0 0 5 2 1 1 2 9 4 4 2 3 2
24 16.0 0.0 0 5 2 1 1 2 8 4 7 2 3 3
18 13.0 0.0 0 3 2 1 1 1 3 4 6 1 3 3
23 18.0 5.0 0 2 2 1 6 2 9 4 6 2 2 3
25 19.0 1.0 0 2 2 1 6 2 10 4 5 2 1 6
25 19.0 7.0 0 2 2 1 6 2 11 4 6 2 1 5
59 20.0 3.5 3 3 2 1 2 2 9 4 4 2 3 6
20 16.0 4.5 6 9 2 1 1 2 2 4 1 1 2 4
46 18.0 24.0 2 4 2 1 4 2 6 4 7 2 3 7
32 16.0 10.5 0 1 2 1 1 2 11 4 4 2 3 7
26 22.0 7.0 0 3 2 1 1 2 9 3 4 2 3 6
26 17.0 3.0 0 2 1 1 2 2 8 4 6 2 2 4
21 16.0 2.5 0 5 2 1 1 2 9 4 3 1 2 4
46 18.0 23.0 3 4 2 1 2 2 9 4 4 2 2 4
32 17.0 4.5 0 3 2 1 1 2 9 4 6 2 3 2
31 20.0 10.0 0 2 2 1 6 2 8 4 7 2 2 5
29 18.0 6.0 0 1 2 1 1 2 11 4 5 2 1 3
31 16.0 10.0 0 2 2 2 6 2 9 3 4 2 3 4
23 20.0 9.0 0 2 2 1 2 2 1 4 7 2 3 6
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0 0 2 2 1 1 2 9 4 6 1 2 5
24 14.0 1.0 0 3 2 1 1 2 8 7 6 1 1 5
48 15.0 20.0 2 4 2 2 2 1 99 3 6 1 3 7
23 18.0 3.0 0 3 2 5 1 2 9 4 6 2 1 6
21 16.0 6.0 0 4 2 1 1 1 9 3 7 1 1 3
30 18.0 10.0 0 1 5 1 1 2 9 6 7 2 2 5
50 19.0 20.0 2 4 2 1 2 2 10 4 6 2 3 4
29 15.0 12.0 0 1 1 1 1 2 9 1 7 1 3 3
55 25.0 35.0 4 3 1 1 2 2 1 4 1 1 2 5
25 19.0 3.0 0 1 2 1 1 2 9 4 7 2 1 3
21 16.0 1.0 0 1 2 1 1 1 11 4 7 1 2 4
21 17.0 2.5 0 5 2 1 1 2 99 4 4 1 3 6
28 18.0 1.5 0 4 2 1 1 1 9 3 4 2 3 7
23 5.0 7.0 0 2 2 1 6 1 2 4 6 2 1 3
32 15.0 12.0 1 3 1 1 2 1 99 3 7 1 1 5
19 1.0 1.0 2 4 2 1 1 2 2 4 4 1 3 3
18 14.0 2.5 0 3 2 1 1 1 9 4 2 1 2 1
19 13.0 0.0 0 4 2 5 6 2 11 4 4 1 3 5
grp.age = Q8_1:  1 = (3,23], 2 = [24, 30],  3 = [31, 59]
grp.edu = Q8_2:    1 = [0,15] associate, 2 = [15.5,18.5] bachelor, 3 = [19, 25]  advdegree
grp.empl = Q8_3:   1 = [0,5]  entry, 2 = [5.5,10] junior, 3 = [10.5, 35]   senior
kid.num = Q8_5: 1 = (0) No child, 2 = at least one child
home.size = Q8_6:  1 = (1), 2 = (2), 3 = 3 or more


Spirituality = Q20: 1 = (1,2,3) low, 2 = (4)   moderate,  3 = (5,6,7) high

We re-define the demographic variables based on the above modification. The modified demographic variables will be used in subsequent modeling.

PCA for Survey Data

In this section, we will aggregate information the the two survey instruments.

Self-compassion Survey

We will keep columns from 1 to 12 and delete the rest in order to maintain the response from the participants for the commpassison survey section

Q2_1 Q2_2 Q2_3 Q2_4 Q2_5 Q2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2
7 7 2 7 7 1
7 7 1 7 7 5
6 3 3 5 7 5
3 4 6 4 2 6
7 7 2 7 7 2
7 6 2 4 6 3
7 7 1 7 7 4
7 7 1 7 7 1
6 3 2 7 7 3
6 5 3 6 7 2
7 7 2 3 7 2
7 7 1 6 7 1
7 7 1 7 7 2
3 5 3 6 6 5
7 6 2 7 7 2
7 7 2 7 7 2
7 6 2 7 7 4
6 6 2 6 7 3
6 6 5 6 6 3
6 6 2 7 7 3
7 7 2 7 7 2
7 6 1 7 7 2
7 7 1 7 7 2
7 7 1 7 6 2
7 6 2 6 7 2
7 7 1 7 7 5
6 4 1 5 6 2
7 7 1 7 7 2
7 6 1 6 6 3
7 6 7 3 7 3
7 7 1 7 7 1
7 7 1 7 7 1
7 7 1 7 5 2
7 7 1 7 7 1
7 6 1 7 6 2
6 6 2 5 5 4
7 7 1 6 6 5
6 4 4 4 6 4
7 7 1 7 7 1
7 7 1 7 6 5
7 7 1 7 7 5
7 7 1 7 7 1
6 6 2 6 7 2
7 7 1 7 7 2
7 6 1 7 7 2
7 7 1 7 7 1
6 5 4 6 6 5
7 7 1 7 7 1
7 6 2 7 7 2
7 7 2 7 7 4
7 7 1 7 6 2
7 7 1 7 7 1
7 6 2 6 6 3
7 7 2 7 7 2
6 6 2 6 7 2
6 6 3 6 7 4
7 7 1 6 7 2
7 6 2 3 7 2
6 7 2 6 5 5
7 7 1 7 7 1
7 7 1 7 7 2
7 7 1 6 7 1
7 6 1 6 7 4
7 7 7 7 7 4
7 6 2 6 7 2
7 6 2 7 7 1

CombinedAnalytics Data

In this section, we combine all three data sets created earlier to define the final analytic data set for statistical analysis.

grp.age grp.edu grp.empl kid.num home.size gender.grp race.grp marital.grp disability.grp religion.grp sexualorientation Trumpsupporters SW.program urbanity spirituality Q3_1 Q3_2 Q3_3 Q3_4 Q3_5 Q3_6 Q2_1 Q2_2 Q2_3 Q2_4 Q2_5 Q2_6 Q2_7 Q2_8 Q2_9 Q2_10 Q2_11 Q2_12
[1,23] Assoc entry No-kid 3+ males/female American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers low 6 6 1 5 6 4 3 4 2 2 5 2 3 3 5 3 4 3
[24,30] Adv.deg entry No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers low 6 5 3 5 5 3 4 2 3 5 2 2 3 3 5 3 4 3
[24,30] Adv.deg entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 6 6 1 7 6 4 4 2 3 2 4 3 3 4 3 3 3 3
[24,30] Adv.deg junior No-kid 1 or 2 males/female American not seperated does not have disability non religious others nonrepublicans graduate students non city dwellers low 7 7 2 7 6 3 4 2 3 4 2 3 4 5 3 99 5 3
[24,30] Assoc entry No-kid 1 or 2 males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 7 7 1 6 7 1 3 3 4 1 4 3 3 2 4 99 3 2
[1,23] Bachelor junior No-kid 3+ males/female American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 5 5 2 3 3 3 1 4 4 5 3 4 4
[24,30] Bachelor entry No-kid 1 or 2 males/female American seperated has disability non religious others nonrepublicans graduate students city dwellers low 6 7 2 7 7 1 5 2 3 5 2 1 2 5 5 3 5 5
[1,23] Bachelor entry No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers low 7 7 1 7 6 2 4 4 5 2 4 3 5 3 3 3 2 2
[24,30] Bachelor entry No-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers low 7 7 1 6 6 2 4 4 3 2 3 3 4 2 4 3 4 3
[1,23] Assoc entry No-kid 3+ males/female American not seperated has disability Forms of Christianity same gender loving orientations nonrepublicans undergrates non city dwellers low 7 7 2 7 7 2 5 4 3 2 3 3 3 4 4 2 3 3
[1,23] Bachelor entry No-kid 1 or 2 males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers low 6 6 2 6 6 2 5 3 4 4 3 1 4 5 5 3 5 3
[24,30] Bachelor entry No-kid 1 or 2 males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers high 6 7 1 7 7 2 5 2 2 5 3 2 3 4 5 3 5 5
[24,30] Bachelor junior No-kid 1 or 2 males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers high 7 7 1 7 7 1 5 4 4 2 4 3 4 5 3 3 4 4
[30,99] Adv.deg entry With-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 6 7 1 1 4 5 1 4 5 4 1 3 1 5 5
[1,23] Bachelor entry With-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations Republicans undergrates non city dwellers high 7 7 2 7 7 1 3 4 4 3 4 4 4 1 4 3 4 2
[30,99] Bachelor senior With-kid 3+ males/female American seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 7 7 1 2 5 5 1 5 5 4 2 2 99 2 1
[30,99] Bachelor senior No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 6 1 6 7 5 4 3 2 4 3 1 4 4 3 2 3 3
[24,30] Adv.deg junior No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 5 3 7 6 2 5 3 3 5 5 2 5 5 5 99 4 3
[24,30] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers high 6 4 4 5 3 4 5 3 4 5 3 1 4 5 4 99 4 4
[1,23] Bachelor entry No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations Republicans undergrates non city dwellers high 7 6 2 6 7 2 3 3 3 2 3 2 4 2 3 3 3 2
[30,99] Bachelor senior With-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 6 6 5 6 7 5 3 4 5 2 3 3 5 3 3 99 3 3
[30,99] Bachelor entry No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers low 6 5 1 6 5 4 2 4 3 4 4 3 2 2 4 3 3 2
[30,99] Adv.deg senior No-kid 1 or 2 males/female American seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 7 6 2 5 3 4 2 4 1 5 5 4 99 5 4
[24,30] Bachelor junior No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 6 7 1 7 7 2 3 5 5 3 3 4 4 1 3 3 2 2
[30,99] Bachelor senior No-kid 1 or 2 males/female non American seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 6 5 2 6 7 3 3 3 2 4 3 2 3 2 4 3 3 2
[1,23] Adv.deg junior No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 7 3 3 4 3 4 3 3 3 3 2 5 3 4 3
[30,99] Bachelor senior With-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 6 5 2 6 6 2 3 3 2 2 4 4 4 4 3 3 3 3
[24,30] Bachelor entry No-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students city dwellers high 7 7 1 7 7 1 4 3 5 4 5 4 5 3 3 5 3 3
[30,99] Bachelor entry No-kid 1 or 2 males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 6 5 1 5 3 4 4 3 3 2 5 4 2 5 5
[24,30] Bachelor junior No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers low 5 5 1 5 4 1 3 4 3 3 4 2 3 4 2 3 4 3
[1,23] Assoc entry With-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 2 7 7 2 4 4 4 4 4 5 5 3 5 5 2 2
[30,99] Bachelor senior With-kid 3+ males/female non American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers low 5 3 5 2 2 5 4 1 3 4 2 1 5 5 5 1 4 5
[30,99] Bachelor senior No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students city dwellers low 6 6 4 6 6 2 5 2 3 4 3 3 3 4 5 3 5 4
[24,30] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability non religious others nonrepublicans undergrates non city dwellers low 6 6 2 5 7 2 3 3 2 4 99 2 3 5 5 99 3 3
[30,99] Bachelor senior With-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 1 3 4 5 1 3 4 4 4 2 3 4 4
[30,99] Bachelor senior No-kid 3+ males/female non American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 2 2 4 5 1 4 4 5 1 1 3 2 1
[30,99] Adv.deg junior With-kid 3+ males/female non American not seperated does not have disability Forms of Christianity same gender loving orientations Republicans graduate students city dwellers high 7 6 7 7 7 6 5 5 5 5 4 3 3 4 5 3 4 5
[30,99] Bachelor senior No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 6 6 2 6 7 2 3 4 4 2 3 3 4 2 3 4 2 3
[24,30] Assoc entry No-kid 1 or 2 males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 7 7 2 7 7 1 2 4 5 3 5 4 5 2 1 4 1 2
[1,23] Bachelor entry With-kid 3+ males/female American not seperated has disability Forms of Christianity same gender loving orientations nonrepublicans undergrates city dwellers high 7 7 1 7 7 5 3 3 3 2 3 2 3 3 4 3 3 3
[1,23] Bachelor junior With-kid 3+ males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates city dwellers low 6 3 3 5 7 5 5 4 3 5 1 2 4 5 5 2 5 4
[24,30] Adv.deg junior No-kid 3+ others American seperated has disability non religious others nonrepublicans undergrates non city dwellers high 3 4 6 4 2 6 5 2 3 5 2 1 1 5 5 2 5 5
[30,99] Bachelor senior No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students city dwellers low 7 7 2 7 7 2 4 2 4 2 4 4 4 5 5 3 4 4
[1,23] Bachelor entry No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 6 2 4 6 3 4 2 4 2 3 3 3 4 3 3 3 3
[30,99] Bachelor junior No-kid 1 or 2 males/female American seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students city dwellers high 7 7 1 7 7 4 2 4 5 2 4 4 5 4 3 4 2 2
[30,99] Bachelor senior No-kid 1 or 2 males/female American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 1 1 4 5 2 3 4 4 3 3 3 3 2
[1,23] Bachelor entry No-kid 3+ males/female American not seperated does not have disability Forms of Christianity others nonrepublicans graduate students city dwellers low 6 3 2 7 7 3 5 3 5 1 3 3 4 4 4 5 3 3
[1,23] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 6 5 3 6 7 2 4 3 4 2 4 3 3 4 4 2 3 2
[24,30] Bachelor junior No-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students city dwellers high 7 7 2 3 7 2 4 2 5 2 3 4 3 5 5 4 5 3
[30,99] Bachelor senior With-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations Republicans graduate students non city dwellers high 7 7 1 6 7 1 4 2 4 3 2 1 3 5 4 3 5 3
[1,23] Bachelor entry No-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 2 2 4 4 1 1 4 5 1 1 2 3 3
[30,99] Bachelor senior With-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers low 3 5 3 6 6 5 3 4 4 4 4 3 4 3 4 4 3 4
[30,99] Bachelor senior No-kid 3+ males/female American seperated has disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 6 2 7 7 2 3 4 4 2 4 4 4 1 2 5 3 2
[1,23] Bachelor junior No-kid 3+ males/female non American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 2 7 7 2 4 3 3 4 3 4 4 3 5 2 4 5
[1,23] Assoc entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations Republicans undergrates non city dwellers high 7 6 2 7 7 4 4 3 3 5 2 1 3 4 5 3 4 3
[24,30] Assoc junior No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates city dwellers high 6 6 2 6 7 3 3 4 4 3 4 4 4 2 3 4 3 2
[24,30] Bachelor junior No-kid 1 or 2 males/female American not seperated has disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 6 6 5 6 6 3 4 4 5 3 3 3 4 3 5 4 3 3
[24,30] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers high 6 6 2 7 7 3 4 4 3 5 3 3 3 5 5 3 4 3
[1,23] Assoc entry No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers low 7 7 2 7 7 2 5 4 4 4 3 4 5 4 3 4 3 2
[30,99] Bachelor senior No-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers high 7 6 1 7 7 2 3 3 3 4 3 3 3 3 4 3 3 3
[24,30] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers high 7 7 1 7 7 2 5 2 2 3 2 2 4 4 4 3 4 2
[1,23] Bachelor junior No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 7 7 1 7 6 2 5 4 3 2 3 2 4 3 4 4 3 3
[24,30] Bachelor junior No-kid 1 or 2 males/female American not seperated has disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 7 6 2 6 7 2 3 4 4 4 4 3 4 4 3 3 3 2
[24,30] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers low 7 7 1 7 7 5 4 2 2 4 3 2 2 5 4 2 4 4
[24,30] Bachelor junior No-kid 1 or 2 males/female American seperated has disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers low 6 4 1 5 6 2 4 4 2 5 2 3 4 4 3 4 5 3
[30,99] Bachelor junior With-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 7 7 2 4 4 4 2 3 3 4 4 2 4 3 3
[24,30] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 6 1 6 6 3 5 3 3 5 1 3 4 5 4 3 4 2
[24,30] Bachelor entry No-kid 3+ others American seperated has disability Forms of Christianity others nonrepublicans graduate students city dwellers high 7 6 7 3 7 3 5 4 2 5 4 2 2 4 5 2 4 4
[24,30] Assoc senior No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans undergrates city dwellers high 7 7 1 7 7 1 4 3 5 3 3 2 5 4 3 3 4 3
[30,99] Assoc senior No-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 7 7 1 5 3 5 4 3 1 2 5 5 1 4 2
[30,99] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability non religious others nonrepublicans graduate students non city dwellers high 7 7 1 7 5 2 2 3 5 1 4 4 4 2 3 5 3 3
[24,30] Bachelor entry No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 7 7 1 2 4 4 1 4 3 3 1 1 5 2 5
[24,30] Bachelor entry No-kid 1 or 2 males/female non American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 7 6 1 7 6 2 5 3 4 3 3 3 3 3 4 4 3 3
[1,23] Assoc entry No-kid 3+ males/female American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 6 6 2 5 5 4 4 3 4 3 3 4 4 5 5 3 3 2
[24,30] Adv.deg junior No-kid 1 or 2 males/female American seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans graduate students non city dwellers low 7 7 1 6 6 5 5 3 3 4 2 2 3 5 5 2 4 4
[30,99] Bachelor senior No-kid 3+ males/female American not seperated has disability non religious same gender loving orientations nonrepublicans graduate students city dwellers high 6 4 4 4 6 4 3 4 4 4 4 3 4 4 2 4 4 4
[1,23] Assoc entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 1 4 5 4 2 3 5 3 2 5 4 3 3
[30,99] Adv.deg junior No-kid 1 or 2 males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers low 7 7 1 7 6 5 4 3 2 5 4 3 4 5 5 3 5 5
[24,30] Bachelor entry No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 7 7 5 4 3 4 1 5 4 5 4 3 3 3 2
[24,30] Bachelor senior No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 1 4 3 3 3 5 4 5 3 3 4 3 3
[24,30] Assoc entry No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans undergrates non city dwellers low 6 6 2 6 7 2 3 3 2 4 2 1 5 5 5 1 4 4
[1,23] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations Republicans graduate students non city dwellers high 7 7 1 7 7 2 3 5 4 5 4 5 5 3 3 4 3 3
[1,23] Assoc entry No-kid 1 or 2 males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans undergrates non city dwellers low 7 6 1 7 7 2 5 4 4 2 3 5 4 4 5 3 2 2
[30,99] Assoc junior With-kid 3+ males/female American seperated does not have disability non religious same gender loving orientations Republicans undergrates non city dwellers high 7 7 1 7 7 1 3 2 3 2 3 2 3 3 3 3 3 2
[30,99] Assoc junior With-kid 1 or 2 males/female American seperated has disability Forms of Christianity others nonrepublicans undergrates city dwellers low 6 5 4 6 6 5 3 4 4 3 4 4 4 3 3 4 2 3
[30,99] Assoc senior With-kid 1 or 2 males/female American seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 1 2 4 4 2 4 4 3 2 3 4 3 2
[1,23] Assoc entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 6 2 7 7 2 4 4 4 1 4 3 4 3 5 3 4 3
[24,30] Assoc entry No-kid 3+ males/female American not seperated does not have disability Forms of Christianity others nonrepublicans undergrates city dwellers high 7 7 2 7 7 4 4 3 4 2 3 4 2 2 4 3 4 3
[30,99] Assoc senior With-kid 3+ males/female non American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 6 2 4 2 3 1 2 1 5 4 5 3 5 1
[1,23] Bachelor entry No-kid 3+ males/female non American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers high 7 7 1 7 7 1 5 5 4 4 4 5 4 3 4 4 4 3
[1,23] Bachelor junior No-kid 3+ males/female American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates city dwellers low 7 6 2 6 6 3 4 3 4 4 5 4 5 4 4 3 3 2
[24,30] Bachelor senior No-kid 1 or 2 others American not seperated does not have disability non religious others nonrepublicans graduate students non city dwellers high 7 7 2 7 7 2 3 2 5 2 4 3 4 3 4 2 4 3
[30,99] Bachelor senior With-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 6 6 2 6 7 2 1 4 4 1 5 4 4 1 1 4 1 1
[24,30] Assoc senior No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers low 6 6 3 6 7 4 5 2 3 4 2 2 3 5 5 2 5 4
[30,99] Adv.deg senior With-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations Republicans undergrates non city dwellers high 7 7 1 6 7 2 5 5 5 2 5 3 5 3 2 5 2 2
[24,30] Bachelor entry No-kid 1 or 2 males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans graduate students city dwellers low 7 6 2 3 7 2 3 2 3 3 3 2 2 4 4 2 5 5
[1,23] Bachelor entry No-kid 1 or 2 males/female American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 6 7 2 6 5 5 5 4 3 5 4 2 3 4 4 3 4 5
[1,23] Bachelor entry No-kid 3+ males/female American not seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 7 1 7 7 1 3 5 5 2 4 4 5 4 3 3 3 1
[24,30] Bachelor entry No-kid 3+ males/female American not seperated has disability non religious same gender loving orientations nonrepublicans graduate students non city dwellers high 7 7 1 7 7 2 4 4 4 5 5 3 4 4 5 2 5 4
[1,23] Assoc junior No-kid 1 or 2 males/female American seperated has disability Forms of Christianity same gender loving orientations nonrepublicans graduate students city dwellers low 7 7 1 6 7 1 3 2 2 1 3 3 3 1 4 2 4 2
[30,99] Assoc senior No-kid 3+ males/female American not seperated has disability non religious same gender loving orientations nonrepublicans undergrates city dwellers high 7 6 1 6 7 4 4 4 4 3 3 2 5 3 5 4 4 3
[1,23] Assoc entry With-kid 3+ males/female American not seperated does not have disability Forms of Christianity same gender loving orientations nonrepublicans undergrates non city dwellers low 7 7 7 7 7 4 4 3 3 4 3 2 3 3 3 3 4 3
[1,23] Assoc entry No-kid 3+ males/female American not seperated has disability non religious same gender loving orientations Republicans undergrates non city dwellers low 7 6 2 6 7 2 3 4 5 5 4 2 2 4 5 4 4 2
[1,23] Assoc entry No-kid 3+ males/female non American seperated does not have disability non religious same gender loving orientations nonrepublicans undergrates non city dwellers high 7 6 2 7 7 1 3 4 5 3 3 3 4 2 2 2 2 1

PCA for instrument

Here, we perform principal component analysis and exploratory factor analysis.

Self compassion index

Next, we extract the self-compassion index in the following code

pca <- prcomp(compassion, center = TRUE, scale = TRUE)
sc.idx.1 = pca$x[,1]   #This is the principle component
sc.idx.2 = pca$x[,2] 
sc.idx.3 = pca$x[,3]   
sc.idx.4 = pca$x[,4] 
sc.idx.5 = pca$x[,5]   
sc.idx.6 = pca$x[,6] 
sc.idx.7 = pca$x[,7]   
sc.idx.8 = pca$x[,8] 
sc.idx.9 = pca$x[,9] 
sc.idx.10 = pca$x[,10]   
sc.idx.11 = pca$x[,11] 
sc.idx.12 = pca$x[,12]   

Gratitude Questionaire

In this section, we perform the same analysis on the gratitude survey instrument.

gr.pca <- prcomp(gratitude.new, center = TRUE, scale = TRUE)
gr.idx.1 = gr.pca$x[,1]
gr.idx.2 = gr.pca$x[,2]
gr.idx.3 = gr.pca$x[,3]
gr.idx.4 = gr.pca$x[,4]
gr.idx.5 = gr.pca$x[,5]
gr.idx.6 = gr.pca$x[,6]

Summary

next we will combine all the columns of the gratitude index scores and self compassion index scores with the columns from the previous created datasets. Lastly, we will write this new combined dataset into an excelfile that will go into our working directory.

final.analytic.data = new.demographics #renamed the dataframe
final.analytic.data$sc.idx.1=sc.idx.1                                         
final.analytic.data$sc.idx.2=sc.idx.2
final.analytic.data$sc.idx.3=sc.idx.3                                        
final.analytic.data$sc.idx.4=sc.idx.4
final.analytic.data$sc.idx.5=sc.idx.5                                         
final.analytic.data$sc.idx.6=sc.idx.6
final.analytic.data$sc.idx.7=sc.idx.7                                        
final.analytic.data$sc.idx.8=sc.idx.8
final.analytic.data$sc.idx.9=sc.idx.9
final.analytic.data$sc.idx.10=sc.idx.10                                         
final.analytic.data$sc.idx.11=sc.idx.11
final.analytic.data$sc.idx.12=sc.idx.12                                        
final.analytic.data$gr.idx.1=gr.idx.1
final.analytic.data$gr.idx.2=gr.idx.2
final.analytic.data$gr.idx.3=gr.idx.3
final.analytic.data$gr.idx.4=gr.idx.4
final.analytic.data$gr.idx.5=gr.idx.5
final.analytic.data$gr.idx.6=gr.idx.6
# final.analytic.data
## wrote the final analytic data frame to local drive in a csv format.
write.csv(final.analytic.data,'w09-analytic-data-Version02.csv')