powered by
sim_mixed_df() produces a data table with the same distributions of by-subject and by-item random intercepts as an existing data table.
sim_mixed_df()
sim_mixed_df( data, sub_n = NULL, item_n = NULL, dv = "y", sub_id = "sub_id", item_id = "item_id" )
a tbl
the existing tbl
the number of subjects to simulate (if NULL, returns data for the same subjects)
the number of items to simulate (if NULL, returns data for the same items)
the column name or index containing the DV
the column name or index for the subject IDs
the column name or index for the item IDs
sim_mixed_df(faceratings, 10, 10, "rating", "rater_id", "face_id")
Run the code above in your browser using DataLab