get_estimates: Extract variable estimates from the SQP 3.0 prediction...

Description Usage Arguments Details Value See Also Examples

View source: R/estimates.R

Description

Extract variable estimates from the SQP 3.0 prediction algorithm

Usage

1
2
3
get_estimates(id, all_columns = FALSE, authorized = TRUE)

get_question_name(id)

Arguments

id

a numeric vector containing the id(s) of variable(s) of interest. Can be one or more id's.

all_columns

a logical stating whether to extract all available columns from the SQP 3.0 database. See the details section for a list of all possible variables.

authorized

TRUE to return only the authorized prediction or FALSE to return all available predictions. If set to FALSE a a warning is issued reminding the user to pick one prediction for each variable based on the user_id and user_username columns.

Details

SQP predictions can be both 'authorized' predictions, which are performed by the SQP 3.0 software, and 'crowd-sourced' predictions which are added to the database by other users. By default, get_estimates always returns the 'authorized' prediction when it is available. When it is not, it returns the first non-authorized prediction, and so on. If the user wants to choose a specific prediction, then authorized = FALSE will return all available predictions for each question. If authorized = FALSE and all_columns = FALSE, get_estimates raises an error because there is no way of disentangling which prediction is authorized/unauthorized without the additional user_id column.

get_estimates returns a four column tibble with the question name and the estimates for quality, reliability and validity. However, if all_columns is set to TRUE the returned tibble contains new columns. Below you can find the description of all columns:

Value

get_estimates returns a tibble with the predictions. If id is of length 0, get_estimates returns an empty data frame. In both situations, the number of columns depends on the all_columns argument. get_question_name returns a character vector with the question name(s) unless id is of length 0 where it returns an empty character.

See Also

sqp_login for logging in to the SQP 3.0 API through R and find_questions and find_studies for locating the variables of interest to use in get_estimates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

# Log in with sqp_login first. See ?sqp_login
sqp_login()

get_estimates(c(1, 2, 86))

get_estimates(c(1, 2, 86), all_columns = TRUE)

# Explore variable names

get_question_name(1)

get_question_name(1:10)


## End(Not run)

asqm/sqpr documentation built on May 28, 2020, 5:13 a.m.