binCalcICC: BinCalcICC: calculate ICC values for data from CRTs with...

Description Usage Arguments Value Author(s) Examples

View source: R/binCalcICC.R

Description

BinCalcICC: calculate ICC values for data from CRTs with binary outcomes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
binCalcICC(
  data = NULL,
  method = c("aov", "aovs", "keq", "kpr", "keqs", "kprs", "stab", "ub", "fc", "mak",
    "peq", "pgp", "ppr", "rm", "lin", "sim"),
  ci.type = c("aov", "wal", "fc", "peq", "rm"),
  alpha = 0.05,
  kappa = 0.45,
  nAGQ = 1,
  sim.min = 1,
  sim.max = 100,
  nsim = 1000
)

Arguments

data

A dataframe of the sort generated by cps.binary() or cps.ma.binary(); can be generate by using all.sim.data = TRUE.

method

The method to be used to compute ICC. A single or multiple methods can be used at a time. By default, all 16 methods will be used. See Details for more information.

ci.type

The type of confidence interval to be computed. By default all 5 types will be reported. See Details for more information.

alpha

The significance level to be used while computing the confidence interval. Default value is 0.05.

kappa

Value of Kappa to be used in computing Stabilized ICC when the method stab is chosen. Default value is 0.45.

nAGQ

An integer, as in glmer function of package lme4, denoting the number of points per axis for evaluating the adaptive Gauss-Hermite approximation to the log-likelihood. Used when the method lin is chosen. Default value is 1.

sim.min

Optional, integer. The number of the first simulation for which ICC will be calculated. Default is 1.

sim.max

Optional, integer. The number of the last simulation for which ICC will be calculated. Default is nsim.

nsim

Number of Monte Carlo replicates used in ICC computation method. sim. Default is 1000.

Value

A list with the following components:

estimate

A dataframe containing the name of methods used and corresponding estimates of Intracluster Correlation coefficients

confidence.intervals

A dataframe containing names of confidence interval types and corresponding estimated confidence intervals

Author(s)

Alexandria C. Sakrejda (acbro0@umass.edu) and Ken Kleinman (ken.kleinman@gmail.com)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
bin.ma.rct.unbal <- cps.ma.binary(nsim = 3,
                            nsubjects = list(rep(200, times=15),
                            rep(150, times=15),
                            rep(170, times=15)),
                            narms = 3,
                            nclusters = 15,
                            probs = c(0.15, 0.23, 0.22),
                            sigma_b_sq = c(0.1, 0.1, 0.1),
                            alpha = 0.05, allSimData = TRUE,
                            seed = 123, cores="all")

binCalcICC(data = bin.ma.rct.unbal, nsim = 1000)

## End(Not run)

## Not run:  
binary.sim = cps.binary(nsim = 100, nsubjects = 20,
  nclusters = 10, p1 = 0.8,
  p2 = 0.5, sigma_b_sq = 1,
  sigma_b_sq2 = 1.2, alpha = 0.05,
  method = 'glmm', allSimData = TRUE)

binCalcICC(data = binary.sim, nsim = 1000)

## End(Not run)

nickreich/clusterPower documentation built on Feb. 3, 2021, 6:54 p.m.