simulateDataset: Simulate a new data set

View source: R/simulation_functions.R

simulateDatasetR Documentation

Simulate a new data set

Description

simulateDataset() builds a new data set with a specified number of subjects. It uses the lme4::simulate() function to create new response values based on the mixed model fittet to the pilot data.

Usage

simulateDataset(n_want, data, model, simvar, fixed_effects, use_u = F)

Arguments

n_want

integer: how many subjects should the new data set include?

data

data frame: pilot data that fits the mixed model of interest

model

lme4 model: mixed model of interest

simvar

character element: name of the varaible containing the subject

fixed_effects

fixed effects specified in model number in data

Value

A modified mixed model


DejanDraschkow/mixedpower documentation built on Feb. 16, 2024, 7:58 a.m.