sqp_construct is designed to create SQP tibbles by manually inserting new metrics such as quality or validity.

sqp_construct(question_name, metrics, all_columns = FALSE)

sqp_construct_(question_name, metrics, all_columns = FALSE)

Arguments

question_name

a character string that will be used as the question name

metrics

a list containing new SQP metrics. Currently it only supports quality, reliability and validity. Can also specify one of the metrics and the remaining are set to NA by default

all_columns

if TRUE will return all columns (quite a few) that can be returned by the get_estimates function. See get_estimates for the description of which variables would be created. If FALSE (default) it will return only columns question, quality, reliability and validity.

Value

a tibble of one row with the supplied metrics. It also has class sqp for further manipulations within the sqpr package.

Details

sqp_construct_ is useful if you're interested in programming with sqpr rather than using it interactively. If you want to use sqp_construct inside a function, use the equivalent sqp_construct_ which uses standard evaluation.

Examples

sqp_construct(new_question, list(quality = 0.3))
#> # A tibble: 1 x 4 #> question reliability validity quality #> <chr> <dbl> <dbl> <dbl> #> 1 new_question NA NA 0.3
sqp_construct(new_question, list(quality = 0.3, validity = 0.2))
#> # A tibble: 1 x 4 #> question reliability validity quality #> <chr> <dbl> <dbl> <dbl> #> 1 new_question NA 0.2 0.3
## Note that specifying a column which is not availabe in SQP 3.0 data ## will throw an error if (FALSE) { sqp_construct(new_question, list(random_col = 0.3, validity = 0.2)) # Error: One or more of the specified metrics don't match the SQP column names }