effectSize: Effect Size Calculation

Description Usage Arguments Value Examples

View source: R/effect_size.R

Description

Calculates the effect size of a moderator when there are only two treatment groups. More details please see: Kraemer, H. C. (2013). Discovering, comparing, and combining moderators of treatment on outcome after randomized clinical trials: a parametric approach. Statistics in medicine, 32(11), 1964-1973.

Usage

1
effectSize(response, treatment, moderator)

Arguments

response

A vector giving the outcome for all subjects

treatment

A vector giving the treatment group index for all subjects

moderator

A vector giving the moderator

Value

eff_size the calculated effect size for the moderator

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#constructing the covariance matrix
co <- matrix(0.2, 10, 10)
diag(co) <- 1
dataEx <- data_generator1(d = 0.3, R2 = 0.5, v2 = 1, n = 3000,
                    co = co, beta1 = rep(1,10),inter = c(0,0))
#fit the GEM
dat <- dataEx[[1]]
model_nu <- gem_fit(dat = dat, method = "nu")
augmentData <- model_nu[[4]]
es <- effectSize(augmentData$y, augmentData$trt, augmentData$Z) 
#this should be the same with effect size calculated by the gem_fit function

suzhesuzhe/GEM documentation built on May 26, 2017, 11 p.m.