simData(simsem)
simData()所属R语言包:simsem
Create a Data object
创建一个数据对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function will be used to create data specification and ready for data simulation.
这个函数将被用于创建数据的说明书和准备数据仿真。
用法----------Usage----------
simData(param, ...)
参数----------Arguments----------
参数:param
Model specification matrices that are created by simSetCFA, simSetPath, or simSetSEM or the analysis output.
所建立的simSetCFA,simSetPath或simSetSEM或分析输出的型号规格矩阵。
参数:...
Other values that will be explained specifically for each class
其他值,将具体说明用于每个类别
Details
详细信息----------Details----------
This function will use mvrnorm function in MASS package to create data from model implied covariance matrix if the data distribution object (SimDataDist) is not specified. It the data distribution object is specified, the Gaussian copula model is used. See SimDataDist for further details. For the model-based bootstrap, the transformation proposed by Yung & Bentler (1996) is used. This procedure is the expansion from the Bollen and Stine (1992) bootstrap including a mean structure. The model-implied mean vector and covariance matrix with trivial misspecification will be used in the model-based bootstrap if misspec is specified. See page 133 of Bollen and Stine (1992) for a reference.
此功能将使用mvrnorm功能MASS包来创建数据模型隐含的协方差矩阵,如果数据未指定分配对象(SimDataDist)。数据分布对象被指定时,用于高斯copula模型。见SimDataDist进一步的细节。对于基于模型的自举,使用容特勒(1996)所提出的转化。这个程序是从博伦和斯坦(1992)的启动,包括平均结构的扩展。该模型隐含的意思是如果misspec指定向量和协方差矩阵琐碎的设定错误,将被用于基于模型的引导。请参阅第133页的博伦和STINE的(1992)为参考。
值----------Value----------
SimData object that save data model specification.
SIMDATA对象保存的数据模型规范。
详细...----------Details in ...----------
n: Desired sample size
N:所需的样本量
misspec: Model misspecification matrices that are created by simMisspecCFA, simMisspecPath, or simMisspecSEM.
misspec:型号设定错误的矩阵所创建的simMisspecCFA,simMisspecPath或simMisspecSEM。
equalCon: Equality constraints that are created by simEqualCon. This will specify equality econstraints of parameters in data generation process.
equalCon:平等的制约因素所建立的simEqualCon。这将指定的参数的平等econstraints在数据生成过程。
maxDraw: The maximum number of random drawn parameters and misspecification model until all parameters in the model are eligible (no negative error variance, standardized coefficients over 1).
maxDraw:随机绘制的参数和设定错误模型,在模型中,直到所有参数资格(没有负的误差方差,标准化系数大于1)的最大数量。
sequential: If TRUE, use a sequential method to create data such that the data from factor are generated first and apply to a set of equations to obtain the data of indicators. If FALSE, create data directly from model-implied mean and covariance of indicators.
顺序:如果TRUE,使用顺序的方法来创建数据,使得数据从因子产生的第一,和适用于一组方程,得到的数据的指标。如果FALSE,直接从创建数据模型隐含的均值和方差指标。
facDist: A SimDataDist for a distribution of factors. Use when sequential is TRUE.
facDist:A SimDataDist的分布的因素。使用时sequential是TRUE。
errorDist: A SimDataDist for a distribution of measurement errors. Use when sequential is TRUE
errorDist:A SimDataDist的测量误差的分布。使用时sequential是TRUE
indDist: A SimDataDist for a distribution of indicators. Use when sequential is FALSE.
indDist:A SimDataDist指标的分配。使用时sequential是FALSE。
indLab: A vector of indicator names. If not specified, the variables names are y1, y2, ... .
indLab:矢量指标名称。如果未指定,变量名是Y1,Y2,... 。
modelBoot: If TRUE, use a model-based bootstrap for data generation. See details for further information. This argument need a dataset in the realData argument.
modelBoot:如果TRUE,使用基于模型的数据生成的引导。详情请参阅有关详细信息,。这个论点需要realData参数的数据集。
realData: The real dataset that the model based bootstrap will follow the distribution.
realData:真正的数据集,基于模型的引导将按照分配。
usedStd: If SimModelOut is used for data generation, standardized parameters are used for data generation if usedStd=TRUE. If usedStd=FALSE, unstandardized parameters are used.
usedStd:如果SimModelOut用于生成数据,用于数据生成标准化的参数,如果usedStd=TRUE。如果usedStd=FALSE,使用非标准的参数。
(作者)----------Author(s)----------
Sunthud Pornprasertmanit (University of Kansas; <a href="mailto:psunthud@ku.edu">psunthud@ku.edu</a>)
参考文献----------References----------
参见----------See Also----------
simSetCFA to see CFA model specification
simSetCFA看CFA型号规格
simSetPath to see Path analysis model specification
simSetPath看通径分析模型规范
simSetSEM to see SEM model specification
simSetSEM看SEM模型规范
simMisspecCFA for specifying misspecification in CFA model
simMisspecCFA指定在CFA模型的设定错误
simMisspecPath for specifying misspecification in Path analysis model
simMisspecPath指定的路径分析模型中的假设错误
simMisspecSEM for specifying misspecification in SEM model
simMisspecSEM指定在SEM模型的设定错误
simEqualCon for setting equality constraints.
simEqualCon设置等式约束。
simDataDist for data distribution object set-up for facDist, errorDist, or indDist arguments.
simDataDist数据facDist,errorDist或indDist参数设置为分配对象。
实例----------Examples----------
loading <- matrix(0, 6, 2)
loading[1:3, 1] <- NA
loading[4:6, 2] <- NA
loadingValues <- matrix(0, 6, 2)
loadingValues[1:3, 1] <- 0.7
loadingValues[4:6, 2] <- 0.7
LX <- simMatrix(loading, loadingValues)
latent.cor <- matrix(NA, 2, 2)
diag(latent.cor) <- 1
RPH <- symMatrix(latent.cor, 0.5)
error.cor <- matrix(0, 6, 6)
diag(error.cor) <- 1
RTD <- symMatrix(error.cor)
CFA.Model <- simSetCFA(LY = LX, RPS = RPH, RTE = RTD)
SimData <- simData(CFA.Model, 200)
summary(SimData)
run(SimData)
# With Misspecification Model[随着误设模型]
n01 <- simNorm(0, 0.1)
error.cor.Mis <- matrix(NA, 6, 6)
diag(error.cor.Mis) <- 1
RTD.Mis <- symMatrix(error.cor.Mis, "n01")
CFA.Model.Mis <- simMisspecCFA(RTD=RTD.Mis)
SimData <- simData(CFA.Model, 200, misspec=CFA.Model.Mis)
summary(SimData)
run(SimData)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|