fscores(sem)
fscores()所属R语言包:sem
Factor Scores for Latent Variables
潜变量的因子得分
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Calculate factor scores or factor-score coefficients for the latent variables in a structural-equation model.
计算因子得分或潜变量的结构方程模型的因子得分系数。
用法----------Usage----------
## S3 method for class 'sem'
fscores(model, data=model$data, center=TRUE, scale=FALSE, ...)
## S3 method for class 'msem'
fscores(model, data=model$data, center=TRUE, scale=FALSE, ...)
参数----------Arguments----------
参数:model
an object of class "sem" or "msem", produced by the sem function.
类的一个对象"sem"或"msem",sem功能。
参数:data
an optional numeric data frame or matrix containing the observed variables in the model; if not NULL, the estimated factor scores are returned; if NULL, the factor-score coefficients are returned. The default is the data element of model, which is non-NULL if the model was fit to a data set rather than a covariance or moment matrix.
一个可选的数字数据框或矩阵模型中观察到的变量,如果非NULL,估计因子得分返回,如果NULL,返回因子得分系数。默认值是data元素的model,这是非NULL如果适用于该模型的协方差矩矩阵,而不是数据。
参数:center
if TRUE, the default, the means of the observed variables are subtracted prior to computing factor scores. One would normally use this option if the model is estimated from a covariance or correlation matrix among the observed variables.
如果TRUE,默认情况下,所观察到的变量的手段减去事先计算因子得分。如果模型估计的观测变量之间的协方差或相关系数矩阵,通常会使用此选项。
参数:scale
if TRUE, the possibly centered variables are divided by their root-mean-squares; the default is FALSE. One would normally use this option if the model is estimated from a correlation matrix among the observed variables. Centering and scaling are performed by the scale function.
TRUE如果,可能为本的变量除以他们的根均方,默认为FALSE。如果模型估计从观测变量之间的相关系数矩阵,通常会使用此选项。居中和缩放进行scale功能的。
参数:...
arguments to pass down.
参数传递下来。
Details
详细信息----------Details----------
Factor-score coefficients are computed by the “regression” method as C^-1 C*, where C is the model-implied covariance or moment matrix among the observed variables and C* is the matrix of model-implied covariances or moments between the observed and latent variables.
的“回归”的方法,计算因子得分系数C^-1 C*,其中C是观测变量和C*是矩阵模型中的模型隐含的协方差,矩矩阵隐含的所观察到的和潜变量之间的协方差或者时刻。
值----------Value----------
Either a matrix of estimated factor scores (if the data argument is supplied) or a matrix of factor-score coefficients (otherwise). In the case of an "msem" argument, a list of matrices is returned.
无论是矩阵的估计因子得分(如果data参数提供)或因子得分系数矩阵(否则)。在一个"msem"参数的情况下,矩阵的列表返回。
(作者)----------Author(s)----------
John Fox <a href="mailto:jfox@mcmaster.ca">jfox@mcmaster.ca</a>
参考文献----------References----------
Structural Equations With Latent Variables. Wiley.
参见----------See Also----------
sem, scale
sem,scale
实例----------Examples----------
# In the first example, readMoments() and specifyModel() read from the[在第一个例子中,readMoments()和specifyModel()读出的]
# input stream. This example cannot be executed via example() but can be entered[输入流。这个例子不能被执行通过例如(),但可以输入]
# at the command prompt. The example is repeated using file input;[在命令提示符下。这个例子是重复使用的文件输入;]
# this example can be executed via example(). [这个例子中,可以执行通过例如()。]
## Not run: [#不运行:]
S.wh <- readMoments(names=c('Anomia67','Powerless67','Anomia71',
'Powerless71','Education','SEI'))
11.834
6.947 9.364
6.819 5.091 12.532
4.783 5.028 7.495 9.986
-3.839 -3.889 -3.841 -3.625 9.610
-21.899 -18.831 -21.748 -18.775 35.522 450.288
# This model in the SAS manual for PROC CALIS[这种模式在的SAS手动的PROC CALIS]
model.wh.1 <- specifyModel()
Alienation67 -> Anomia67, NA, 1
Alienation67 -> Powerless67, NA, 0.833
Alienation71 -> Anomia71, NA, 1
Alienation71 -> Powerless71, NA, 0.833
SES -> Education, NA, 1
SES -> SEI, lamb, NA
SES -> Alienation67, gam1, NA
Alienation67 -> Alienation71, beta, NA
SES -> Alienation71, gam2, NA
Anomia67 <-> Anomia67, the1, NA
Anomia71 <-> Anomia71, the1, NA
Powerless67 <-> Powerless67, the2, NA
Powerless71 <-> Powerless71, the2, NA
Education <-> Education, the3, NA
SEI <-> SEI, the4, NA
Anomia67 <-> Anomia71, the5, NA
Powerless67 <-> Powerless71, the5, NA
Alienation67 <-> Alienation67, psi1, NA
Alienation71 <-> Alienation71, psi2, NA
SES <-> SES, phi, NA
sem.wh.1 <- sem(model.wh.1, S.wh, 932)
fscores(sem.wh.1)
## End(Not run)[#(不执行)]
# The following example can be executed via example():[通过实例(),可以执行下面的例子:]
etc <- file.path(.path.package(package="sem")[1], "etc") # path to data and model files[数据和模型文件的路径]
(S.wh <- readMoments(file=file.path(etc, "S-Wheaton.txt"),
names=c('Anomia67','Powerless67','Anomia71',
'Powerless71','Education','SEI')))
(model.wh.1 <- specifyModel(file=file.path(etc, "model-Wheaton-1.txt")))
(sem.wh.1 <- sem(model.wh.1, S.wh, 932))
fscores(sem.wh.1)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|