calculate_scores: Calculate Survey Scores and Categories

View source: R/calculate.R

calculate_scoresR Documentation

Calculate Survey Scores and Categories

Description

calculate_scores adds new 100pt scale variables based on the 5pt scale variables provided.

calculate_categories adds new category (i.e., 3pt scale) variables based on the 5pt scale variables provided.

calculate_drivers adds new driver variables calculated as the average of the 100pt scale variables for that driver, defined by questions$MODEL_LINKAGE.

calculate_engagement adds a new engagement variable calculated as the average of the driver variables in eng_char.

Usage

calculate_scores(x, questions = WESquestions18)

calculate_categories(x, questions = WESquestions18)

calculate_drivers(x, questions = WESquestions18)

calculate_engagement(x, questions = WESquestions18,
  eng_char = c("BC Public Service Commitment",
  "Organization Satisfaction", "Job Satisfaction"))

Arguments

x

A data.frame.

questions

A data.frame containing the questions used in the survey. Default is the questions file from WES 2018. See WESquestions18 for reference.

eng_char

A character vector with the names of the driver variables used to calculate Engagement.

Details

calculate_scores takes a data.frame containing 5pt scale variables and appends new 100pt scale variables based on the following conversion:

  • 1 –> 0

  • 2 –> 25

  • 3 –> 50

  • 4 –> 75

  • 5 –> 100

calculate_categories takes a data.frame containing 5pt scale variables and appends new category variables based on the following conversion:

  • 1 –> 1

  • 2 –> 1

  • 3 –> 2

  • 4 –> 3

  • 5 –> 3

The questions data.frame input provides the framework for the survey. It must contain the variables Q_ID, Q_COLUMN, MODEL_LINKAGE, Q_TEXT, Q_TEXT_FORMAT, Q_SECTION, and Driver_ID. Q_COLUMN contains the names of the 5pt scale variables of x. MODEL_LINKAGE provides the bridge between the survey questions and the drivers in the WES model. See the default questions data.frame WESquestions18 for details.

Value

A data.frame with the same variables as x plus additional columns depending on the function used. 100pt scale variables have the format <Q_COLUMN>S and category variables have the format <Q_COLUMN>_3cat.

Note

As the driver variables are needed to calculate Engagement, running calculate_engagement will call calculate_drivers. Similarly, as the 100pt scale variables are needed to calculate the drivers, calculate_drivers will call calculate_scores. Hence, a call to calculate_engagement, will result in the question and driver scores being calculated and appended to the returning data.frame.


bcgov/WEStblr documentation built on Dec. 2, 2022, 10:53 a.m.