Learn R Programming

reproducer (version 0.4.2)

simulateRandomizedDesignEffectSizes: simulateRandomizedDesignEffectSizes

Description

This simulates one of four distributions, and finds the values of ktau, phat and Cliffs d and their variances. It assumes equal group sizes. It returns values of the effect sizes and their variance for a simulated randomized experiment with two treatments. It returns whether to not each non-parametric effect size was significant. It also returns the parametric (unstandardized and unstandardized) Effect Size and the whether the t-test was signficiant.

Usage

simulateRandomizedDesignEffectSizes(mean, sd, diff, N, type = "n", StdAdj = 0)

Value

data frame incl. the non-parametric and parametric effect sizes and whether the effect sizes are significant at the 0.05 level.

Arguments

mean

The mean used for one of the treatment groups

sd

The spread used for both treatment groups. It mus be a real value greater than 0.

diff

This is added to the parameter mean, to define the mean of the other treatment group. It can be a real value avd can take the value zero.

N

this is the number of observations in each group. It must be an integer greater than 3.

type

this specifies the underlying distribution used to generate the data. it takes the values "n" for a normal distribution, "l" for lognormal distribution,"g" for a gamma distribution, "lap" for a Laplace distribution.

StdAdj

this specifes the extent of variance instability introduced by the treatment.

Author

Barbara Kitchenham and Lech Madeyski

Examples

Run this code
set.seed(123)
simulateRandomizedDesignEffectSizes(mean=0,sd=1,diff=0.8,N=10,type="n",StdAdj=0)
# A tibble: 1 x 15
# phat varphat dfphat sigphat     d   vard sigd    cor varcor sigCVt ttestp    ES Variance StdES
# MedDiff
#                          
# 
#1  0.75  0.0152   17.5 FALSE     0.5 0.0624 FALSE 0.263 0.0175 FALSE  0.0507 0.934  0.994 0.937
# 1.26
set.seed(123)
simulateRandomizedDesignEffectSizes(mean=0,sd=1,diff=0.8,N=10,type="l",StdAdj=0)
# A tibble: 1 x 19
#   phat varphat dfphat sigphat     d   vard sigd    cor varcor sigCVt ttestp    ES Variance
# StdES MedDiff transttest
#                          
#          
#1  0.75  0.0152   17.5 FALSE     0.5 0.0624 FALSE 0.263 0.0175 FALSE  0.0958  2.41     9.01
# 0.802    2.32     0.0507
# … with 3 more variables: EStrans , StdEStrans , VarTrans 

Run the code above in your browser using DataLab