seqtree(TraMineR)
seqtree()所属R语言包:TraMineR
Tree structured analysis of a state sequence object.
一个状态序列对象的树形结构分析。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Facility for growing a regression tree for a state sequence object.
基金回归树的生长状态序列对象。
用法----------Usage----------
seqtree(formula, data = NULL, weighted = TRUE, minSize = 0.05,
maxdepth = 5, R = 1000, pval = 0.01,
weight.permutation = "replicate",
seqdist_arg = list(method = "LCS", norm = TRUE),
diss = NULL, squared = FALSE, first = NULL)
参数----------Arguments----------
参数:formula
a formula where the left hand side is a state sequence object (see seqdef) and the right hand specifies the candidate variables for partitioning the set of sequences.
了一个公式,左手侧是一个状态序列,对象(见seqdef)和右手指定候选变量用于分隔的序列集合。
参数:weighted
Logical. If TRUE, use the weights of the state sequence object.
逻辑。如果TRUE,使用状态序列对象的权重。
参数:data
a data frame where variables in the formula will be searched
公式中的变量都将被搜索的数据框
参数:minSize
minimum number of cases in a node, in percentage if less than 1.
在一个节点中的情况下,在最小数目的比例如果小于1。
参数:maxdepth
maximum depth of the tree.
该树的最大深度。
参数:R
Number of permutations used to assess the significance of the split.
用来评估分割的意义的排列数目。
参数:pval
Maximum p-value, in percent.
最大p值,以百分数表示。
参数:weight.permutation
Weights permutation method: "diss" (attach weights to the dissimilarity matrix), "replicate" (replicate case according to the weights arguments), "rounded-replicate" (replicate case according to the rounded weights arguments), "random-sampling" (random assignment of covariate profiles to the objects using distributions defined by the weights.)
重量置换的方法:“迪斯”(附加的相异度矩阵的权重),“复制”(复制情况下,按的weights参数),“四舍五入复制”(复制情况的圆角weights参数),“随机取样”(协的对象所定义的权重分布中随机分配的。)
参数:seqdist_arg
list of arguments directly passed to seqdist, only used if diss=NULL
参数列表,如果直接传递给seqdist,仅用于diss=NULL
参数:diss
An optional dissimilarity matrix. If not provided, a dissimilarity matrix is computed using seqdist and seqdist_arg
可选的相异度矩阵。如果没有提供,相异度矩阵计算使用seqdist和seqdist_arg,
参数:squared
Logical. If TRUE, the dissimilarity matrix is squared
逻辑。如果TRUE,相异度矩阵平方
参数:first
Character. An optional variable name to force the first split.
字符。一个可选的变量名,强制先拆。
Details
详细信息----------Details----------
The function provides a simplified interface for applying disstree on state sequence objects.
该功能提供了一个简化的界面,申请disstree状态序列对象。
The seqtree objects can be "plotted" with seqtreedisplay. A print method is also available which prints the medoid sequence for each terminal node.
seqtree对象可以“绘制”seqtreedisplay。一个打印方法,也可打印的medoid顺序为每个终端节点。
值----------Value----------
a seqtree object.
一个seqtree对象。
参考文献----------References----------
参见----------See Also----------
seqtreedisplay, disstree
seqtreedisplay,disstree
实例----------Examples----------
data(mvad)
## Defining a state sequence object[#定义一个状态序列对象]
mvad.seq <- seqdef(mvad[, 17:86])
## Building a seqtree using hamming distance[#建立一个seqtree的使用海明距离]
## You should use much higher value for the R parameter,[#R参数,您应该使用更高的价值,]
## thus the results may be unstable.[#结果可能是不稳定的。]
## R should be at least 1000[#R应该是至少为1000]
## (R is keeped low to avoid too much computation in examples).[#(R犹存低,以避免太多的例子计算)。]
seqt <- seqtree(mvad.seq~ male + Grammar + funemp + gcse5eq + fmpr + livboth,
data=mvad, R = 10, seqdist_arg=list(method="HAM", norm=TRUE))
print(seqt)
## Building a seqtree using a specified distance matrix[#建立一个seqtree的使用指定的距离矩阵]
mvad.dhd <- seqdist(mvad.seq, method="DHD")
seqt <- seqtree(mvad.seq~ male + Grammar + funemp + gcse5eq + fmpr + livboth,
data=mvad, R = 10, diss=mvad.dhd)
print(seqt)
### Will only work if GraphViz is properly installed[##只会工作,如果GraphViz的正确安装]
## Not run: [#不运行:]
seqtreedisplay(seqt, type="d", border=NA)
seqtreedisplay(seqt, type="I", sortv=cmdscale(mvad.dhd, k=1))
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|