sim_power_ccc: Power and confidence interval range

View source: R/sim_power_ccc.R

sim_power_cccR Documentation

Power and confidence interval range

Description

Power and confidence interval range obtained by simulation

Usage

sim_power_ccc(
  n = 30,
  nrep = 2,
  nsim = 300,
  r0 = 0,
  alpha = 0.05,
  model = NULL,
  b = NULL,
  g = NULL,
  mu = 0,
  sa = 1,
  sab = 0,
  sag = 0,
  bg = NULL,
  se = 1,
  extra.info = TRUE,
  vecD = NULL,
  covar = NULL,
  int = FALSE,
  rho = 0,
  cl = 0.95,
  control.lme = list(),
  transf = "F2",
  future_seed = TRUE,
  workers = 15
)

Arguments

n

Integer. Number of subjects

nrep

Integer. Number of replicates

nsim

Integer. Number of data sets simulated.

r0

Integer. Null hypothesis value.

alpha

Type-I error rate.

model

object of class lme.

b

Vector. Method fixed effects.

g

Vector. Time fixed effects.

mu

Integer. Overall mean.

sa

Integer. Standard deviation of subject's random effect.

sab

Integer. Standard deviation of subject-method interaction's random effect.

sag

Integer. Standard deviation of subject-time interaction's random effect.

bg

Vector. Method-time interaction's fixed effects

se

Integer. Standard deviation of random error effect.

extra.info

Logical. Should the information about CCC and variance components simulated be shown? Default is set to TRUE.

vecD

Vector of weights. The length of the vector must be the same as the number of repeated measures.

covar

Character vector. Name of covariates to include in the linear mixed model as fixed effects.

int

Binary indicating if the subject-method interaction has to be included in the model when analyzing the non-longitudinal setting (defaults to FALSE).

rho

Within subject correlation structure. A value of 0 (default option) stands for compound symmetry and 1 is used for autorregressive of order 1 structure.

cl

Confidence level.

control.lme

A list of control values for the estimation algorithm used in lme function. For further details see lme help.

transf

Character string. Whether to apply a transformation of the coefficient for inference. Valid options are: "F" for Fisher's Z-transformation; "F2" For Fisher's Z-transformation setting m=2 (default); "KG" Konishi-Gupta transformasion; "None", no transformation is applied. See *Details* for further information.

future_seed

Logical/Integer. The seed to be used for parallellization. Further details in furrr_options.

workers

Integer. Number of cores to be used for parallellization. Default is 15. Capped to number of available cores minus 1.

Details

The power and the range of the confidence interval are computed using the approach suggested in Choudhary and Nagaraja (2018). Data sets are simulated by setting the fixed effects values and the standard deviation of the random effects. The CCC and its standard error are estimated in each data set, along with its 95% confidence interval and the Wald test Ztest.

Value

A data frame with the following components:

  • n Number of subjects

  • reps Number of replicates

  • CCC. Median of the CCC estimates.

  • Power. Empirical power computed as proportion of times the null hypothesis is rejected using a type-I error rate of alpha.

  • SEICC. Average of CCC standard errors.

  • SEZ. Average of transformed CCC standard errors.

  • Range IC95. Average of CCC confidence interval widths.

References

Choudhary, P.K. and Nagaraja, H.N. (2018). Measuring Agreement-Models, Methods, and Applications. John Wiley & Sons

Examples


# Power to test the CCC is above 0.8 with 35 subjects and 4 replicates.
# Two methods, three times. Simulated CCC=0.87.
sim_pw<-sim_power_ccc(n = 35, nrep=4, nsim=500, r0=0.8, b = c(-0.5,0.5), 
g=c(-0.25,0,0.25), mu = -0.25, sa = 4,sab=0.5,sag=1,
bg=c(-0.5,-0.25,0.25,-0.5,0.25,0.75),se = 1)





cccrm documentation built on Oct. 19, 2024, 9:06 a.m.