Skip to contents

Transforms data using recoding tables obtained by using ql_prepare() |> ql_harmoninze().

Usage

ql_transform(ql_harmonize_object, target_question, new_data)

Arguments

ql_harmonize_object

An object of type questionlink_harmonize, created by ql_harmonize()

target_question

A character value specifying the question which serves as the transformation target.

new_data

A data frame or tibble which contains the following columns "question", "response". The data frame also needs to contain the column "population", if the column was also used in the ql_prepare() step.

Value

An object of type questionlink

questionlink_harmonize

Details

This function is step 3 of 3 in the questionlink harmonization workflow. This function either transforms data which is supplied in the harmonization workflow, or transforms new data, which can be added via the "new_data" argument.

Handling of circular relays in ql_transform():

If circular relays are set to TRUE (default is FALSE) during the invocation of ql_prepare(), harmonizations from question A to question A contain the numerical equivalents that were found using the relays. If no circular relays are used, the results of ql_transformed contain the same response options for the target questions as were supplied in the data for question A to question A.