compose_dataset: Composes dataset

Description Usage Arguments Value Examples

View source: R/compose_dataset.R

Description

Composes a dataset in long format for the usage in birtms from 1st) a dataset that contains the responsedata linked to the person identifiers (and possibly person covariables) 2nd) a dataset that contains the person covariables linked to the person identifiers 3rd) a dataset that contains the item covariables linked to the item identifiers (the column names from the responsedataset) and 4th) a dataset that contains covariables that vary by person and item (called situation covariables) linked to person and item identifiers (e. g. ordering of the items in a test that randomizes the item order)

Usage

1
2
3
4
5
6
7
8
compose_dataset(
  response_data,
  response_columns,
  variable_specifications = NULL,
  person_data = NULL,
  item_data = NULL,
  situation_data = NULL
)

Arguments

response_data

A tibble or dataframe with person identifiers and responsdata (and possibly person covariables).

response_columns

A character or symbol vector with all columns that represent item responses or a range of columns specified corresponding to dplyr::select() rules (e. g.: item01:item25).

variable_specifications

Named list of characters or strings.

person_data

A tibble or dataframe with person identifiers linked to person covariables.

item_data

A tibble or dataframe with item identifiers linked to item covariables.

situation_data

A tibble or dataframe with person and item identifiers linked to situation covariables.

Value

A tibble.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
response_data <- tibble::tribble(
~person, ~i1, ~i2,
'a', 1, 0,
'b', 1, 1,
'c', 0, 0,
 )

variable_specs <- list(response = 'response', item ='item', person = 'person')

compose_dataset(response_data, i1:i2, variable_specs)

Famondir/birtms documentation built on Feb. 18, 2022, 2:51 a.m.