找回密码
 注册
查看: 657|回复: 0

R语言 sem包 residuals.sem()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 00:48:46 | 显示全部楼层 |阅读模式
residuals.sem(sem)
residuals.sem()所属R语言包:sem

                                        Residual Covariances for a Structural Equation Model
                                         剩余协方差结构方程模型

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

These functions compute residual covariances, variance-standardized residual covariances, and normalized residual covariances for the observed variables in a structural-equation model fit by sem.
这些函数计算剩余协方差,方差标准化残差的协方差和归一化残差的协方差为观测变量的结构方程模型的拟合sem。


用法----------Usage----------


## S3 method for class 'sem'
residuals(object, ...)
## S3 method for class 'msem'
residuals(object, ...)

## S3 method for class 'sem'
standardizedResiduals(object, ...)
## S3 method for class 'msem'
standardizedResiduals(object, ...)

## S3 method for class 'objectiveML'
normalizedResiduals(object, ...)
## S3 method for class 'objectiveGLS'
normalizedResiduals(object, ...)
## S3 method for class 'msemObjectiveML'
normalizedResiduals(object, ...)



参数----------Arguments----------

参数:object
an object inheriting from class sem or msem returned by the sem function.
继承类的对象sem或msem返回sem功能的。


参数:...
not for the user.
不为用户。


Details

详细信息----------Details----------

Residuals are defined as S - C, where S is the sample covariance matrix of the observed variables and C is the model-reproduced covariance matrix. The standardized residual covariance for a pair of variables divides the residual covariance by the product of the sample standard deviations of the  two variables, (s_{ij} - c_{ij})/(s_{ii}s_{jj})^{1/2}. The normalized residual is given by
残差定义为S - C,其中S为样本协方差矩阵所观察到的变量和C是模型再现协方差矩阵。一对变量的标准化残差的协方差矩阵将残留的协方差这两个变量的样本标准差的产品,(s_{ij} - c_{ij})/(s_{ii}s_{jj})^{1/2}。由下式给出的归一化残差

where N^{*} is the number of observations minus one if the model is fit to a covariance matrix, or the number of observations if it is fit to a raw moment matrix.
其中N^{*}是观察次数减一,如果该模型是适合的协方差矩阵,或观测的数量,如果它是适合到原始矩矩阵。


值----------Value----------

Each function returns a matrix of residuals.
每个函数都返回一个矩阵的残留物。


(作者)----------Author(s)----------


John Fox <a href="mailto:jfox@mcmaster.ca">jfox@mcmaster.ca</a>



参考文献----------References----------

Structural Equations With Latent Variables. Wiley.

参见----------See Also----------

sem
sem


实例----------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: [#不运行:]
# Duncan, Haller, and Portes peer-influences model[邓肯,哈勒和波特斯,对影响模型]

R.DHP <- readMoments(diag=FALSE, names=c("ROccAsp", "REdAsp", "FOccAsp",
                "FEdAsp", "RParAsp", "RIQ", "RSES", "FSES", "FIQ", "FParAsp"))
    .6247     
    .3269  .3669      
    .4216  .3275  .6404
    .2137  .2742  .1124  .0839
    .4105  .4043  .2903  .2598  .1839
    .3240  .4047  .3054  .2786  .0489  .2220
    .2930  .2407  .4105  .3607  .0186  .1861  .2707
    .2995  .2863  .5191  .5007  .0782  .3355  .2302  .2950
    .0760  .0702  .2784  .1988  .1147  .1021  .0931 -.0438  .2087
            
model.dhp <- specifyModel()
    RParAsp  -> RGenAsp, gam11,  NA
    RIQ      -> RGenAsp, gam12,  NA
    RSES     -> RGenAsp, gam13,  NA
    FSES     -> RGenAsp, gam14,  NA
    RSES     -> FGenAsp, gam23,  NA
    FSES     -> FGenAsp, gam24,  NA
    FIQ      -> FGenAsp, gam25,  NA
    FParAsp  -> FGenAsp, gam26,  NA
    FGenAsp  -> RGenAsp, beta12, NA
    RGenAsp  -> FGenAsp, beta21, NA
    RGenAsp  -> ROccAsp,  NA,     1
    RGenAsp  -> REdAsp,  lam21,  NA
    FGenAsp  -> FOccAsp,  NA,     1
    FGenAsp  -> FEdAsp,  lam42,  NA
    RGenAsp <-> RGenAsp, ps11,   NA
    FGenAsp <-> FGenAsp, ps22,   NA
    RGenAsp <-> FGenAsp, ps12,   NA
    ROccAsp <-> ROccAsp, theta1, NA
    REdAsp  <-> REdAsp,  theta2, NA
    FOccAsp <-> FOccAsp, theta3, NA
    FEdAsp  <-> FEdAsp,  theta4, NA

sem.dhp <- sem(model.dhp, R.DHP, 329,
    fixed.x=c('RParAsp', 'RIQ', 'RSES', 'FSES', 'FIQ', 'FParAsp'))
residuals(sem.dhp)
normalizedResiduals(sem.dhp)
standardizedResiduals(sem.dhp) # same as residuals because model is fit to correlations[因为模型是合适的相关性一样残差]
   
## End(Not run)[#(不执行)]
# The following example can be executed via example():[通过实例(),可以执行下面的例子:]

etc &lt;- file.path(.path.package(package="sem")[1], "etc") # path to data and model files[数据和模型文件的路径]
   
(R.DHP <- readMoments(file=file.path(etc, "R-DHP.txt"),
                                diag=FALSE, names=c("ROccAsp", "REdAsp", "FOccAsp",
                "FEdAsp", "RParAsp", "RIQ", "RSES", "FSES", "FIQ", "FParAsp")))
(model.dhp <- specifyModel(file=file.path(etc, "model-DHP.txt")))
(sem.dhp <- sem(model.dhp, R.DHP, 329,
    fixed.x=c('RParAsp', 'RIQ', 'RSES', 'FSES', 'FIQ', 'FParAsp')))

residuals(sem.dhp)

normalizedResiduals(sem.dhp)

standardizedResiduals(sem.dhp)  # same as residuals because model is fit to correlations[因为模型是合适的相关性一样残差]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-19 03:24 , Processed in 0.023386 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表