Plot of dynamic (i.e. successive) cross-sectional summaries of an individual index. The successive values of the individual index for all sequences should be collected in a dynin
table as produced by seqindic.dyn
.
# S3 method for dynin
plot(x, fstat=weighted.mean, group=NULL, conf=FALSE,
main="auto", col=NULL, lty=NULL, lwd=3.5, ylim=NULL,
ylab=NULL, xlab=NULL, xtlab=NULL, xtstep=NULL, tick.last=NULL,
with.legend=TRUE, glabels=NULL, legend.pos="topright",
horiz=FALSE, cex.legend=1, bcol=NULL, na.rm=FALSE, ret=FALSE, ...)
If ret=TRUE
, a matrix with the successive group summaries (One row per group) and, when conf=TRUE
, the matrices with the lower and upper bounds of the confidence intervals as attributes L.grp
and U.grp
.
object of class dynin
as produced by seqindic.dyn
function: summary function to compute the values plotted. Default is weighted.mean
with weights taken from the weights
attribute of x
. When weighted.mean
and x
has no weights, mean
is used instead.
factor or discrete vector: group membership; a curve is drawn for each group. If NULL
(default) a single curve for the whole set is drawn.
logical or numeric: If logical, should confidence bands be displayed? If numeric, confidence probability. TRUE
is equivalent to .95. Applies only when fstat=mean
or fstat=weighted.mean
.
character string: Plot title. Default is "auto" that prints a default title. Set as NULL
to suppress the title.
color vector. Group line colors. If NULL
(default), colors are automatically assigned using qualitative_hcl
with the 'Dark 3'
palette (see hcl_palettes
).
string vector. Group line types (see lines
). If NULL
(default), types are automatically assigned.
integer vector: Group line widths (see lines
). If NULL
(default), set as 3.5.
pair of numerics defining the range for the y-axis. If left NULL
, the limits are defined from the data.
character string: y axis label.
character string: x axis label.
vector of strings defining the x-axis tick labels. If NULL
, column names of the x
table are used.
integer: step between tick marks on the x-axis. If unspecified, attribute xtstep
of the x
object is used.
logical. Should a tick mark be enforced at the last position on the x-axis? If unspecified, attribute tick.last
of the x
object is used.
a vector of strings with the curve labels. If NULL
curves are labeled with the levels of the group variable
logical: Should the legend be plotted. Default is TRUE
.
legend position: default is "topright"
. Seelegend
.
logical: Should the legend be displayed horizontally. Set as FALSE
by default, i.e., legend is displayed vertically.
Scale factor for the legend.
color vector. For confidence bands. If NULL
(default), colors are automatically assigned using qualitative_hcl
with the 'Pastel 1'
palette (see hcl_palettes
).
logical. When fstat
is mean
or weighted.mean
, should NA
's be stripped before computation? Ignored for any other fstat
function.
logical: Should the plotted values be returned?
additional plot parameters (see par
).
Gilbert Ritschard
Together with seqindic.dyn
this function implements the dynamic sequence analysis approach of Pelletier et al. (2020).
The function first computes the summary table using the fstat
function. Each row of the summary table is then plotted as a line, except rows that contain NA
s. Setting na.rm=TRUE
helps sometimes to prevent some NA
s in the summary table.
Confidence bands are computed for a confidence level of 95% and assuming a normal distribution.
Pelletier, D., Bignami-Van Assche, S., & Simard-Gendron, A. (2020) Measuring Life Course Complexity with Dynamic Sequence Analysis, Social Indicators Research tools:::Rd_expr_doi("10.1007/s11205-020-02464-y").
See Also seqindic.dyn
(with examples)
## See examples on 'seqindic.dyn' help page
Run the code above in your browser using DataLab