Description Usage Arguments Value Examples

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.

1 | ```
effectSize(response, treatment, moderator)
``` |

`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 |

`eff_size`

the calculated effect size for the moderator

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.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.