powerClass-class: Class '"powerClass"'

powerClass-classR Documentation

Class "powerClass"

Description

Objects of S4 class powerClass are exceptionally suitable for suggested approach to power analysis. Class serves a purpose of container of odds and ends of magnitude of information both on log-linear estimates and fit statistics as well as on the power analysis results, i.e., alpha and beta errors distributions across 11 sample sizes. Class also supported by getters and setters, text and graphic outputs.

Objects from the Class

Objects can be created by calls of the form new("powerClass", ...).

Slots

varnames:

Vector of mode "character" lists names of columns in design matrix.

effectsname:

Vector of mode "character" lists names of columns in design matrix that constitute effect under study. Latter is given by arg effect in function PowerPoisson.

cal:

Object of class "call" saves the function call.

Ntotal:

Vector of mode "numeric". Contains sample size of the data, scale_min, scale_max values

estim:

Object of class "list" List of 11 lists of log-linear parameters estimates and model fit statistics across 11 sample sizes

power1:

Object of class "list". Contains lists for each column (contrast) of design matrix involved in effect under study. Each such list containes numeric vectors of values of simulated reg.coefficients, z-scores, power. Slot power1 keeps the data pertaining to smallest sample size

power2:

power2:power11 slots envelop the same structured information across consecutive sample sizes 2:11(largest).

power3:

-//-

power4:

-//-

power5:

-//-

power6:

-//-

power7:

-//-

power8:

-//-

power9:

-//-

power10:

-//-

power11:

-//-

Methods

[

signature(x = "powerClass", i = "character", j = "integer", drop = "logical"): getter, see Method for Function [

[<-

signature(x = "powerClass", i = "character", j = "integer", value): setter, see Method for Function [<-

plot

signature(x = "powerClass"): plots images of z-score and power distributions along the range of sample sizes

print

signature(x = "powerClass"): prints estimated log-linear model parameters and fit statistics as well as results of power analysis along the range of sample sizes

Author(s)

Ocheredko Oleksandr Ocheredko@yahoo.com

References

Ocheredko O.M. MCMC Bootstrap Based Approach to Power and Sample Size Evaluation. https://www.amazon.com/gp/product/1946728039/

Examples

require(ltable)
showClass("powerClass")
new("powerClass")
data(tdata, package="ltable")
## For better illustration You should increase draw and burnin pars
pres<-MCPower(Counts~smoker +contraceptive +tromb +  
contraceptive*tromb, scale_max=1.5, effect="contraceptive*tromb", 
draw=1000, burnin=300, data=tdata)
print(pres)
plot(pres,3)
pres["estim", 1]$betas
pres["power11", 1]$power
pres["power1", 1]$z

ltable documentation built on Aug. 17, 2023, 1:06 a.m.