reset_contrasts: Resets specified contrasts in the simulated dataset

View source: R/utility_functions.R

reset_contrastsR Documentation

Resets specified contrasts in the simulated dataset

Description

reset_contrasts() makes sure that contrasts in the simulated dataset equals the contrasts in the pilotdata used for simulation. Because the simulate_sanplesize function loses specified contrasts, they need to be re-specified. reset_contrasts() checks all contrasts on the fixed-effect-variables in the pilot dataset and copies them to the simulated dataset.

Usage

reset_contrasts(simulated_data, data, model, fixed_effects)

Arguments

simulated_data

simulated data set (= output of simulate_samplesize)

data

pilot data used for power simulation

model

mixed model used for power simulation. Needs to fit data.

fixed_effects

names of variables in data that are used as fixed effects in model

Value

Date frame


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