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

R语言:loglin()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:25:48 | 显示全部楼层 |阅读模式
loglin(stats)
loglin()所属R语言包:stats

                                        Fitting Log-Linear Models
                                         拟合对数线性模型

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

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

loglin is used to fit log-linear models to multidimensional contingency tables by Iterative Proportional Fitting.  
loglin使用,以适应由迭代比例拟合多维列联表对数线性模型。


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


loglin(table, margin, start = rep(1, length(table)), fit = FALSE,
       eps = 0.1, iter = 20, param = FALSE, print = TRUE)



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

参数:table
a contingency table to be fit, typically the output from table.
一个应急表是合适的,通常从table输出。


参数:margin
a list of vectors with the marginal totals to be fit.  (Hierarchical) log-linear models can be specified in terms of these marginal totals which give the "maximal" factor subsets contained in the model.  For example, in a three-factor model, list(c(1, 2), c(1, 3)) specifies a model which contains parameters for the grand mean, each factor, and the 1-2 and 1-3 interactions, respectively (but no 2-3 or 1-2-3 interaction), i.e., a model where factors 2 and 3 are independent conditional on factor 1 (sometimes represented as "[12][13]").  The names of factors (i.e., names(dimnames(table))) may be used rather than numeric indices.  
适合的边际总计向量名单。 (分层),可以指定对数线性模型在这给模型中的“最大”的因素子集的边际总计。例如,在三因子模型,list(c(1, 2), c(1, 3))指定一个模型,其中包含盛大平均,每个因素,1-2和1-3的相互作用,分别为(但没有2-3或1的参数 - 2-3互动),即模型的因素2和3是独立因子1(有时代表“[12] [13]”)之条件。因素的名称(例如,names(dimnames(table)))可以使用,而不是数字指标。


参数:start
a starting estimate for the fitted table.  This optional argument is important for incomplete tables with structural zeros in table which should be preserved in the fit.  In this case, the corresponding entries in start should be zero and the others can be taken as one.
为装表开始的估计。这个可选参数是重要结构零table应在合适的保存不完整的表。在这种情况下,相应的条目start应该是零和其他可以作为一个。


参数:fit
a logical indicating whether the fitted values should be returned.
逻辑的拟合值指示是否应该返回。


参数:eps
maximum deviation allowed between observed and fitted margins.
观测和拟合利润率之间允许的最大偏差。


参数:iter
maximum number of iterations.
最大迭代次数。


参数:param
a logical indicating whether the parameter values should be returned.
逻辑指示是否应返回的参数值。


参数:print
a logical.  If TRUE, the number of iterations and the final deviation are printed.
一个逻辑。如果TRUE,迭代和最终偏差印刷。


Details

详情----------Details----------

The Iterative Proportional Fitting algorithm as presented in Haberman (1972) is used for fitting the model.  At most iter iterations are performed, convergence is taken to occur when the maximum deviation between observed and fitted margins is less than eps.  All internal computations are done in double precision; there is no limit on the number of factors (the dimension of the table) in the model.
迭代比例拟合算法在哈伯曼(1972年)用于拟合模型。在最iter进行迭代,收敛发生时的观测和拟合利润率之间的最大偏差比eps少。在双精度完成所有内部计算,有多项因素模型(维表)没有限制。

Assuming that there are no structural zeros, both the Likelihood Ratio Test and Pearson test statistics have an asymptotic chi-squared distribution with df degrees of freedom.
假设有没有结构性的零,既似然比检验和Pearson测试统计df自由度渐近卡方分布。

Note that the IPF steps are applied to the factors in the order given in margin.  Hence if the model is decomposable and the order given in margin is a running intersection property ordering then IPF will converge in one iteration.
需要注意的是,IPF的步骤适用于在margin给定的顺序的因素。因此,如果模型是可分解和margin给定的顺序是一个正在运行的路口财产订购IPF的将汇聚在一个迭代。

Package MASS contains loglm, a front-end to loglin which allows the log-linear model to be specified and fitted in a formula-based manner similar to that of other fitting functions such as lm or glm.
包MASS包含loglm,loglin允许指定数线性模型和安装在基于公式的方式类似,如其他拟合函数前端lm或glm。


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

A list with the following components.
以下组件列表。


参数:lrt
the Likelihood Ratio Test statistic.
似然比检验统计量。


参数:pearson
the Pearson test statistic (X-squared).
皮尔逊检验统计量(X)的平方。


参数:df
the degrees of freedom for the fitted model.  There is no adjustment for structural zeros.
拟合模型的自由程度。有没有调整结构的零。


参数:margin
list of the margins that were fit.  Basically the same as the input margin, but with numbers replaced by names where possible.  
列表适合的利润率。 margin,但名称取代数字输入基本相同。


参数:fit
An array like table containing the fitted values. Only returned if fit is TRUE.
像table包含拟合值的数组。仅返回如果fit是TRUE的。


参数:param
A list containing the estimated parameters of the model.  The "standard" constraints of zero marginal sums (e.g., zero row and column sums for a two factor parameter) are employed.  Only returned if param is TRUE.
一个列表,包含了该模型的参数估计。受聘的“标准”零边际款项(例如,零行和列两个因素参数款项)的约束。仅返回如果param是TRUE的。


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


Kurt Hornik



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

The New S Language. Wadsworth & Brooks/Cole.
Log-linear fit for contingency tables—Algorithm AS51. Applied Statistics, 21, 218–225.
Categorical data analysis. New York: Wiley.

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

table.
table。

loglm in package MASS for a user-friendly wrapper.
loglm包MASS一个用户友好的包装。

glm for another way to fit log-linear models.
glm另一种方式,以适应对数线性模型。


举例----------Examples----------


## Model of joint independence of sex from hair and eye color.[#模型的联合性的头发和眼睛颜色的独立性。]
fm <- loglin(HairEyeColor, list(c(1, 2), c(1, 3), c(2, 3)))
fm
1 - pchisq(fm$lrt, fm$df)
## Model with no three-factor interactions fits well.[#无三因子交互作用的模型适合。]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 13:52 , Processed in 0.026501 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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