mixedpowerSR: Function that runs the whole mixedpower power process

View source: R/meta_functions.R

mixedpowerSRR Documentation

Function that runs the whole mixedpower power process

Description

mixedpower() combines all three power options (databased, safeguard, rnorm). It runs them all by default and returns a data frame with results for all three options.

Usage

mixedpowerSR(
  model,
  data,
  fixed_effects,
  simvar,
  steps,
  critical_value,
  n_sim = 1000,
  confidence_level = 0.68,
  databased = T,
  safeguard = F,
  rnorm = F
)

Arguments

model

lme4 model: mixed model of interest

data

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

fixed_effects

vector of character elements: names of variables that are used as fixed effects in model emp

simvar

charackter element: name of the variable that contains the random effect we want to simulate along (e.g. subject number or stimuli number) in data

steps

vector of integers: steps for "simvar" you want to test power of

critical_value

integer: z/t value to test if a given fixed effect is significant

n_sim

integer: number of simulations to run

confidence_level

float: value between 0-1 indicating the width of the confidence interval used for the safeguard option

databased

logical value: indicates whether databased power simulation shoul be run

safeguard

logical value: indicates whether safeguard power simulation shoul be run

rnorm

logical value: indicates whether rnorm power simulation shoul be run

Value

A modified mixed model


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