Learn R Programming

npboottprm (version 0.3.2)

replext_t4_c7.1: Replicate and Extend Simulation Results from Table 4 Cell 7.1

Description

This function is a customized version of 'replext_t4_c1.1', created to replicate and extend the simulation results from Table 4 cell 7.1 of the paper by Dwivedi et al. (2017). It is configured to use different distributions for each group, specifically a lognormal distribution for the first group and a Chi-squared distribution for the second group, aligning with the specific cell conditions.

Usage

replext_t4_c7.1(
  rdist = c("rlnorm", "rchisq"),
  par1_1 = 1,
  par2_1 = 0.6,
  par1_2 = 6,
  par2_2 = 0,
  n1 = c(5, 5, 10),
  n2 = c(5, 10, 10),
  n_simulations = 10000,
  nboot = 1000,
  conf.level = 0.95
)

Value

A data frame with columns for each sample size pair (n1, n2) and the proportions of significant p-values for each test (ST, WT, NPBTT, WRST, PTTa, PTTe).

Arguments

rdist

Vector of distribution types, with the defaults set to 'rlnorm' (lognormal) for the first group and 'rchisq' (Chi-squared) for the second group. Other options include 'rpois' (Poisson) and 'rcauchy' (Cauchy).

par1_1

First parameter (meanlog) for the first group's lognormal distribution, default is 1.

par2_1

Second parameter (sdlog) for the first group's lognormal distribution, default is 0.6.

par1_2

First parameter (df) for the second group's Chi-squared distribution, default is 6.

par2_2

Second parameter for the second group's Chi-squared distribution, typically 0.

n1

Vector of sample sizes for the first group.

n2

Vector of sample sizes for the second group, must be the same length as n1.

n_simulations

Number of simulations to run, default is 10,000.

nboot

Number of bootstrap samples, default is 1000.

conf.level

Confidence level for calculating p-value thresholds, default is 0.95.

References

Dwivedi AK, Mallawaarachchi I, Alvarado LA. Analysis of small sample size studies using nonparametric bootstrap test with pooled resampling method. Stat Med. 2017 Jun 30;36(14):2187-2205. doi: 10.1002/sim.7263. Epub 2017 Mar 9. PMID: 28276584.

Examples

Run this code
replext_t4_c7.1(n1 = c(10), n2 = c(10), n_simulations = 1)

Run the code above in your browser using DataLab