generate_data: Title: Generate a test data frame for use with 'bouldr'

View source: R/generate_data.R

generate_dataR Documentation

Title: Generate a test data frame for use with bouldr

Description

Description: Generates a data frame of the correct format to be used with bouldr.

Usage

generate_data(
  obs.per,
  Diagnosis = c("Depression", "Anxiety"),
  Measure = c("A", "B", "C", "D", "E"),
  Informant = c("Parent", "Teacher", "Self")
)

Arguments

obs.per

Number of observations per cell. Total N would be this number times the number of options in the other three variables.

Diagnosis

A character vector of names for this grouping variable

Measure

A character vector of names for this grouping variable

Informant

A character vector of names for this grouping variable

Details

By default, the output data frame frame contains the following variables:

  • ID: participant ID

  • Diagnosis: the type of diagnosis. One or more – default 2: "Depression" and "Anxiety"

  • Measure: the form used to measure symptoms. One or more – default 5: (A through E)

  • Informant: the person taking the form. One or more – default 3: "Parent", "Teacher" and "Self"

  • Outcome: whether the diagnosis is present. Must be dichotomous – default: "yes" and "no"

  • Score: the score on the measure. A (continuous) numeric variable.

Note that these variable names are arbitrary; they have been chosen here to reflect common use-cases.

Value

A data frame that can be used in bouldr

Examples

generate_data(10)

jlangaa/bouldr documentation built on May 3, 2024, 5:40 a.m.