Learn R Programming

PoweR (version 1.1.4)

print.power: Latex table for power simulations

Description

Transform the power values given by function powcomp.fast into a LaTeX code for creating the table of power simulations.

Usage

# S3 method for power
print(x, digits = 3, latex.output = FALSE, template = 1,
summaries = TRUE, ...)

Value

No return value. The function prints a formatted representation of power analysis results, optionally in 'LaTeX' format. The printed object is of class "powerX", where X is the template number.

Arguments

x

power values given by function powcomp.fast.

digits

control the number of decimal places. It can take values from 0 to 3.

latex.output

logical. If TRUE, we output LateX code for the table of power simulations. If FALSE, we output this table in the R Console.

template

integer, template to use for the (LaTeX) printing of values. Only template = 1 is defined for the moment.

summaries

logical, to display the summaries Average power table, Average gap table and Worst gap table.

...

further arguments passed to or from other methods.

Author

P. Lafaye de Micheaux, V. A. Tran

References

Pierre Lafaye de Micheaux, Viet Anh Tran (2016). PoweR: A Reproducible Research Tool to Ease Monte Carlo Power Simulation Studies for Studies for Goodness-of-fit Tests in R. Journal of Statistical Software, 69(3), 1--42. doi:10.18637/jss.v069.i03

Puig, P. and Stephens, M. A. (2000), Tests of fit for the Laplace distribution, with applications, Technometrics, 42, 417--424.

See Also

See print.critvalues.

Examples

Run this code
## Regenerate Table 6 from Puig (2000) (page 424)
# Change M = 50000 for more accurate results
M <- 10
law.index <- 1
vectn <- c(10,15,20,35,50,75,100)
level <- c(0.05)
stat.indices <- c(43,44,42,45,46)
law.indices <- c(2,3,4)
alter <- list(stat43 = 3,stat44 = 3,stat42 = 3,stat45 = 3,stat46 = 3)
critval <- many.crit(law.index,stat.indices,M,vectn,level,alter,law.pars = NULL,parstat = NULL)
table6 <- powcomp.fast(law.indices,stat.indices,vectn,M,level,critval = critval,alter,
                       parlaws = NULL,parstats = NULL,nbclus = 1)
print.power(table6,digits=0,latex.output = TRUE)

Run the code above in your browser using DataLab