Learn R Programming

PowRPriori (version 0.1.2)

.simulate_outcome: Simulate the Outcome Variable

Description

An internal helper function that takes a complete design matrix and simulates the dependent variable based on the specified fixed and random effects.

Usage

.simulate_outcome(
  design_df,
  formula,
  fixed_effects,
  sds_random,
  family = "gaussian"
)

Value

The input design_df with an added column for the outcome variable.

Arguments

design_df

The data frame from .create_design_matrix.

formula

The model formula.

fixed_effects

A list of the fixed effects coefficients.

sds_random

A list of the random effects' standard deviations and correlations.

family

A string indicating the model family.