powersim: Power simulation

View source: R/powersim.R

powersimR Documentation

Power simulation

Description

Using the R packages metafor and pwr to calculate a powersimulation for a given dataset and specified parameters. The results are plotted using ggplot2.

Usage

powersim(yi, vi, measure, d, n, pval = 0.05)

Arguments

yi

A string of the variable which holds the vector of length k with the observed effect sizes or outcomes in the selected dataset (d)

vi

A string of the variable which holds the vector of length k with the corresponding sampling variances in the selected dataset (d)

measure

A character string indicating underlying summary measure. Depending on the type of measure the input data for fitting needs to be transformed and backtransformed later.

d

A string representing the dataset name that should be used for fitting.

n

A Integer representing the sample size which should be used for the power simulation.

pval

A Numeric representing the significance level which should be used for the power simulation.

Value

returns a power plot

Author(s)

Robert Studtrucker


leibniz-psychology/PsychOpen-CAMA-R-package documentation built on April 17, 2025, 5:27 p.m.