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

R语言 TraMineR包 seqsubm()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 11:41:40 | 显示全部楼层 |阅读模式
seqsubm(TraMineR)
seqsubm()所属R语言包:TraMineR

                                        Create a substitution-cost matrix
                                         创建一个替代成本矩阵

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

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

The substitution-cost matrix is used when computing distances between sequences by the method of optimal matching. The function creates the substitution matrix using either a constant or the transition rates computed from the sequence data or other methods to be implemented in the future.
的取代成本矩阵是计算由最优匹配的方法的序列之间的距离时,使用的。该函数创建使用一个常量或替代矩阵序列数据或其他的方法来实现在未来的转换率计算。


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


seqsubm(seqdata, method, cval=NULL, with.missing=FALSE,
         miss.cost=NULL, time.varying=FALSE, weighted=TRUE,
                 transition="both", lag=1, missing.trate=FALSE)



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

参数:seqdata
a sequence object as returned by the seqdef function.
一个序列对象返回的seqdef功能。


参数:method
method to compute transition rates. At this time, the methods available are constant value (method="CONSTANT") or substitution costs using transition rates (method="TRATE")
方法计算过渡率。此时,可用的方法是恒定值(method="CONSTANT")或替换成本,使用过渡率(method="TRATE")


参数:cval
the constant substitution cost if method "CONSTANT" is chosen. For method "TRATE", the base value from which transition probabilities are subtracted. If NULL, cval=2, unless transition is set to "both" and time.varying is TRUE in which case cval=4.
不断替代成本,如果方法"CONSTANT"选择。方法"TRATE",基值中减去从转移概率。如果NULL,cval=2,除非transition设置为"both"和time.varying是TRUE“”在这种情况下,cval=4。


参数:with.missing
if TRUE, an additional entry is added in the matrix for the missing states. Hence, a new "missing" state is added to the list of "valid" states. Use this if you want to compute distances with missing values inside the sequences. See <CITE>Gabadinho et al. (2010)</CITE> for more details on the options for handling missing values when computing distances between sequences.
如果TRUE,一个额外的条目被添加在矩阵中缺失的状态。因此,一个新的“失踪”的状态将被添加到列表中的“有效”状态。如果您要计算的距离内遗漏值的序列。请参阅<CITE> Gabadinho等。 (2010)</ CITE>处理缺失值的计算序列之间的距离时,选项的详细信息。


参数:miss.cost
the substitution cost for the missing state. The default set it to cval
替代成本失踪的状态。默认设置为cval


参数:time.varying
Logical. If TRUE return an array containing a distinct matrix for each time unit. The time is the third dimension (subscript).
逻辑。如果TRUE返回array包含一个独特的矩阵,每个时间单位。时间是第三个维度(下标)。


参数:weighted
Logical. If TRUE compute transition rates using weights specified in seqdata.
逻辑。如果TRUE计算过渡使用权的价格中指定的seqdata。


参数:transition
Only used if time.varying=TRUE. If transition="both", it uses the transition rates from previous and next state. It can also be set to "previous" or "next".  
仅用于如果time.varying=TRUE。如果transition="both",使用上一个和下一个状态的转换率。它也可以被设置为"previous"或"next"。


参数:lag
Integer. Only used with (method="TRATE"). Time between the two states considered to compute transition rates (one by default).
整数。只有用(method="TRATE"“)。计算的过渡率(默认情况下)认为这两个国家之间的时间。


参数:missing.trate
Logical.  Only used with (method="TRATE"). If TRUE, substitution costs with missing state are also based on transition rates. If FALSE (default value), the substitution cost for the missing state are set to miss.cost.



Details

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

The substitution-cost matrix has dimension ns*ns, where ns is the number of states in the alphabet of the sequence object. The element (i,j) of the matrix is the cost of substituting state i with state j.
替代成本矩阵的维数ns*ns,其中ns是在字母表中的顺序对象的数量。元素(i,j)的矩阵是代状态i国家j的成本。

With the "CONSTANT" method, the substitution costs are the same for all the states, with a default value of 2. An alternative value can be provided by the user. When the "TRATE" (transition rates) method is chosen, the transition rates between all states are computed using the seqtrate function. The substitution cost between states i and j is obtained with the formula
随着"CONSTANT"法,替代成本是相同的所有国家,一个默认值2。替代值可以由用户提供的。选择当"TRATE"(转换率)的方法,各国之间的过渡税率计算使用seqtrate功能。国家之间的替代成本i和j得到的公式

where P(i,j) is the transition rate from state i to j.
P(i,j)是升学率从国家i到j。


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


<code>R</code> with the <code>TraMineR</code> package: A user's guide. Department of Econometrics and Laboratory of Demography, University of Geneva.

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

seqtrate, seqdef, seqdist.
seqtrate,seqdef,seqdist。


实例----------Examples----------


## Defining a sequence object with columns 10 to 25[#定义一个序列对象列10至25]
## in the 'biofam' example data set[#在“biofam”示例数据集]
data(biofam)
biofam.seq <- seqdef(biofam,10:25)

## Optimal matching using transition rates based substitution-cost matrix[#最佳匹配使用的升学率的替代成本矩阵]
## and insertion/deletion costs of 3[#和3的插入/缺失成本]
trcost <- seqsubm(biofam.seq, method="TRATE")
biofam.om <- seqdist(biofam.seq,method="OM",indel=3,sm=trcost)

## Optimal matching using constant value (2) substitution-cost matrix[#最佳匹配使用恒定值(2)替代成本矩阵]
## and insertion/deletion costs of 3[#和3的插入/缺失成本]
ccost <- seqsubm(biofam.seq, method="CONSTANT", cval=2)
biofam.om.c2 <- seqdist(biofam.seq, method="OM",indel=3,sm=ccost)

## Displaying the distance matrix for the first 10 sequences[#显示的距离矩阵的第10个序列]
biofam.om.c2[1:10,1:10]

## =================================[#=================================]
## Example with weights and missings[#示例与重量和missings,]
## =================================[#=================================]
data(ex1)
ex1.seq <- seqdef(ex1,1:13, weights=ex1$weights)

## Unweighted[#未加权]
subm <- seqsubm(ex1.seq, method="TRATE", with.missing=TRUE, weighted=FALSE)
ex1.om <- seqdist(ex1.seq, method="OM", sm=subm, with.missing=TRUE)

## Weighted[#加权]
subm.w <- seqsubm(ex1.seq, method="TRATE", with.missing=TRUE, weighted=TRUE)
ex1.omw <- seqdist(ex1.seq, method="OM", sm=subm.w, with.missing=TRUE)

ex1.om == ex1.omw

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-30 02:46 , Processed in 0.022449 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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