plotly_spRMM: Plot output from Stochastic EM algorithm for semiparametric...

View source: R/plotly_spRMM.R

plotly_spRMMR Documentation

Plot output from Stochastic EM algorithm for semiparametric scaled mixture of censored data using plotly.

Description

This is an updated version of plotspRMM function. For technical details, please refer to plotspRMM.

Usage

  plotly_spRMM(sem, tmax = NULL,
               width = 3 , col = '#1f77b4', cex = 3,
               title.size = 15 , 
               title.x = 0.5 , title.y = 0.95,
               xlab.size = 15 , xtick.size=15 ,
               ylab.size = 15 , ytick.size=15)

Arguments

sem

An object returned by spRMM_SEM.

tmax

The max time for x axis, set to some default value if NULL.

width

Width of lines.

col

Color of lines.

cex

Size of dots.

title.size

Size of the main title.

title.x

Horizontal position of the main title.

title.y

Vertical position of the main title.

xlab.size

Size of the label of X-axis.

xtick.size

Size of the tick of X-axis.

ylab.size

Size of the label of Y-axis.

ytick.size

Size of the tick of Y-axis.

Value

The four plots returned.

Author(s)

Didier Chauveau

References

See Also

Related functions: spRMM_SEM , plotspRMM.

Other models and algorithms for censored lifetime data (name convention is model_algorithm): expRMM_EM, weibullRMM_SEM.

Examples

## Not run: 
n=500 # sample size
m=2 # nb components
lambda=c(0.4, 0.6) # parameters
meanlog=3; sdlog=0.5; scale=0.1
set.seed(12)
# simulate a scaled mixture of lognormals
x <- rlnormscalemix(n, lambda, meanlog, sdlog, scale)
cs=runif(n,20,max(x)+400) # Censoring (uniform) and incomplete data
t <- apply(cbind(x,cs),1,min)
d <- 1*(x <= cs)
tauxc <- 100*round( 1-mean(d),3)
cat(tauxc, "percents of data censored.\n")

c0 <- c(25, 180) # data-driven initial centers (visible modes)
sc0 <- 25/180    # and scaling
s <- spRMM_SEM(t, d, scaling = sc0, centers = c0, bw = 15, maxit = 100)

plotly_spRMM(s) # default
summary(s)   # S3 method for class "spRMM"

## End(Not run)

mixtools documentation built on Dec. 5, 2022, 5:23 p.m.