seqplot(TraMineR)
seqplot()所属R语言包:TraMineR
Plot state sequence objects
图的状态序列对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
High level plot functions for state sequence objects that can produce state distribution, frequency, index, transversal entropy, sequence of modes, meant time, and representative plots.
高级别绘图功能,可以生产状态分布的状态序列对象,频率,指标,横向熵,序列模式,这意味着时间,和有代表性的图。
用法----------Usage----------
seqplot(seqdata, group=NULL, type="i", title=NULL,
cpal=NULL, missing.color=NULL,
ylab=NULL, yaxis=TRUE, axes="all", xtlab=NULL, cex.plot=1,
withlegend="auto", ltext=NULL, cex.legend=1,
use.layout=(!is.null(group) | withlegend!=FALSE),
legend.prop=NA, rows=NA, cols=NA, ...)
seqdplot(seqdata, group=NULL, title=NULL, ...)
seqfplot(seqdata, group=NULL, title=NULL, ...)
seqiplot(seqdata, group=NULL, title=NULL, ...)
seqIplot(seqdata, group=NULL, title=NULL, ...)
seqHtplot(seqdata, group=NULL, title=NULL, ...)
seqmsplot(seqdata, group=NULL, title=NULL, ...)
seqmtplot(seqdata, group=NULL, title=NULL, ...)
seqrplot(seqdata, group=NULL, title=NULL, ...)
参数----------Arguments----------
参数:seqdata
a state sequence object created with the seqdef function.
一个状态序列与seqdef函数创建的对象。
参数:group
Plots one plot for each level of the factor given as argument.
图每个级别的因素作为参数给定的一个图。
参数:type
the type of the plot. Available types are "d" for state distribution plots, "f" for sequence frequency plots, "Ht" for transversal entropy plots, "i" for selected sequence index plots, "I" for whole set index plots, "ms" for plotting the sequence of modal states, "mt" for mean times plots and "r" for representative sequence plots.
该类型的图。可用的类型是"d"状态分布图,"f"的序列频率图,"Ht"横向熵图,"i"为选择序列索引图,"I"整套指数图,"ms"模态状态绘制的顺序,"mt"平均时间图和"r"的为代表序列图。
参数:title
title for the graphic. Default is NULL.
图形的标题。默认是NULL。
参数:cpal
Color palette used for the states. By default, the cpal attribute of the seqdata sequence object is used (see seqdef). If user specified, a vector of colors with number of elements equal to the number of distinct states.
“颜色”调板的状态。默认情况下,cpal seqdata序列对象的属性(见seqdef“)。如果用户指定的,一个向量等于不同的状态的数目的元素的数量的颜色。
参数:missing.color
alternative color for representing missing values inside the sequences. By default, this color is taken from the missing.color attribute of the plotted sequence object.
另一种颜色代表缺失值序列内。默认情况下,这个颜色是从missing.color所绘制的序列对象的属性。
参数:ylab
an optional label for the y-axis. If set to NA, no label is drawn.
一个可选的标签为y轴。如果设置为NA,没有标签的绘制。
参数:yaxis
controls whether a y-axis is plotted. When set to TRUE (default value), sequence indexes are displayed for "i" and "I", mean time values for "mt" and percentages for "d" and "f".
控制是否绘制y轴。当设置为TRUE(默认值),序列索引显示"i"和"I",平均时间值"mt"和百分比"d"和"f"。
参数:axes
if set to "all" (default value) x axes are drawn for each plot in the graphic. If set to "bottom" and group is used, axes are drawn only under the plots located at the bottom of the graphic area. If FALSE, no x-axis is drawn.
如果设置为"all"(默认值)x轴绘制图形中的每一个图。如果设置为"bottom"和group使用,轴绘制只有在图位于底部的图形面积。如果FALSE,没有x轴被吸入。
参数:xtlab
optional labels for the x-axis tick labels. If unspecified, the column names of the seqdata sequence object are used (see seqdef).
的x-轴的刻度标记可选标签。如果未指定,seqdata序列对象的列名(见seqdef“)。
参数:cex.plot
expansion factor for setting the size of the font for the axis labels and names. The default value is 1. Values lesser than 1 will reduce the size of the font, values greater than 1 will increase the size.
设置轴标签和名称的字体的大小扩展系数。默认值是1。跌幅小于1的值,将减少的字体的大小的值大于1的大小会增加。
参数:withlegend
defines if and where the legend of the state colors is plotted. The default value "auto" sets the position of the legend automatically. Other possible value is "right". Obsolete value TRUE is equivalent to "auto".
定义和传说中的国家的颜色绘制。默认值"auto"自动设置位置的传说。其他可能的值是"right"。过时的价值TRUE是相当于"auto"。
参数:ltext
optional description of the states to appear in the legend. Must be a vector of character strings with number of elements equal to the size of the alphabet. If unspecified, the label attribute of the seqdata sequence object is used (see seqdef).
可选的状态出现在传说中的描述。必须是一个字符串向量与字母表的大小相等的元素的数量。如果未指定,label属性seqdata序列对象(见seqdef)。
参数:cex.legend
expansion factor for setting the size of the font for the labels in the legend. The default value is 1. Values lesser than 1 will reduce the size of the font, values greater than 1 will increase the size.
膨胀系数传说中的标签的字体大小的设置。默认值是1。跌幅小于1的值,将减少的字体的大小的值大于1的大小会增加。
参数:use.layout
if TRUE, layout is used to arrange plots when using the group option or plotting a legend. When layout is activated, the standard 'par(mfrow=....)' for arranging plots does not work. With withlegend=FALSE and group=NULL, layout is automatically deactivated and 'par(mfrow=....)' can be used.
如果TRUE,layout用于安排图时,使用该组选项或绘制一个传奇。布局被激活时,标准的“par(mfrow=....)安排图不工作。 withlegend=FALSE和group=NULL,布局会自动停用,par(mfrow=....)可以使用。
参数:legend.prop
sets the proportion of the graphic area used for plotting the legend when use.layout=TRUE and withlegend=TRUE. Default value is set according to the place (bottom or right of the graphic area) where the legend is plotted. Values from 0 to 1.
设置的图形面积的比例用于绘制的传说use.layout=TRUE和withlegend=TRUE的。默认值被设置根据绘制的传说的地方(底部或右的图形面积),其中。从0到1的值。
参数:rows,cols
optional arguments to arrange plots when use.layout=TRUE.
可选参数时安排图use.layout=TRUE。
参数:...
arguments to be passed to the function called to produce the appropriate statistics and the associated plot method (see details), or other graphical parameters. For example the weighted argument can be passed to control whether (un)weighted statistics are produced or with.missing argument to take missing values into account when computing transversal or longitudinal state distributions.
参数被传递给函数的调用来产生相应的统计和相关图法(见详情),或其他图形参数。例如,weighted参数可以传递给控制(UN)加权统计产生或with.missing参数时考虑到横向或纵向的状态分布计算遗漏值的。
Details
详细信息----------Details----------
seqplot is the generic function for high level plots of state sequence objects with group splits and automatic display of the color legend. Many different types of plots can be produced by means of the type argument. Except for sequence index plots, seqplot first calls the specific function producing the required statistics and then the plot method for objects produced by this function (see below). For sequence index plots, the state sequence object itself is plotted by calling the plot.stslist method. When splitting by groups and/or displaying the color legend, the layout function is used for arranging the plots.
seqplot是通用的高层次的状态序列图对象组的分裂和传奇的色彩自动显示功能。 type参数可以通过许多不同类型的图。除序列索引图,seqplot任意调用的特定功能的生产所需的统计资料,然后此函数所产生的对象(见下文)的绘图方法。对序列索引图,的状态序列对象本身绘制通过调用plot.stslist方法。当分裂的团体和/或显示了传奇的色彩,layout函数用于安排的图。
The seqdplot, seqfplot, seqiplot, seqIplot, seqHtplot, seqmsplot, seqmtplot and seqrplot functions are aliases for calling seqplot with type argument set respectively to "d", "f", "i", "I", "Ht", "ms", "mt" or "r".
seqdplot,seqfplot,seqiplot,seqIplot,seqHtplot,seqmsplot,seqmtplot和seqrplot函数别名调用seqplottype参数分别设置为"d","f","i","I","Ht", X>,"ms"或"mt"。
State distribution plot (type="d") represent the sequence of the transversal state frequencies by position (time point) computed by the seqstatd function.
国家分布图(type="d")代表位置(时间点)计算的seqstatd功能的横向状态频率的顺序。
Sequence frequency plots (type="f") display the most frequent sequences, each one with an horizontal stack bar of its successive states. Sequences are displayed bottom-up in decreasing order of their frequencies (computed by the seqtab function). The plot.stslist.freq plot method is called for producing the plot. <br> The tlim optional argument may be specified for selecting the sequences to be plotted (default is 1:10, i.e. the 10 most frequent sequences). The width of the bars representing the sequences is by default proportional to their frequencies, but this can be disabled with the pbarw=FALSE optional argument. If weights have been specified when creating seqdata, weighted frequencies will be returned by seqtab since the default option is weighted=TRUE. See examples below, the seqtab and plot.stslist.freq manual pages for a complete list of optional arguments and <CITE>M眉ller et al., (2008)</CITE> for a description of sequence frequency plots.
序列频率图(type="f")显示最频繁的序列,每一个水平堆叠栏的连续状态。序列显示,自底向上递减的顺序,它们的频率(由seqtab函数计算)。被称为plot.stslist.freq图法生产的图。参考tlim可选参数可以指定选择要绘制的序列(默认为1:10,即10个最常见的序列)。宽条表示的序列是由默认情况下,它们的频率成正比,但是这可以被禁用pbarw=FALSE的可选参数。如果权重被创建时指定seqdata,加权频率,将返回seqtab,因为默认的选项是weighted=TRUE。见下面的例子,seqtab和plot.stslist.freq手册页的完整列表,可选的参数和<CITE>Müller等人(2008)</ CITE>的说明序列频率图。
In sequence index plots (type="i" or type="I"), the requested individual sequences are rendered with horizontal stacked bars depicting the states over successive positions (time). Optional arguments are tlim for specifying the indexes of the sequences to be plotted (when type="i" defaults to the first ten sequences, i.e tlim=1:10). For plotting nicely a (big) whole set one can use type="I" which is the same as using tlim=0 together with the additional graphical parameters border=NA and space=0 to suppress bar borders and space between bars. The sortv argument can be used to pass a vector of numerical values for sorting the sequences or to specify a sorting method. See plot.stslist for a complete list of optional arguments and their description.
在序列索引图(type="i"或type="I"),要求各个序列呈现与水平叠加条形,描绘了在连续位置的状态(时间)。可选参数tlim指定要绘制的序列索引(type="i"默认的前十个序列,即tlim=1:10)。为了很好地绘制一个(大)整套可以使用type="I"这是相同的,使用tlim=0再加上额外的图形参数border=NA和space=0抑制条形边界和条形之间的空间。 sortv参数可以被用来传递一个向量的数值序列进行排序或指定的排序方法。见plot.stslist可选参数的完整列表和他们的描述。
The interest of sequence index plots has, for instance, been stressed by <CITE>Scherer (2001)</CITE> and <CITE>Brzinsky-Fay et al. (2006)</CITE>. Notice that index plots for thousands of sequences result in very heavy PDF or POSTSCRIPT graphic files. Dramatic file size reduction may be achieved by saving the figures in bitmap format with using for instance the png graphic device instead of postscript or pdf.
序列索引图的权益,例如,被强调的舍雷尔<CITE>(2001年)</ CITE> <CITE> Brzinsky-FAY等。 (2006年)</ CITE>。请注意,成千上万的序列非常沉重的PDF或PostScript图形文件的索引图。戏剧减少文件的大小,可以实现与使用例如png图形的移动设备,而不是postscript或pdf通过保存的位图格式的数字。
The transversal entropy plot (type="Ht") displays the evolution over positions of the transversal entropies (<CITE>Billari, 2001</CITE>). Transversal entropies are computed by calling seqstatd function and then plotted by calling the plot.stslist.statd plot method.
横向熵的图(type="Ht")显示满仓的横向熵(<CITE> Billari,2001 </ CITE>)的演变。横向熵的计算通过调用seqstatd函数和然后通过调用plot.stslist.statd图法绘制。
The modal state sequence plot (type="ms") displays the sequence of the modal states with each mode proportional to its frequency at the given position. The seqmodst function is called which returns the sequence and the result is plotted by calling the plot.stslist.modst plot method.
模态的序列的图(type="ms")显示每种模式的频率成正比,在给定的位置的序列模式状态。 seqmodst函数被调用时,它返回序列,其结果是通过调用plot.stslist.modst图法绘制。
The mean time plot (type="mt") displays the mean time spent in each state of the alphabet as computed by the seqmeant function. The plot.stslist.meant plot method is used to plot the resulting statistics.
图(type="mt")的平均时间显示的平均花费的时间计算在每个国家的字母seqmeant功能。 plot.stslist.meant图法用于绘制的统计结果。
The representative sequence plot (type="r") displays a reduced, non redundant set of representative sequences extracted from the provided state sequence object and sorted according to a representativeness criterion. The seqrep function is called to extract the representative set which is then plotted by calling the plot.stslist.rep method. A distance matrix is required that is passed with the dist.matrix argument or by calling the seqdist function if dist.matrix=NULL. The criterion argument sets the representativeness criterion used to sort the sequences. See examples below, the seqrep and plot.stslist.rep manual pages for a complete list of optional arguments and <CITE>Gabadinho et al. (2009)</CITE> for more details on the extraction of representative sets.
代表序列的图(type="r")显示减少,非冗余的代表序列中所提供的序列对象,并根据一个代表性的标准排序。 seqrep函数被调用来提取代表性的一组中,然后通过调用plot.stslist.rep方法绘制。距离矩阵是必需的,一起传递dist.matrix参数,或致电如果seqdistdist.matrix=NULL功能,。 criterion参数设置用于排序的序列的代表性标准。见下面的例子,seqrep和plot.stslist.rep手册页可选参数的完整列表,<CITE> Gabadinho等。 (2009年)</ CITE>有关详细信息,提取具有代表性的集。
参考文献----------References----------
the transition to adulthood. Journal of Population Research 18(2), 119-142.
European Sociological Review, 17(2), 119-144.
参见----------See Also----------
plot.stslist.statd, plot.stslist.freq, plot.stslist, plot.stslist.modst, plot.stslist.meant, plot.stslist.rep.
plot.stslist.statd,plot.stslist.freq,plot.stslist,plot.stslist.modst,plot.stslist.meant,plot.stslist.rep。
实例----------Examples----------
## ======================================================[#================================================= =====]
## Creating state sequence objects from example data sets[#创建示例数据集的状态序列对象]
## ======================================================[#================================================= =====]
## biofam data set[#biofam数据集]
data(biofam)
biofam.lab <- c("Parent", "Left", "Married", "Left+Marr",
"Child", "Left+Child", "Left+Marr+Child", "Divorced")
biofam.seq <- seqdef(biofam, 10:25, labels=biofam.lab)
## actcal data set[#actcal数据集]
data(actcal)
actcal.lab <- c("> 37 hours", "19-36 hours", "1-18 hours", "no work")
actcal.seq <- seqdef(actcal,13:24,labels=actcal.lab)
## ex1 using weights[EX1使用权]
data(ex1)
ex1.seq <- seqdef(ex1, 1:13, weights=ex1$weights)
## ========================[#========================]
## Sequence frequency plots[#序列频率曲线]
## ========================[#========================]
## Plot of the 10 most frequent sequences[10个最常见的序列号地]
seqplot(biofam.seq, type="f")
## Grouped by sex[#按性别分组]
seqfplot(actcal.seq, group=actcal$sex)
## Unweighted vs weighted frequencies[#未加权与加权频率]
seqfplot(ex1.seq, weighted=FALSE)
seqfplot(ex1.seq, weighted=TRUE)
## =====================[#=====================]
## Modal states sequence[#模态序列]
## =====================[#=====================]
seqplot(biofam.seq, type="ms")
## same as[#相同]
seqmsplot(biofam.seq)
## ====================[#====================]
## Representative plots[#代表性的图]
## ====================[#====================]
## Computing a distance matrix[#计算的距离矩阵]
## with OM metric[#OM度量]
costs <- seqsubm(biofam.seq, method="TRATE")
biofam.om <- seqdist(biofam.seq, method="OM", sm=costs)
## Plot of the representative sets grouped by sex[#按性别分组的代表集图]
## using the default frequency criterion[#使用默认的频率标准]
seqrplot(biofam.seq, dist.matrix=biofam.om, group=biofam$sex)
## Plot of the representative sets grouped by sex[#按性别分组的代表集图]
## using the default frequency criterion[#使用默认的频率标准]
seqrplot(biofam.seq, group=biofam$sex, dist.matrix=biofam.om)
## Plot of the representative sets grouped by sex[#按性别分组的代表集图]
## using the "density" criterion[#使用的“密度”标准]
seqrplot(biofam.seq, group=biofam$sex, criterion="density", dist.matrix=biofam.om)
## ====================[#====================]
## Sequence index plots[#序列索引图]
## ====================[#====================]
## First ten sequences[#前十序列]
seqiplot(biofam.seq)
## All sequences sorted by age in 2000[#在2000年按年龄排序的序列]
## grouped by sex[#按性别分组]
## using 'border=NA' and 'space=0' options to have a nicer plot[#使用“边界= NA”和“空间= 0选项有一个更好的图]
seqiplot(actcal.seq, group=actcal$sex, tlim=0, border=NA, space=0,
sortv=actcal$age00)
## ===================[#===================]
## Entropy index plots[#熵指数图]
## ===================[#===================]
seqplot(biofam.seq, type="Ht", group=biofam$sex)
## =======================[#=======================]
## State distribution plot[#国家分布图]
## =======================[#=======================]
## Grouped by sex[#按性别分组]
seqplot(actcal.seq, type="d", group=actcal$sex)
## Sequence index plot (first 10 seq.)[#序列索引图(10起)。]
## for the actcal data set[#为的actcal的数据集]
## grouped by sex[#按性别分组]
seqplot(actcal.seq, type="i", group=actcal$sex)
## ===============[#==============]
## Meant time plot[#意味着时间图]
## ===============[#==============]
## actcal data set, grouped by sex[#actcal数据集,按性别分组的]
seqplot(actcal.seq, type="mt", group=actcal$sex)
## biofam data set, grouped by sex[#biofam,按性别分组的数据集]
seqmtplot(biofam.seq, group=biofam$sex)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|