biopsykit.questionnaires package

Module with functions and utility functions to compute questionnaires.

biopsykit.questionnaires.abi(data, columns=None)[source]

Compute the Angstbewältigungsinventar (ABI) (Anxiety Management Inventory).

The ABI measures two key personality constructs in the area of stress or anxiety management: Vigilance (VIG) and Cognitive Avoidance (KOV). VIG is defined as a class of coping strategies whose use aims to, to reduce uncertainty in threatening situations. In contrast, KOV refers to strategies aimed at shielding the organism from arousal-inducing stimuli.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

ABI score

Return type

DataFrame

Raises

References

Krohne, H. W., Egloff, B., Das, A. I., Angstbewältigung, B. D. S. B., & VIG, V. (1999). Das Angstbewältigungs-Inventar (ABI). Frankfurt am Main.

biopsykit.questionnaires.abi_ms(data, columns=None, subscales=None)[source]

Compute the Angstbewältigungsinventar für medizinische Situationen (ABI-MS).

The ABI-MS is a situation-response inventory designed to measure habitual preferences for the use of cognitive avoidant and vigilant coping strategies in potentially threatening medical contexts.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Cognitive Avoidance - Specific Factor 1 (KOG_1): [1, 4, 5, 7],

  • Cognitive Avoidance - Specific Factor 2 (KOG_2): [9, 11, 14, 16]

  • Cognitive Avoidance - Specific Factor 3 (KOG_3): [17, 19, 21, 23]

  • Cognitive Avoidance - Specific Factor 4 (KOG_4): [25, 27, 28, 31]

  • Vigilance - Specific Factor 1 (VIG_1): [2, 3, 6, 8]

  • Vigilance - Specific Factor 2 (VIG_2): [10, 12, 13, 17]

  • Vigilance - Specific Factor 3 (VIG_3): [18, 20, 22, 24]

  • Vigilance - Specific Factor 4 (VIG_4): [26, 29, 30, 32]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

ABI-MS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Sturmbauer, S. C., Hock, M., Rathner, E. M., & Schwerdtfeger, A. R. (2019). Das Angstbewältigungsinventar für medizinische Situationen (ABI-MS). Diagnostica.

biopsykit.questionnaires.ads_l(data, columns=None)[source]

Compute the Allgemeine Depressionsskala - Langform (ADS-L) (General Depression Scale - Long Version).

The General Depression Scale (ADS) is a self-report instrument that can be used to assess the impairment caused by depressive symptoms within the last week. Emotional, motivational, cognitive, somatic as well as motor symptoms are assessed, motivational, cognitive, somatic, and motor/interactional complaints.

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

ADS-L score

Return type

DataFrame

Raises

References

Meyer, T. D., & Hautzinger, M. (2001). Allgemeine Depressions-Skala (ADS). Normierung an Minderjährigen und Erweiterung zur Erfassung manischer Symptome (ADMS). Diagnostica.

biopsykit.questionnaires.asi(data, columns=None, subscales=None)[source]

Compute the Angstsensitivitätsindex-3 (ASI) (Anxiety Sensitivity Index).

The Angstsensitivitätsindex-3 is the German version of the Anxiety Sensitivity Index by

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Physical Concerns (Bedenken Somatisch - BSM): [3, 4, 7, 8, 12],

  • Social Concerns (Bedenken Sozial - BZS): [1, 6, 9, 11]

  • Cognitive Concerns (Bedenken Kognitiv - BKO): [2, 5, 10]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

ASI score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

German Version: Kemper, C. J., Ziegler, M., & Taylor, S. (2009). Überprüfung der psychometrischen Qualität der deutschen Version des Angstsensitivitätsindex-3. Diagnostica, 55(4), 223-233.

Original Version: Reiss, S., Peterson, R. A., Gursky, D. M., & McNally, R. J. (1986). Anxiety sensitivity, anxiety frequency and the prediction of fearfulness. Behaviour Research and Therapy, 24(1), 1-8. https://doi.org/10.1016/0005-7967(86)90143-9

biopsykit.questionnaires.asku(data, columns=None)[source]

Compute the Allgemeine Selbstwirksamkeit Kurzskala (ASKU).

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

ASKU score

Return type

DataFrame

Raises

References

Beierlein, C., Kovaleva, A., Kemper, C. J., & Rammstedt, B. (2014). Allgemeine Selbstwirksamkeit Kurzskala (ASKU). In Zusammenstellung sozialwissenschaftlicher Items und Skalen.

biopsykit.questionnaires.asq(data, columns=None)[source]

Compute the Anticipatory Stress Questionnaire (ASQ).

The ASQ measures anticipation of stress on the upcoming day.

Note

This implementation assumes a score range of [0, 10]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied

  • columns (list of string, optional) – list with column names to use for computing this score if a complete dataframe is supplied. See convert_scale()

Returns

ASQ score

Return type

DataFrame

References

Powell, D. J., & Schlotz, W. (2012). Daily Life Stress and the Cortisol Awakening Response: Testing the Anticipation Hypothesis. PLoS ONE, 7(12), e52067. https://doi.org/10.1371/journal.pone.0052067

biopsykit.questionnaires.asq_mod(data, columns=None)[source]

Compute the Modified version of the Anticipatory Stress Questionnaire (ASQ_MOD).

The ASQ_MOD measures anticipation of stress on the upcoming day and was modified by (Kramer et al., 2019).

Note

This implementation assumes a score range of [1, 7]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied

  • columns (list of string, optional) – list with column names to use for computing this score if a complete dataframe is supplied. See convert_scale()

Returns

ASQ_MOD score

Return type

DataFrame

References

Modified version: Kramer, A. C., Neubauer, A. B., Stoffel, M., Voss, A., & Ditzen, B. (2019). Tomorrow`s gonna suck: Today`s stress anticipation predicts tomorrow`s post-awakening cortisol increase. Psychoneuroendocrinology, 106, 38-46. https://doi.org/10.1016/j.psyneuen.2019.03.024

Original paper: Powell, D. J., & Schlotz, W. (2012). Daily Life Stress and the Cortisol Awakening Response: Testing the Anticipation Hypothesis. PLoS ONE, 7(12), e52067. https://doi.org/10.1371/journal.pone.0052067

biopsykit.questionnaires.bfi_k(data, columns=None, subscales=None)[source]

Compute the Big Five Inventory (short version) (BFI-K).

The BFI measures an individual on the Big Five Factors (dimensions) of personality (Goldberg, 1993).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Extraversion (E): [1, 6, 11, 16]

  • Agreeableness (A): [2, 7, 12, 17]

  • Conscientiousness (C): [3, 8, 13, 18]

  • Neuroticism (N): [4, 9, 14, 19]

  • Openness (O): [5, 10, 15, 20, 21]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

BFI_K score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Rammstedt, B., & John, O. P. (2005). Kurzversion des big five inventory (BFI-K). Diagnostica, 51(4), 195-206.

biopsykit.questionnaires.bfi_10(data, columns=None, subscales=None)[source]

Compute the Big Five Inventory - 10 items (BFI-10).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Extraversion (E): [1, 6],

  • Agreeableness (A): [2, 7],

  • Conscientiousness (C): [3, 8],

  • Neuroticism (N): [4, 9],

  • Openness (O): [5, 10]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

BFI-10 score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Rammstedt, B., Kemper, C. J., Klein, M. C., Beierlein, C., & Kovaleva, A. (2013). A short scale for assessing the big five dimensions of personality: 10 item big five inventory (BFI-10). methods, data, analyses, 7(2), 17.

biopsykit.questionnaires.bidr(data, columns=None, subscales=None)[source]

Compute the Balanced Inventory of Desirable Responding (BIDR).

The BIDR is a 40-item instrument that is used to measure 2 constructs:

  • Self-deceptive positivity - described as the tendency to give self-reports that are believed but have a positivety bias

  • Impression management - deliberate self-presentation to an audience.

The BIDR emphasizes exaggerated claims of positive cognitive attributes (overconfidence in one`s judgments and rationality). It is viewed as a measure of defense, i.e., people who score high on self-deceptive positivity tend to defend against negative self-evaluations and seek out inflated positive self-evaluations.

Note

This implementation assumes a score range of [1, 7]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

BIDR score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Paulhus, D. L. (1988). Balanced inventory of desirable responding (BIDR). Acceptance and Commitment Therapy. Measures Package, 41, 79586-7.

biopsykit.questionnaires.besaa(data, columns=None, subscales=None)[source]

Compute the Body-Esteem Scale for Adolescents and Adults (BESAA).

Body Esteem refers to self-evaluations of one`s body or appearance. The BESAA is based on the idea that feelings about one`s weight can be differentiated from feelings about one`s general appearance, and that one`s own opinions may be differentiated from the opinions attributed to others. Higher scores indicate higher body esteem.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Appearance: [1, 6, 9, 7, 11, 13, 15, 17, 21, 23]

  • Weight: [3, 4, 8, 10, 16, 18, 19, 22]

  • Attribution: [2, 5, 12, 14, 20]

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

BESAA score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Mendelson, B. K., Mendelson, M. J., & White, D. R. (2001). Body-esteem scale for adolescents and adults. Journal of personality assessment, 76(1), 90-106.

biopsykit.questionnaires.brief_cope(data, columns=None, subscales=None)[source]

Compute the Brief-COPE (28 items) Questionnaire (Brief_COPE).

The Brief-COPE is a 28 item self-report questionnaire designed to measure effective and ineffective ways to cope with a stressful life event. “Coping” is defined broadly as an effort used to minimize distress associated with negative life experiences. The scale is often used in health-care settings to ascertain how patients are responding to a serious diagnosis. It can be used to measure how someone is coping with a wide range of adversity, including cancer diagnosis, heart failure, injuries, assaults, natural disasters and financial stress. The scale can determine someone`s primary coping styles as either Approach Coping, or Avoidant Coping. Higher scores indicate better coping capabilities.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • SelfDistraction: [1, 19]

  • ActiveCoping: [2, 7]

  • Denial: [3, 8]

  • SubstanceUse: [4, 11]

  • EmotionalSupport: [5, 15]

  • InstrumentalSupport: [10, 23]

  • BehavioralDisengagement: [6, 16]

  • Venting: [9, 21]

  • PosReframing: [12, 17]

  • Planning: [14, 25]

  • Humor: [18, 28]

  • Acceptance: [20, 24]

  • Religion: [22, 27]

  • SelfBlame: [13, 26]

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

Brief_COPE score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Carver, C. S. (1997). You want to measure coping but your protocol`too long: Consider the brief cope. International journal of behavioral medicine, 4(1), 92-100.

biopsykit.questionnaires.cesd(data, columns=None)[source]

Compute the Center for Epidemiological Studies Depression Scale (CES-D).

The CES-D asks about depressive symptoms experienced over the past week. Higher scores indicate greater depressive symptoms.

Note

This implementation assumes a score range of [0, 3]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

CES-D score

Return type

DataFrame

Raises

References

Radloff, L. S. (1977). The CES-D Scale: A Self-Report Depression Scale for Research in the General Population. Applied Psychological Measurement, 1(3), 385-401. https://doi.org/10.1177/014662167700100306

biopsykit.questionnaires.clq(data, columns=None, subscales=None)[source]

Compute the Claustrophobia Questionnaire (CLQ).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Suffocation Subscale (SS): [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

  • Restriction Subscale (RS): [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

CLQ score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Radomsky, A. S., Rachman, S., Thordarson, D. S., McIsaac, H. K., & Teachman, B. A. (2001). The claustrophobia questionnaire. Journal of anxiety disorders, 15(4), 287-297.

biopsykit.questionnaires.ctq(data, columns=None, subscales=None)[source]

Compute the Childhood Trauma Questionnaire (CTQ).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • PhysicalAbuse: [9, 11, 12, 15, 17]

  • SexualAbuse: [20, 21, 23, 24, 27]

  • EmotionalNeglect: [5, 7, 13, 19, 28]

  • PhysicalNeglect: [1, 2, 4, 6, 26]

  • EmotionalAbuse: [3, 8, 14, 18, 25]

Additionally, three items assess the validity of the responses (high scores on these items could be grounds for exclusion of a given participants` responses):

  • Validity: [10, 16, 22]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

CTQ score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Bernstein, D. P., Fink, L., Handelsman, L., Foote, J., Lovejoy, M., Wenzel, K., … & Ruggiero, J. (1994). Initial reliability and validity of a new retrospective measure of child abuse and neglect. The American journal of psychiatry.

biopsykit.questionnaires.erq(data, columns=None, subscales=None)[source]

Compute the Emotion Regulation Questionnaire (ERQ).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Reappraisal (Reapp): [1, 3, 5, 7, 8, 10],

  • Suppression (Suppr): [2, 4, 6, 9]

Note

This implementation assumes a score range of [1, 7]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

ERQ score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

German version: Abler, B., & Kessler, H. (2009). Emotion regulation questionnaire - Eine deutschsprachige Fassung des ERQ von Gross und John. Diagnostica, 55(3), 144-152.

Original version: Gross, J. J., & John, O. P. (2003). Individual differences in two emotion regulation processes: implications for affect, relationships, and well-being. Journal of personality and social psychology, 85(2), 348.

biopsykit.questionnaires.eval_clinic(data, columns=None)[source]

Compute the Evaluation of the Current Clinic Stay Questionnaire (EvalClinic).

Note

This implementation assumes a score range of [1, 6]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

EvalClinic score

Return type

DataFrame

Raises

References

Mostly self-generated items.

biopsykit.questionnaires.fee(data, columns=None, subscales=None, language=None)[source]

Compute the Fragebogen zum erinnerten elterlichen Erziehungsverhalten (FEE).

The FEE allows for the recording of memories of the parenting behavior (separately for father and mother) with regard to the factor-analytically dimensions “rejection and punishment”, “emotional warmth” and “control and overprotection”, as well as “control and overprotection”.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • RejectionPunishment: [1, 3, 6, 8, 16, 18, 20, 22]

  • EmotionalWarmth: [2, 7, 9, 12, 14, 15, 17, 24]

  • ControlOverprotection: [4, 5, 10, 11, 13, 19, 21, 23]

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Note

All columns corresponding to the parenting behavior of the Father are expected to have Father (or Vater if language is german) included in the column names, all Mother columns are expected to have Mother (or Mutter if language is german) included in the column names.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

  • language ("english" or "german", optional) – Language of the questionnaire used to extract Mother and Father columns. Default: english

Returns

TICS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints or if language is not supported

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Schumacher, J., Eisemann, M., & Brähler, E. (1999). Rückblick auf die Eltern: Der Fragebogen zum erinnerten elterlichen Erziehungsverhalten (FEE). Diagnostica, 45(4), 194-204.

biopsykit.questionnaires.fkk(data, columns=None, subscales=None)[source]

Compute the Fragebogen zur Kompetenz- und Kontrollüberzeugungen (FKK) (Competence and Control Beliefs).

The questionnaire on competence and control beliefs can be used to assess

  1. the generalized self-concept of own abilities,

  2. internality in generalized control beliefs,

  3. socially conditioned externality, and

  4. fatalistic externality in adolescents and adults.

In addition to profile evaluations according to these four primary scales, evaluations according to secondary and tertiary scales are possible (generalized self-efficacy; generalized externality; internality versus externality in control beliefs).

It consists of the primary subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Self-concept of Own Abilities (Selbstkonzept eigener Fähigkeiten - SK): [4, 8, 12, 24, 16, 20, 28, 32]

  • Internality (Internalität - I): [1, 5, 6, 11, 23, 25, 27, 30]

  • Socially Induced Externality (Sozial bedingte Externalität - P) (P = powerful others control orientation): [3, 10, 14, 17, 19, 22, 26, 29]

  • Fatalistic Externality (Fatalistische Externalität - C) (C = chance control orientation): [2, 7, 9, 13, 15, 18, 21, 31]

Further, the following secondary subscales can be computed:

  • Self-Efficacy / Generalized self-efficacy Beliefs (Selbstwirksamkeit / generalisierte Selbstwirksamkeitsüberzeugung - SKI): SK + I

  • Generalized Externality in Control Beliefs (Generalisierte Externalität in Kontrollüberzeugungen - PC): P + C

Further, the following tertiary subscale can be computed:

  • Generalized Internality (Generalisierte Internalität) vs. Externality in control beliefs (Externalität in Kontrollüberzeugungen - SKI_PC): SKI - PC

Note

This implementation assumes a score range of [1, 6]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

FKK score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Krampen, G. (1991). Fragebogen zu Kompetenz-und Kontrollüberzeugungen: (FKK). Hogrefe, Verlag für Psychologie.

biopsykit.questionnaires.fscrs(data, columns=None, subscales=None)[source]

Compute the Forms of Self-Criticizing/Attacking and Self-Reassuring Scale (FSCRS).

Self-criticism describes the internal relationship with the self in which part of the self shames and puts down, while the other part of the self responds and submits to such attacks. Self-reassurance refers to the opposing idea that many individuals focus on positive aspects of self and defend against self-criticism. The FSCRS exemplifies some of the self-statements made by either those who are self-critical or by those who self-reassure. The scale measures these two traits on a continuum with self-criticism at one end and self-reassurance at the other. Higher scores on each subscale indicate higher self-criticizing (“Inadequate Self”), self-attacking (“Hated Self”), and self-reassuring “Reassuring Self”, respectively.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • InadequateSelf: [1, 2, 4, 6, 7, 14, 17, 18, 20]

  • HatedSelf: [9, 10, 12, 15, 22]

  • ReassuringSelf: [3, 5, 8, 11, 13, 16, 19, 21]

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

FSCRS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Gilbert, P., Clarke, M., Hempel, S., Miles, J. N., & Irons, C. (2004). Criticizing and reassuring oneself: An exploration of forms, styles and reasons in female students. British Journal of Clinical Psychology, 43(1), 31-50.

biopsykit.questionnaires.ghq(data, columns=None)[source]

Compute the General Health Questionnaire (GHQ).

The GHQ-12 is a widely used tool for detecting psychological and mental health and as a screening tool for excluding psychological and psychiatric morbidity. Higher scores indicate lower health. A summed score above 4 is considered an indicator of psychological morbidity.

Note

This implementation assumes a score range of [0, 3]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

GHQ score

Return type

DataFrame

Raises

References

Goldberg, D. P. (1972). The detection of psychiatric illness by questionnaire. Maudsley monograph, 21.

biopsykit.questionnaires.hads(data, columns=None, subscales=None)[source]

Compute the Hospital Anxiety and Depression Scale (HADS).

The HADS is a brief and widely used instrument to measure psychological distress in patients and in the general population. It has two subscales: anxiety and depression. Higher scores indicate greater distress.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Anxiety: [1, 3, 5, 7, 9, 11, 13]

  • Depression: [2, 4, 6, 8, 10, 12, 14]

Note

This implementation assumes a score range of [0, 3]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

HADS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns do not match

  • ValueRangeError – if values are not within the required score range

References

Zigmond, A. S., & Snaith, R. P. (1983). The hospital anxiety and depression scale. Acta psychiatrica scandinavica, 67(6), 361-370.

biopsykit.questionnaires.idq_pre_scan(data, columns=None)[source]

Compute the Pre-Scan Imaging Distress Questionnaire (IDQ_PRE).

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

PQ score

Return type

DataFrame

Raises

References

Dantendorfer, K., Amering, M., Bankier, A., Helbich, T., Prayer, D., Youssefzadeh, S., … & Katschnig, H. (1997). A study of the effects of patient anxiety, perceptions and equipment on motion artifacts in magnetic resonance imaging. Magnetic resonance imaging, 15(3), 301-306.

biopsykit.questionnaires.idq_post_scan(data, columns=None)[source]

Compute the Post-Scan Imaging Distress Questionnaire (IDQ_POST).

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

IDQ_POST score

Return type

DataFrame

Raises

References

Dantendorfer, K., Amering, M., Bankier, A., Helbich, T., Prayer, D., Youssefzadeh, S., … & Katschnig, H. (1997). A study of the effects of patient anxiety, perceptions and equipment on motion artifacts in magnetic resonance imaging. Magnetic resonance imaging, 15(3), 301-306.

biopsykit.questionnaires.ie_4(data, columns=None, subscales=None)[source]

Compute the Interne-Externe Kontrollüberzeugungs-Inventar (IE-4) (Internal-External Locus of Control).

The IE4 is a short scale for the assessment of Locus of Control. It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Internal Locus of Control (Intern): [1, 2]

  • External Locus of Control (Extern): [3, 4]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

IE4 score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Kovaleva, A. (2014). IE-4: Die Skala Internale-Externale-Kontrollüberzeugung-4. In Handbuch Kurzskalen psychologischer Merkmale.

biopsykit.questionnaires.kab(data, columns=None)[source]

Compute the Kurzfragebogen zur aktuellen Beanspruchung (KAB).

The KAB measures currently perceived and expected stress in the near future.

Note

This implementation assumes a score range of [1, 6]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

KAB score

Return type

DataFrame

Raises

References

Muller, B., & Basler, H. D. (1993). Kurzfragebogen zur aktuellen Beanspruchung. [Manual Beltz Test]. Weinheim: Germany.

biopsykit.questionnaires.kkg(data, columns=None, subscales=None)[source]

Compute the Kontrollüberzeugungen zu Krankheit und Gesundheit Questionnaire (KKG).

The KKG is a health attitude test and assesses the locus of control about disease and health. 3 health- or illness-related locus of control are evaluated:

  1. internality: attitudes that health and illness are controllable by oneself,

  2. social externality: attitudes that they are controllable by other outside persons, and

  3. fatalistic externality: attitudes that they are not controllable (chance or fate dependence of one’s health status).

Note

This implementation assumes a score range of [1, 6]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

KKG score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Lohaus, A., & Schmitt, G. M. (1989). Kontrollüberzeugungen zu Krankheit und Gesundheit (KKG): Testverfahren und Testmanual. Göttingen: Hogrefe.

biopsykit.questionnaires.lsq(data, columns=None, subscales=None)[source]

Compute the Life Stress Questionnaire.

The LSQ asks participants about stressful life events that they and their close relatives have experienced throughout their entire life, what age they were when the event occurred, and how much it impacted them. Higher scores indicate more stress.

It consists of the subscales:

  • PartnerStress: columns with suffix _Partner

  • ParentStress: columns with suffix _Parent

  • ChildStress: columns with suffix _Child

Note

This implementation assumes a score range of [0, 1]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (list of str, optional) – List of subscales (Partner, Parent, Child) to compute or None to compute all subscales. Default: None

Returns

LSQ score

Return type

DataFrame

Raises

References

Prenda, K. M., & Lachman, M. E. (2001). Planning for the future: a life management strategy for increasing control and life satisfaction in adulthood. Psychology and aging, 16(2), 206.

biopsykit.questionnaires.mbi_gs(data, columns=None, subscales=None)[source]

Compute the Maslach Burnout Inventory - General Survey (MBI-GS).

The MBI measures burnout as defined by the World Health Organization (WHO) and in the ICD-11.

The MBI-GS is a psychological assessment instrument comprising 16 symptom items pertaining to occupational burnout. It is designed for use with occupational groups other than human services and education, including those working in jobs such as customer service, maintenance, manufacturing, management, and most other professions.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Emotional Exhaustion (EE): [1, 2, 3, 4, 5]

  • Personal Accomplishment (PA): [6, 7, 8, 11, 12, 16]

  • Depersonalization / Cynicism (DC): [9, 10, 13, 14, 15]

Note

This implementation assumes a score range of [0, 6]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

MBI-GS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

biopsykit.questionnaires.mbi_gss(data, columns=None, subscales=None)[source]

Compute the Maslach Burnout Inventory - General Survey for Students (MBI-GS (S)).

The MBI measures burnout as defined by the World Health Organization (WHO) and in the ICD-11.

The MBI-GS (S) is an adaptation of the MBI-GS designed to assess burnout in college and university students. It is available for use but its psychometric properties are not yet documented.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Emotional Exhaustion (EE): [1, 2, 3, 4, 5]

  • Personal Accomplishment (PA): [6, 7, 8, 11, 12, 16]

  • Depersonalization / Cynicism (DC): [9, 10, 13, 14, 15]

Note

This implementation assumes a score range of [0, 6]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

MBI-GS (S) score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

biopsykit.questionnaires.mdbf(data, columns=None, subscales=None)[source]

Compute the Multidimensionaler Befindlichkeitsfragebogen (MDBF).

The MDBF measures different bipolar dimensions of current mood and psychological wellbeing.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • GoodBad: [1, 4, 8, 11, 14, 16, 18, 21]

  • AwakeTired: [2, 5, 7, 10, 13, 17, 20, 23]

  • CalmNervous: [3, 6, 9, 12, 15, 19, 22, 24]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

MDBF score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Steyer, R., Schwenkmezger, P., Notz, P., & Eid, M. (1997). Der Mehrdimensionale Befindlichkeitsfragebogen MDBF [Multidimensional mood questionnaire]. Göttingen, Germany: Hogrefe.

biopsykit.questionnaires.meq(data, columns=None)[source]

Compute the Morningness Eveningness Questionnaire (MEQ).

The MEQ measures whether a person’s circadian rhythm (biological clock) produces peak alertness in the morning, in the evening, or in between. The original study showed that the subjective time of peak alertness correlates with the time of peak body temperature; morning types (early birds) have an earlier temperature peak than evening types (night owls), with intermediate types having temperature peaks between the morning and evening chronotype groups.

Besides the MEQ score the function classifies the chronotype in two stages:

  • 5 levels (Chronotype_Fine):

    • 0: definite evening type (MEQ score 14-30)

    • 1: moderate evening type (MEQ score 31-41)

    • 2: intermediate type (MEQ score 42-58)

    • 3: moderate morning type (MEQ score 59-69)

    • 4: definite morning type (MEQ score 70-86)

  • 3 levels (Chronotype_Coarse):

    • 0: evening type (MEQ score 14-41)

    • 1: intermediate type (MEQ score 42-58)

    • 2: morning type (MEQ score 59-86)

Note

This implementation assumes a score range of [1, 4], except for some columns, which have a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

MEQ score and Chronotype Classification

Return type

pd.DataFrame

References

Horne, J. A., & Östberg, O. (1976). A self-assessment questionnaire to determine morningness-eveningness in human circadian rhythms. International journal of chronobiology.

biopsykit.questionnaires.midi(data, columns=None)[source]

Compute the Midlife Development Inventory (MIDI) Sense of Control Scale.

The Midlife Development Inventory (MIDI) sense of control scale assesses perceived control, that is, how much an individual perceives to be in control of his or her environment. Higher scores indicate greater sense of control.

Note

This implementation assumes a score range of [1, 7]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

MIDI score

Return type

DataFrame

Raises

References

Lachman, M. E., & Weaver, S. L. (1998). The sense of control as a moderator of social class differences in health and well-being. Journal of personality and social psychology, 74(3), 763.

biopsykit.questionnaires.mkhai(data, columns=None)[source]

Compute the Modified Health Anxiety Inventory (MKHAI).

The MKHAI is a measure of health anxiety.

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

MKHAI score

Return type

DataFrame

Raises

References

German version: Bailer, J. & Witthöft, M. (2014). Deutsches modifiziertes Health Anxiety Inventory (MK-HAI). Zusammenstellung sozialwissenschaftlicher Items und Skalen (ZIS). https://doi.org/10.6102/zis71

Original version: Salkovskis, P. M., Rimes, K. A., Warwick, H. M. C., & Clark, D. M. (2002). The Health Anxiety Inventory: development and validation of scales for the measurement of health anxiety and hypochondriasis. Psychological medicine,32(5), 843-853.

biopsykit.questionnaires.mlq(data, columns=None, subscales=None)[source]

Compute the Meaning in Life Questionnaire (MLQ).

The MLQ is a 10-item measure of the Presence of Meaning in Life, and the Search for Meaning in Life. The MLQ has been used to help people understand and track their perceptions about their lives. It has been included in numerous studies around the world, and in several internet-based resources concerning happiness and fulfillment.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • PresenceMeaning: [1, 4, 5, 6, 9]

  • SearchMeaning: [2, 3, 7, 8, 10]

Note

This implementation assumes a score range of [1, 7]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

MLQ score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Steger, M. F., Frazier, P., Oishi, S., & Kaler, M. (2006). The meaning in life questionnaire: Assessing the presence of and search for meaning in life. Journal of counseling psychology, 53(1), 80.

biopsykit.questionnaires.mves(data, columns=None)[source]

Compute the Maastricht Vital Exhaustion Scale (MVES).

The MVES uses 23 items to assess the concept of Vital Exhaustion (VE), which is characterized by feelings of excessive fatigue, lack of energy, irritability, and feelings of demoralization. Higher scores indicate greater vital exhaustion.

Note

This implementation assumes a score range of [0, 2]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

MVES score

Return type

DataFrame

Raises

References

Appels, A., Höppener, P., & Mulder, P. (1987). A questionnaire to assess premonitory symptoms of myocardial infarction. International Journal of Cardiology, 17(1), 15-24. https://doi.org/10.1016/0167-5273(87)90029-5

biopsykit.questionnaires.panas(data, columns=None, language=None)[source]

Compute the Positive and Negative Affect Schedule (PANAS).

The PANAS assesses positive affect (interested, excited, strong, enthusiastic, proud, alert, inspired, determined, attentive, and active) and negative affect (distressed, upset, guilty, scared, hostile, irritable, ashamed, nervous, jittery, and afraid). Higher scores on each subscale indicate greater positive or negative affect.

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • language ("english" or "german", optional) – Language of the questionnaire used since index items differ between the german and the english version. Default: english

Returns

PANAS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Watson, D., Clark, L. A., & Tellegen, A. (1988). Development and validation of brief measures of positive and negative affect: the PANAS scales. Journal of personality and social psychology, 54(6), 1063.

biopsykit.questionnaires.pasa(data, columns=None, subscales=None)[source]

Compute the Primary Appraisal Secondary Appraisal Scale (PASA).

The PASA assesses each of the four cognitive appraisal processes relevant for acute stress protocols, such as the TSST: primary stress appraisal (threat and challenge) and secondary stress appraisal (self-concept of own abilities and control expectancy). Higher scores indicate greater appraisals for each sub-type.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Threat: [1, 9, 5, 13]

  • Challenge: [6, 10, 2, 14]

  • SelfConcept: [7, 3, 11, 15]

  • ControlExp: [4, 8, 12, 16]

Note

This implementation assumes a score range of [1, 6]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

PASA score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Gaab, J., Rohleder, N., Nater, U. M., & Ehlert, U. (2005). Psychological determinants of the cortisol stress response: the role of anticipatory cognitive appraisal. Psychoneuroendocrinology, 30(6), 599-610.

biopsykit.questionnaires.peat(data, columns=None)[source]

Compute the Pittsburgh Enjoyable Activities Test (PEAT).

The PEAT is a self-report measure of engagement in leisure activities. It asks participants to report how often over the last month they have engaged in each of the activities. Higher scores indicate more time spent in leisure activities.

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

PEAT score

Return type

DataFrame

Raises

References

Pressman, S. D., Matthews, K. A., Cohen, S., Martire, L. M., Scheier, M., Baum, A., & Schulz, R. (2009). Association of enjoyable leisure activities with psychological and physical well-being. Psychosomatic medicine, 71(7), 725.

biopsykit.questionnaires.pfb(data, columns=None, subscales=None)[source]

Compute the Partnerschaftsfragebogen (PFB).

Note

This implementation assumes a score range of [1, 4], except for the Glueck column, which has a score range of [1, 6] Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

PFB score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Hinz, A., Stöbel-Richter, Y., & Brähler, E. (2001). Der Partnerschaftsfragebogen (PFB). Diagnostica, 47(3), 132-141.

biopsykit.questionnaires.phq(data, columns=None)[source]

Compute the Patient Health Questionnaire (Depression) - 9 items (PHQ-9).

The PHQ-9 is a measure for depression.

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

PHQ9 score

Return type

DataFrame

Raises

References

Löwe, B., Spitzer, R.L., Zipfel, S., Herzog, W., 2002. Gesundheitsfragebogen für Patienten (PHQ-D). Manual und Testunterlagen. 2. Auflage

biopsykit.questionnaires.psqi(data, columns=None)[source]

Compute the Pittsburgh Sleep Quality Index (PSQI).

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • ..warning:: – The PSQI has a slightly different score name format than other questionnaires since it has several subquestions (denoted “a”, “b”, …, “j”) for question 5, as well as one free-text question. When using this function to compute the PSQI the make sure your column names adhere to the following naming convention for the function to work properly: * Questions 1 - 10 (except Question 5): suffix “01”, “02”, …, “10” * Subquestions of Question 5: suffix “05a”, “05b”, …, “05j” * Free-text subquestion of Question 5: suffix “05j_text”

Returns

PSQI score

Return type

DataFrame

Raises
biopsykit.questionnaires.pss(data, columns=None, subscales=None)[source]

Compute the Perceived Stress Scale (PSS).

The PSS is a widely used self-report questionnaire with adequate reliability and validity asking about how stressful a person has found his/her life during the previous month.

The PSS consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Perceived Helplessness (Hilflosigkeit - Helpness): [1, 2, 3, 6, 9, 10]

  • Perceived Self-Efficacy (Selbstwirksamkeit - SelfEff): [4, 5, 7, 8]

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

PSS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns do not match

  • ValueRangeError – if values are not within the required score range

References

Cohen, S., Kamarck, T., & Mermelstein, R. (1983). A Global Measure of Perceived Stress. Journal of Health and Social Behavior, 24(4), 385. https://doi.org/10.2307/2136404

biopsykit.questionnaires.purpose_life(data, columns=None)[source]

Compute the Purpose in Life questionnaire.

Purpose in life refers to the psychological tendency to derive meaning from life`s experiences and to possess a sense of intentionality and goal directedness that guides behavior. Higher scores indicate greater purpose in life.

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

TICS score

Return type

DataFrame

References

Boyle, P. A., Barnes, L. L., Buchman, A. S., & Bennett, D. A. (2009). Purpose in life is associated with mortality among community-dwelling older persons. Psychosomatic medicine, 71(5), 574.

biopsykit.questionnaires.resilience(data, columns=None)[source]

Compute the Resilience Questionnaire (RS).

Note

This implementation assumes a score range of [1, 7]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

RS score

Return type

DataFrame

Raises

References

Schumacher, J., Leppert, K., Gunzelmann, T., Strauß, B., & Brähler, E. (2005). Die resilienzskala-ein fragebogen zur erfassung der psychischen widerstandsfähigkeit als personmerkmal. Klin Psychol Psychiatr Psychother, 53(1), 16-39.

biopsykit.questionnaires.rmidi(data, columns=None, subscales=None)[source]

Compute the Revised Midlife Development Inventory (MIDI) Personality Scale.

The Midlife Development Inventory (MIDI) includes 6 personality trait scales: Neuroticism, Extraversion, Openness to Experience, Conscientiousness, Agreeableness, and Agency. Higher scores indicate higher endorsement of each personality trait.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Neuroticism: [3, 8, 13, 19]

  • Extraversion: [1, 6, 11, 23, 27]

  • Openness: [14, 17, 21, 22, 25, 28, 29]

  • Conscientiousness: [4, 9, 16, 24, 31]

  • Agreeableness: [2, 7, 12, 18, 26]

  • Agency: [5, 10, 15, 20, 30]

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

RMIDI score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Prenda, K. M., & Lachman, M. E. (2001). Planning for the future: a life management strategy for increasing control and life satisfaction in adulthood. Psychology and aging, 16(2), 206.

biopsykit.questionnaires.rse(data, columns=None)[source]

Compute the Rosenberg Self-Esteem Inventory.

The RSE is the most frequently used measure of global self-esteem. Higher scores indicate greater self-esteem.

Note

This implementation assumes a score range of [0, 3]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

RSE score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Rosenberg, M. (1965). Society and the Adolescent Self-Image. Princeton University Press, Princeton, NJ.

biopsykit.questionnaires.rsq(data, columns=None, subscales=None)[source]

Compute the Response Styles Questionnaire (RSQ).

The RSQ is a questionnaire that measures cognitive and behavioral coping styles in dealing with depressed or dysphoric mood and was developed based on Susan Nolen-Hoeksema’s Response Styles Theory. The theory postulates that rumination about symptoms and negative aspects of self (rumination) prolongs or exacerbates depressed moods, whereas cognitive and behavioral distraction (distraction) shortens or attenuates them.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • SymptomRumination: [2, 3, 4, 8, 11, 12, 13, 25]

  • SelfRumination: [1, 19, 26, 28, 30, 31, 32]

  • Distraction: [5, 6, 7, 9, 14, 16, 18, 20]

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

RSQ score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Nolen-Hoeksema, S., Morrow, J., & Fredrickson, B. L. (1993). Response styles and the duration of episodes of depressed mood. Journal of abnormal psychology, 102(1), 20.

biopsykit.questionnaires.sci(data, columns=None, subscales=None)[source]

Compute the Stress und Coping Inventar (SCI).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Stress Scale 1 - Uncertainty (Stress1): [1, 2, 3, 4, 5, 6, 7],

  • Stress Scale 2 - Load (Stress2): [8, 9, 10, 11, 12, 13, 14],

  • Stress Scale 3 - Adverse (Stress3): [15, 16, 17, 18, 19, 20, 21],

  • Physical and Psychological Symptoms (PhysPsycSymp): [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34],

  • Positive Thinking (PosThink): [29, 33, 34, 44],

  • Active Coping (ActiveCoping): [31, 35, 47, 45],

  • Social Support (SocSup): [32, 41, 43, 47],

  • Faith (Faith): [36, 37, 38, 46],

  • Alcohol and Cigarette Consumption (AlcCig): [30, 39, 42, 48]

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

SCI score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Satow, L. (2012). Stress- und Coping-Inventar (SCI): Test- und Skalendokumentation. Online im Internet: URL: http://www.drsatow.de.

biopsykit.questionnaires.scs(data, columns=None, subscales=None)[source]

Compute the Self-Compassion Scale (SCS).

The Self-Compassion Scale measures the tendency to be compassionate rather than critical toward the self in difficult times. It is typically assessed as a composite but can be broken down into subscales. Higher scores indicate greater self-compassion.

It consists of the subscales, with the item indices (count-by-one, i.e., the first question has the index 1!):

  • SelfKindness: [5, 12, 19, 23, 26]

  • SelfJudgment: [1, 8, 11, 16, 21]

  • CommonHumanity: [3, 7, 10, 15]

  • Isolation: [4, 13, 18, 25]

  • Mindfulness: [9, 14, 17, 22]

  • OverIdentified [2, 6, 20, 24]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

SCS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Neff, K. D. (2003). The development and validation of a scale to measure self-compassion. Self and identity, 2(3), 223-250. https://www.academia.edu/2040459

biopsykit.questionnaires.sds(data, columns=None)[source]

Compute the Social Desirability Scale (SDS).

Short scale to estimate social desirability following the ALLBUS (1980).

Note

This implementation assumes a score range of [1, 8]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

SDS score

Return type

DataFrame

Raises
biopsykit.questionnaires.sop(data, columns=None, subscales=None)[source]

Compute the Self-Efficacy, Optimism & Pessimism Scale (SOP).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Self-Efficacy (SE): [1, 3, 5, 7, 8]

  • Optimism (O): [4, 9]

  • Pessimism (P): [2, 6]

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

SOP score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Scholler, G., Fliege, H., & Klapp, B. F. (1999). Fragebogen zu Selbstwirksamkeit, Optimismus und Pessimismus. Psychother Psychosom Med Psychol, 49(8), 275-283.

biopsykit.questionnaires.ssgs(data, columns=None, subscales=None)[source]

Compute the State Shame and Guilt Scale (SSGS).

The SSGS assesses the experience of shame, guilt, and pride experienced during an acute stress protocol with three separate subscales. Shame and guilt are considered distinct emotions, with shame being a global negative feeling about the self, and guilt being a negative feeling about a specific event rather than the self. This scale is a modified version from the State Shame and Guilt scale by Marschall et al. (1994). Higher scores on each subscale indicate higher shame, guilt, or pride.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Pride: [1, 4, 7, 10, 13]

  • Shame: [2, 5, 8, 11, 14]

  • Guilt: [3, 6, 9, 12, 15]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

SSGS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Rohleder, N., Chen, E., Wolf, J. M., & Miller, G. E. (2008). The psychobiology of trait shame in young women: Extending the social self preservation theory. Health Psychology, 27(5), 523.

Marschall, D., Sanftner, J., & Tangney, J. P. (1994). The state shame and guilt scale. Fairfax, VA: George Mason University.

biopsykit.questionnaires.sss(data, columns=None, subscales=None)[source]

Compute the Subjective Social Status (SSS).

The MacArthur Scale of Subjective Social Status (MacArthur SSS Scale) is a single-item measure that assesses a person’s perceived rank relative to others in their group.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Socioeconomic Status Ladder (SocioeconomicStatus): [1]

  • Community Ladder (Community): [2]

Note

This implementation assumes a score range of [0, 10]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

SSS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

biopsykit.questionnaires.swb(data, columns=None, subscales=None, invert_score=False)[source]

Compute the Subjective Well-Being Scale (SWB).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Mood Level (Stimmungsniveau - SN): [2, 5, 8, 10, 11, 13],

  • General Life Satisfaction (Allgemeine Lebenszufriedenheit - ALZ): [1, 3, 4, 6, 7, 9, 12]

Note

This implementation assumes a score range of [1, 6]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

  • invert_score (bool, optional) – True to revert the computed subscores, False otherwise. Default: False

Returns

SWB score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Pontin, Eleanor, et al. “A UK validation of a general measure of subjective well-being: the modified BBC subjective well-being scale (BBC-SWB).” Health and Quality of Life Outcomes 11.1 (2013): 1-9.

biopsykit.questionnaires.stadi(data, columns=None, subscales=None, stadi_type=None)[source]

Compute the State-Trait Anxiety-Depression Inventory (STADI).

With the STADI, anxiety and depression can be recorded, both as state and as trait. Two self-report questionnaires with 20 items each are available for this purpose. The state part measures the degree of anxiety and depression currently experienced by a person, which varies depending on internal or external influences. It can be used in a variety of situations of different types. This includes not only the whole spectrum of highly heterogeneous stressful situations, but also situations of neutral or positive (“euthymic”) character. The trait part is used to record trait expressions, i.e. the enduring tendency to experience anxiety and depression.

The STADI can either be computed only for state, only for trait, or for state and trait.

The state and trait scales both consist of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Emotionality (Aufgeregtheit - affektive Komponente - AU): [1, 5, 9, 13, 17]

  • Worry (Besorgnis - kognitive Komponente - BE): [2, 6, 10, 14, 18]

  • Anhedonia (Euthymie - positive Stimmung - EU): [3, 7, 11, 15, 19]

  • Dysthymia (Dysthymie - depressive Stimmung - DY): [4, 8, 12, 16, 20]

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Note

If both state and trait score are present it is assumed that all state items are first, followed by all trait items. If all subscales are present this adds up to 20 state items and 20 trait items.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

  • stadi_type (any of state, trait, or state_trait) – which type of STADI subscale should be computed. Default: state_trait

Returns

STADI score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints if invalid parameter was passed to stadi_type

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Laux, L., Hock, M., Bergner-Köther, R., Hodapp, V., & Renner, K. H. (2013). Das State-Trait-Angst-Depressions-Inventar: STADI; Manual.

Renner, K. H., Hock, M., Bergner-Köther, R., & Laux, L. (2018). Differentiating anxiety and depression: the state-trait anxiety-depression inventory. Cognition and Emotion, 32(7), 1409-1423.

biopsykit.questionnaires.stai_short(data, columns=None, stai_type=None)[source]

Compute the short version of the State Anxiety facet of the State Trait Anxiety Inventory.

Note

This implementation assumes a score range of [1, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • stai_type (any of state, trait) – which type of STAI subscale should be computed. Default: state

Returns

STAI score

Return type

DataFrame

Raises

References

Spielberger, C. D. (1970). Manual for the State-trait Anxietry, Inventory. Consulting Psychologist.

biopsykit.questionnaires.state_rumination(data, columns=None)[source]

Compute the State Rumination scale.

Rumination is the tendency to dwell on negative thoughts and emotions. Higher scores indicate greater rumination.

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

State Rumination score

Return type

DataFrame

Raises

References

Roger, D., & Najarian, B. (1998). The relationship between emotional rumination and cortisol secretion under stress. Personality and Individual Differences, 24(4), 531-538.

biopsykit.questionnaires.svf_42(data, columns=None, subscales=None)[source]

Compute the Stressverarbeitungsfragebogen - 42 item version (SVF42).

The stress processing questionnaire enables the assessment of coping or processing measures in stressful situations. The SVF is not a singular test instrument, but rather an inventory of methods that relate to various aspects of stress processing and coping and from which individual procedures can be selected depending on the study objective/question.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Trivialization/Minimalization (Bagatellisierung - Bag): [7, 22]

  • De-Emphasis by Comparison with Others (Herunterspielen - Her): [11, 35]

  • Rejection of Guilt (Schuldabwehr - Schab): [2, 34]

  • Distraction/Deflection from a Situation (Ablenkung - Abl): [1, 32]

  • Vicarious Satisfaction (Ersatzbefriedigung -Ers): [12, 42]

  • Search for Self-Affirmation (Selbstbestätigung - Sebest): [19, 37]

  • Relaxation (Entspannung -Entsp): [13, 26]

  • Attempt to Control Situation (Situationskontrolle - Sitkon): [4, 23]

  • Response Control (Reaktionskontrolle - Rekon): [17, 33]

  • Positive Self-Instruction (Positive Selbstinstruktion - Posi): [9, 24]

  • Need for Social Support (Soziales Unterstützungsbedürfnis - Sozube): [14, 27]

  • Avoidance Tendencies (Vermeidung - Verm): [6, 30]

  • Escapist Tendencies (Flucht - Flu): [16, 40]

  • Social Isolation (Soziale Abkapselung - Soza): [20, 29]

  • Mental Perseveration (Gedankliche Weiterbeschäftigung - Gedw): [10, 25]

  • Resignation (Resignation - Res): [38, 15]

  • Self-Pity (Selbstbemitleidung - Selmit): [18, 28]

  • Self-Incrimination (Selbstbeschuldigung - Sesch): [8, 31]

  • Aggression (Aggression - Agg): [21, 36]

  • Medicine-Taking (Pharmakaeinnahme - Pha): [3, 39]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

SFV42 score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

biopsykit.questionnaires.svf_120(data, columns=None, subscales=None)[source]

Compute the Stressverarbeitungsfragebogen - 120 item version (SVF120).

The stress processing questionnaire enables the assessment of coping or processing measures in stressful situations. The SVF is not a singular test instrument, but rather an inventory of methods that relate to various aspects of stress processing and coping and from which individual procedures can be selected depending on the study objective/question.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Trivialization/Minimalization (Bagatellisierung - Bag): [10, 31, 50, 67, 88, 106]

  • De-Emphasis by Comparison with Others (Herunterspielen - Her): [17, 38, 52, 77, 97, 113]

  • Rejection of Guilt (Schuldabwehr - Schab): [5, 30, 43, 65, 104, 119]

  • Distraction/Deflection from a Situation (Ablenkung - Abl): [1, 20, 45, 86, 101, 111]

  • Vicarious Satisfaction (Ersatzbefriedigung -Ers): [22, 36, 64, 74, 80, 103]

  • Search for Self-Affirmation (Selbstbestätigung - Sebest): [34, 47, 59, 78, 95, 115]

  • Relaxation (Entspannung -Entsp): [12, 28, 58, 81, 99, 114]

  • Attempt to Control Situation (Situationskontrolle - Sitkon): [11, 18, 39, 66, 91, 116]

  • Response Control (Reaktionskontrolle - Rekon): [2, 26, 54, 68, 85, 109]

  • Positive Self-Instruction (Positive Selbstinstruktion - Posi): [15, 37, 56, 71, 83, 96]

  • Need for Social Support (Soziales Unterstützungsbedürfnis - Sozube): [3, 21, 42, 63, 84, 102]

  • Avoidance Tendencies (Vermeidung - Verm): [8, 29, 48, 69, 98, 118]

  • Escapist Tendencies (Flucht - Flu): [14, 24, 40, 62, 73, 120]

  • Social Isolation (Soziale Abkapselung - Soza): [6, 27, 49, 76, 92, 107]

  • Mental Perseveration (Gedankliche Weiterbeschäftigung - Gedw): [16, 23, 55, 72, 100, 110]

  • Resignation (Resignation - Res): [4, 32, 46, 60, 89, 105]

  • Self-Pity (Selbstbemitleidung - Selmit): [13, 41, 51, 79, 94, 117]

  • Self-Incrimination (Selbstbeschuldigung - Sesch): [9, 25, 35, 57, 75, 87]

  • Aggression (Aggression - Agg): [33, 44, 61, 82, 93, 112]

  • Medicine-Taking (Pharmakaeinnahme - Pha): [7, 19, 53, 70, 90, 108]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

SFV120 score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

biopsykit.questionnaires.swls(data, columns=None)[source]

Compute the Satisfaction with Life Scale (SWLS).

Note

This implementation assumes a score range of [1, 7]. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

SWLS score

Return type

DataFrame

Raises

References

Original version: Diener, E. D., Emmons, R. A., Larsen, R. J., & Griffin, S. (1985). The satisfaction with life scale. Journal of personality assessment, 49(1), 71-75.

biopsykit.questionnaires.tb(data, columns=None, subscales=None)[source]

Compute the Technology Commitment Questionnaire (TB - Technologiebereitschaft).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Technology Acceptance (Technikakzeptanz - TechAcc): [1, 2, 3, 4]

  • Technology Competence Beliefs (Technikkompetenzüberzeugungen - TechComp): [5, 6, 7, 8]

  • Technology Control Beliefs (Technikkontrollüberzeugungen - TechControl): [9, 10, 11, 12]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

TB score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Neyer, F. J. J., Felber, J., & Gebhardt, C. (2016). Kurzskala. Technikbereitschaft (TB)[Technology commitment]. In ZIS-Zusammenstellung sozialwissenschaftlicher Items und Skalen (ed.).

biopsykit.questionnaires.tics_l(data, columns=None, subscales=None)[source]

Compute the Trier Inventory for Chronic Stress (Long Version) (TICS_L).

The TICS assesses frequency of various types of stressful experiences in the past 3 months.

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Work Overload: [50, 38, 44, 54, 17, 4, 27, 1]

  • Social Overload: [39, 28, 49, 19, 7, 57]

  • Excessive Demands at Work: [55, 24, 20, 35, 47, 3]

  • Lack of Social Recognition: [31, 18, 46, 2]

  • Work Discontent: [21, 53, 10, 48, 41, 13, 37, 5]

  • Social Tension: [26, 15, 45, 52, 6, 33]

  • Performance Pressure at Work: [23, 43, 32, 22, 12, 14, 8, 40, 30]

  • Performance Pressure in Social Interactions: [6, 15, 22]

  • Social Isolation: [42, 51, 34, 56, 11, 29]

  • Worry Propensity: [36, 25, 16, 9]

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

TICS_L score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns do not match

  • ValueRangeError – if values are not within the required score range

Examples

>>> from biopsykit.questionnaires import tics_s
>>> # compute only a subset of subscales; questionnaire items additionally have custom indices
>>> subscales = {
>>>     'WorkOverload': [1, 2, 3],
>>>     'SocialOverload': [4, 5, 6],
>>> }
>>> tics_s_result = tics_s(data, subscales=subscales)

References

Schulz, P., Schlotz, W., & Becker, P. (2004). Trierer Inventar zum chronischen Stress: TICS. Hogrefe.

biopsykit.questionnaires.tics_s(data, columns=None, subscales=None)[source]

Compute the Trier Inventory for Chronic Stress (Short Version) (TICS_S).

The TICS assesses frequency of various types of stressful experiences in the past 3 months.

It consists of the subscales (the name in the brackets indicate the name in the returned dataframe), with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Work Overload: [1, 3, 21]

  • Social Overload: [11, 18, 28]

  • Excessive Demands at Work: [12, 16, 27]

  • Lack of Social Recognition: [2, 20, 23]

  • Work Discontent: [8, 13, 24]

  • Social Tension: [4, 9, 26]

  • Performance Pressure at Work: [5, 14, 29]

  • Performance Pressure in Social Interactions: [6, 15, 22]

  • Social Isolation: [19, 25, 30]

  • Worry Propensity: [7, 10, 17]

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

TICS_S score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns do not match

  • ValueRangeError – if values are not within the required score range

Examples

>>> from biopsykit.questionnaires import tics_s
>>> # compute only a subset of subscales; questionnaire items additionally have custom indices
>>> subscales = {
>>>     'WorkOverload': [1, 2, 3],
>>>     'SocialOverload': [4, 5, 6],
>>> }
>>> tics_s_result = tics_s(data, subscales=subscales)

References

Schulz, P., Schlotz, W., & Becker, P. (2004). Trierer Inventar zum chronischen Stress: TICS. Hogrefe.

biopsykit.questionnaires.trait_rumination(data, columns=None)[source]

Compute the Trait Rumination.

Higher scores indicate greater rumination.

Note

This implementation assumes a score range of [0, 1], where 0 = no rumination, 1 = rumination. Use convert_scale() to convert the items into the correct range beforehand.

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

Returns

TraitRumination score

Return type

DataFrame

References

Nolen-Hoeksema, S., Morrow, J., & Fredrickson, B. L. (1993). Response styles and the duration of episodes of depressed mood. Journal of abnormal psychology, 102(1), 20.

biopsykit.questionnaires.tsgs(data, columns=None, subscales=None)[source]

Compute the Trait Shame and Guilt Scale.

The TSGS assesses the experience of shame, guilt, and pride over the past few months with three separate subscales. Shame and guilt are considered distinct emotions, with shame being a global negative feeling about the self, and guilt being a negative feeling about a specific event rather than the self. Higher scores on each subscale indicate higher shame, guilt, or pride.

It consists of the subscales, with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Shame: [2, 5, 8, 11, 14]

  • Guilt: [3, 6, 9, 12, 15]

  • Pride: [1, 4, 7, 10, 13]

Note

This implementation assumes a score range of [1, 5]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

TSGS score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Rohleder, N., Chen, E., Wolf, J. M., & Miller, G. E. (2008). The psychobiology of trait shame in young women: Extending the social self preservation theory. Health Psychology, 27(5), 523.

biopsykit.questionnaires.type_d(data, columns=None, subscales=None)[source]

Compute the Type D Personality Scale.

Type D personality is a personality trait characterized by negative affectivity (NA) and social inhibition (SI). Individuals who are high in both NA and SI have a distressed or Type D personality.

It consists of the subscales, with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Negative Affect: [2, 4, 5, 7, 9, 12, 13]

  • Social Inhibition: [1, 3, 6, 8, 10, 11, 14]

Note

This implementation assumes a score range of [0, 4]. Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

TypeD score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Denollet, J. (2005). DS14: standard assessment of negative affectivity, social inhibition, and Type D personality. Psychosomatic medicine, 67(1), 89-97.

biopsykit.questionnaires.wpi(data, columns=None, subscales=None)[source]

Compute the Wiener Patientenzufriedenheitsinventar (WPI).

It consists of the subscales with the item indices (count-by-one, i.e., the first question has the index 1!):

  • Access to Treatment (Zugang zur Behandlung - AccessTreatment): [2, 3, 4, 5, 6]

  • Staff Competence (Kompetenz des Personals - StaffCompetence): [11, 12]

  • Effectiveness of Treatment (Wirksamkeit der Behandlung - EffectTreatment): [22, 23, 24]

  • Station Equipment (Stationsaustattung - StationEquipment): [8, 9, 10]

  • Staff-Patient Relationship (Personal-Patientenbeziehung -Relation): [7, 15, 16, 17, 18, 19, 21]

  • Information about and Influence on Disease (Information über und Einflussnahme auf Erkrankung - Information): [13, 14, 20]

  • Overall Satisfaction (Insgesamte Zufriedenheit - OverallSatisfaction): [1],

  • Special Treatment Interventions (Spezielle Behandlungsinterventionen -TreatmentInterventions): [25, 28, 29, 30, 31],

  • Education about Medications (Aufklärung über Medikamente - Education): [26, 27],

  • Psychosocial Support Offer (Psychosoziales Unterstützungsangebot - Support): [32, 33, 34, 35]

Note

This implementation assumes a score range of [1, 4] (for items 1-24) and [1, 5] (for items 25-35). Use convert_scale() to convert the items into the correct range beforehand.

Warning

Column indices in subscales are assumed to start at 1 (instead of 0) to avoid confusion with questionnaire item columns, which typically also start with index 1!

Parameters
  • data (DataFrame) – dataframe containing questionnaire data. Can either be only the relevant columns for computing this score or a complete dataframe if columns parameter is supplied.

  • columns (list of str or pandas.Index, optional) – list with column names in correct order. This can be used if columns in the dataframe are not in the correct order or if a complete dataframe is passed as data.

  • subscales (dict, optional) – A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed.

Returns

WPI score

Return type

DataFrame

Raises
  • ValueError – if subscales is supplied and dict values are something else than a list of strings or a list of ints

  • ValidationError – if number of columns does not match

  • ValueRangeError – if values are not within the required score range

References

Berghofer, G., Schmidl, F., & Rudas, S. (2018). WPI-Wiener Patientenzufriedenheitsinventar.