ICTpowerSim: ICTpowerSim - automate a series of parametric bootstrap power...

View source: R/ICTpowerSim.R

ICTpowerSimR Documentation

ICTpowerSim - automate a series of parametric bootstrap power simulations.

Description

ICTpowerSim - automate a series of parametric bootstrap power simulations.

Usage

ICTpowerSim(
  designs,
  pReportName = "ICTpowerSimResults",
  B = 1000,
  seed = 1,
  save = NULL,
  alpha = 0.05,
  cores = parallel::detectCores() - 1,
  standardize = list(dv = TRUE, ivs = FALSE, byids = TRUE),
  dotar = FALSE,
  ...
)

Arguments

designs

A named list of designs. in ICTpower. The names in the named list will be passed to the parameter file in ICTpower.

pReportName

Character. A name used to create output files. The default is "ICTpowerSimResults"

B

Numeric (integer). The number of replicated data sets per design in designs.

save

NULL or character. Should the data be saved? If NULL (the default) raw data will not be saved. Other options include save='csv' and save='RData'. This will be combined with the names of designs to pass to the file option in ICTpower.

alpha

See ICTpower.

cores

See ICTpower.

standardize

See ICTpower.

dotar

Logical. The default is FALSE. Should the data files (if requested, see save) and analysis results be saved in a *.tar file with the same name as pReportName and then delete the unzipped copies of these files? This is suggested wheth the number of designs is large. The summary of power across all conditions will no be included in the *.tar archive. It is strongly encourage that a test run with only three designs and B=3 is attempted at first to make sure archiving is done correctly. If the path names resulting from your working directory are too long, archiving will fail with the error "storing paths of more than 100 bytes is not portable". See tar.

Seed

Numeric (integer). The random seed for ensuring the simulation can be replicated.

Author(s)

Stephen Tueller stueller@rti.org

Examples


## Not run: 

# set up two designs
designs <- list()
designs[["defaultsN20"]] <- polyICT$new()
designs[["defaultsN40"]] <- designs[["defaultsN20"]]$clone(deep=TRUE)
designs[["defaultsN40"]]$update(groups = c(group1=40, group2=40))

# run the simulation (without saving output, console print only)
ICTpowerSim(designs, pReportName  = "ex1", B=3)

# rerun with a finite population correction
ICTpowerSim(designs, pReportName  = "ex1fpc", B=3, seed=2, fpc=100)


## End(Not run)

ICTatRTI/PersonAlyticsPower documentation built on Dec. 13, 2024, 11:08 p.m.