| drawPVs {Dire} | R Documentation |
Draw plausible values (PVs) from an mml fit
Description
Draw plausible values (PVs) from an mml fit
Usage
drawPVs(x, npv, pvVariableNameSuffix = "_dire", ...)
## S3 method for class 'summary.mmlMeans'
drawPVs(x, npv = 5L, pvVariableNameSuffix = "_dire", ...)
## S3 method for class 'mmlMeans'
drawPVs(
x,
npv = 5L,
pvVariableNameSuffix = "_dire",
stochasticBeta = FALSE,
normalApprox = TRUE,
newStuDat = NULL,
newStuItems = NULL,
returnPosterior = FALSE,
construct = NULL,
...
)
## S3 method for class 'mmlCompositeMeans'
drawPVs(
x,
npv = 5L,
pvVariableNameSuffix = "_dire",
stochasticBeta = FALSE,
normalApprox = TRUE,
newStuDat = NULL,
newStuItems = NULL,
verbose = TRUE,
...
)
Arguments
x |
a fit from a call to |
npv |
integer indicating the number of plausible values to draw |
pvVariableNameSuffix |
suffix added to new PV variables after construct name and before the plausible value ID. For example, if there is a construct |
... |
additional parameters |
stochasticBeta |
logical when |
normalApprox |
logical must be |
newStuDat |
new |
newStuItems |
new |
returnPosterior |
logical set to |
construct |
character, changes the name of the columns in the final data frame |
verbose |
logical set to |
Details
When the argument passed to stocasticBeta is a data frame then each column is an element that will be used as a
regression coefficient for that index of the coefficients vector. The row index used for the nth PV will be the nth row.
Value
when returnPosterior is FALSE returns a object of class DirePV which is a list of two elements.
first, a data frame with a row for every row of newStuDat (or the original stuDat object)
idthe value ofidVarin the model run[construct][pvVariableNameSuffix][L]every other column is a plausible value of this format. The[construct]is the name of the construct, the[pvVariableNameSuffix]is the value of thepvVariableNameSuffixargument, and the[L]part is the plausible value index, from 1 tonpv.
The second argument is named newpvvars and is a list with an element for each set of construct that lists all of the variables in that construct.
When returnPosterior is TRUE returns list with three elements. One is named posterior and has one
row per idvar level in the newStuDat argument and three columns:
idthe value ofidVarin the model runmuthe posterior meansdthe posterior standard deviation
the second list element is named X that is the design matrix for newStuDat (see Value for mml). The third list element is
the rr1 element returned from mml with one column for each individual in newStuDat (see Value in mml).
Author(s)
Paul Bailey, Sun-joo Lee, and Eric Buehler
Examples
# See Examples in mml