sim_mixed_df: Generate a mixed design from existing data

Description Usage Arguments Value Examples

View source: R/sim_mixed_df.R

Description

sim_mixed_df() produces a data table with the same distributions of by-subject and by-item random intercepts as an existing data table.

Usage

1
2
3
4
5
6
7
8
sim_mixed_df(
  data,
  sub_n = NULL,
  item_n = NULL,
  dv = "y",
  sub_id = "sub_id",
  item_id = "item_id"
)

Arguments

data

the existing tbl

sub_n

the number of subjects to simulate (if NULL, returns data for the same subjects)

item_n

the number of items to simulate (if NULL, returns data for the same items)

dv

the column name or index containing the DV

sub_id

the column name or index for the subject IDs

item_id

the column name or index for the item IDs

Value

a tbl

Examples

1
sim_mixed_df(faceratings, 10, 10, "rating", "rater_id", "face_id")

faux documentation built on Sept. 14, 2021, 1:08 a.m.