polyICT2 | R Documentation |
polyICT2 class generator
polyICT2 class generator
n |
The number of participants (see 'Fields'). |
phases |
The phases of the study (see 'Fields'). |
propErrVar |
The proportion of error variance (see 'Fields'). |
randFxMean |
The fixed effects effect sizes (see 'Fields'). |
randFxCorMat |
The correlation matrix of the random effects (see 'Fields'). |
randFxVar |
The variance of the random effects (see 'Fields'). |
muFUN |
A function for transforming random effects means (see 'Fields'). |
SigmaFun |
A function for constructing the covariance matrix (see 'Fields'). |
randFxOrder |
The order of the study. For example, a linear model would be of order 1, and a quadratic model would be order 2. |
designMat |
The design matrix for one participant showing the structure of study timing and phases. |
randFxCovMat |
The covariance matrix constructed using |
nObservations |
The number of observations per participant. |
variances |
Partition of the total variance into that due to random effects and that due to error variance at time = 1. |
expectedVariance |
The expected variances across all time points. This will
not match the variance of the simulated data unless n is large. See the |
unStdInputMat |
The unstandardized effect sizes constructed from the total
|
PersonAlyticsPower::designICT
-> polyICT
n
Numeric (integer). The number of participants. Default is 10.
phases
List. Each phase in one item in the list with the phase name
repeated for the number of time points in the phase. For example, an "ABA"
study with 5 time points each would be list(rep("A", 5), rep("B", 5),
rep("A", 5))
. See also the function makePhase
. Default is
makePhase()
.
propErrVar
Numeric. The propotion of total variance that is error variance. Default is .75.
randFxMean
List of lists of named numeric vectors. The general form is as follows, where the elipses (...) only illustrate that additional inputs could be given:
randFxMean = list(
group1 = list(
phase1 = c(i=0.0, s=0.0, q=0.0, ...),
phase2 = c(i=0.2, s=0.0, q=0.0, ...),
phase3 = c(i=0.0, s=0.0, q=0.0, ...),
...
),
group2 = list(
phase1 = c(i=0.0, s=0.0, q=0.0, ...),
phase2 = c(i=0.0, s=0.0, q=0.0, ...),
phase3 = c(i=0.0, s=0.0, q=0.0, ...),
...
),
...
)
The length of randFxMean length(randFxMean)
is the number of groups
and can take on any arbitrary name without quotes as long as it is a valid
variable name, see make.names
. In the example above, the group
names are 'group1' and 'group2', given without quotes.
Each group is itself a list whose length is the number of phases. The phase
names can take on any arbitrary name without quotes as long as they are valid
variable names. In the example above, length(randFxMean$group1)
is 3,
i.e., there are three phases, and they are named 'phase1', 'phase2',
and 'phase3'.
Each phase is a named numeric vector of effect sizes on the scale of Cohen's
d. In the example above, 'i' indicates intercepts, 's' are slopes, and 'q'
are quadratic terms. The elipsis (...) indicates higher order terms could
be included. All 'q' and 's' terms are zero inticating no change over time.
These could be left out and only 'i' included. Since i=0.2
in the
‘phase2' of 'group1', this indicates a small increase of Cohen’s d=0.2 during
'phase2' relative to 'phase1' (and 'phase3') in 'group1' and relative to all
phases in 'group2'. I other words, this is an ABA design with intervention
only in 'phase2' for 'group1'.
randFxCorMat
Numeric matrix. A symmetric correlation matrix with a dimension equal to the order of the model. For example, a quadratic model would correpspond to a 3x3 matrix. The diagonal elements must equal 1, the off diagonal elements must be between -1 and +1, and the matrix must be invertable.
randFxVar
Numeric vector. A vector of the same length as the order of the polynomial model containing the variances of the random effects. For example, in a quadratic model, 'randFxVar' would be length three, the first element would be the intercept variance, the second element would be the slope variance, and the third element would be the variance of the quadratic term.
SigmaFun
An R function. A function to convert randFxCorMat
and
randFxVar
into the covariance matrix randFxCovMat
. Default is
cor2cov
.
n
Numeric (integer). The number of participants. Default is 10.
phases
List. Each phase in one item in the list with the phase name
repeated for the number of time points in the phase. For example, an "ABA"
study with 5 time points each would be list(rep("A", 5), rep("B", 5),
rep("A", 5))
. See also the function makePhase
. Default is
makePhase()
.
propErrVar
Numeric. The propotion of total variance that is error variance. Default is .75.
randFxMean
List of lists of named numeric vectors. The general form is as follows, where the elipses (...) only illustrate that additional inputs could be given:
randFxMean = list(
group1 = list(
phase1 = c(i=0.0, s=0.0, q=0.0, ...),
phase2 = c(i=0.2, s=0.0, q=0.0, ...),
phase3 = c(i=0.0, s=0.0, q=0.0, ...),
...
),
group2 = list(
phase1 = c(i=0.0, s=0.0, q=0.0, ...),
phase2 = c(i=0.0, s=0.0, q=0.0, ...),
phase3 = c(i=0.0, s=0.0, q=0.0, ...),
...
),
...
)
The length of randFxMean length(randFxMean)
is the number of groups
and can take on any arbitrary name without quotes as long as it is a valid
variable name, see make.names
. In the example above, the group
names are 'group1' and 'group2', given without quotes.
Each group is itself a list whose length is the number of phases. The phase
names can take on any arbitrary name without quotes as long as they are valid
variable names. In the example above, length(randFxMean$group1)
is 3,
i.e., there are three phases, and they are named 'phase1', 'phase2',
and 'phase3'.
Each phase is a named numeric vector of effect sizes on the scale of Cohen's
d. In the example above, 'i' indicates intercepts, 's' are slopes, and 'q'
are quadratic terms. The elipsis (...) indicates higher order terms could
be included. All 'q' and 's' terms are zero inticating no change over time.
These could be left out and only 'i' included. Since i=0.2
in the
‘phase2' of 'group1', this indicates a small increase of Cohen’s d=0.2 during
'phase2' relative to 'phase1' (and 'phase3') in 'group1' and relative to all
phases in 'group2'. I other words, this is an ABA design with intervention
only in 'phase2' for 'group1'.
randFxCorMat
Numeric matrix. A symmetric correlation matrix with a dimension equal to the order of the model. For example, a quadratic model would correpspond to a 3x3 matrix. The diagonal elements must equal 1, the off diagonal elements must be between -1 and +1, and the matrix must be invertable.
randFxVar
Numeric vector. A vector of the same length as the order of the polynomial model containing the variances of the random effects. For example, in a quadratic model, 'randFxVar' would be length three, the first element would be the intercept variance, the second element would be the slope variance, and the third element would be the variance of the quadratic term.
SigmaFun
An R function. A function to convert randFxCorMat
and
randFxVar
into the covariance matrix randFxCovMat
. Default is
cor2cov
.
new()
polyICT2$new( n = 10, phases = makePhase(), propErrVar = 0.75, randFxMean = NULL, randFxCorMat = matrix(c(1, 0.2, 0.2, 1), 2, 2), randFxVar = c(1, 0.1), muFUN = function(x) x, SigmaFun = cor2cov, randFxOrder = NULL, designMat = NULL, randFxCovMat = NULL, nObservations = NULL, variances = NULL, expectedVariances = NULL, unStdInputMat = NULL )
print()
polyICT2$print(...)
makeData()
polyICT2$makeData(randFx, errors = NULL, y = NULL, ymean = NULL, yvar = NULL)
clone()
The objects of this class are cloneable with this method.
polyICT2$clone(deep = FALSE)
deep
Whether to make a deep clone.
Stephen Tueller stueller@rti.org
# produce a simple ICT design
defaultPolyICT <- polyICT$new()
# print a summary
defaultPolyICT
# view the fields that are generated by `$new()` but cannot be changed by
# the user
defaultPolyICT$randFxOrder
defaultPolyICT$designMat
defaultPolyICT$randFxCovMat
defaultPolyICT$nObservations
defaultPolyICT$variances
defaultPolyICT$expectedVariances
defaultPolyICT$unStdInputMat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.