Display the corresponding graphic of statistical table
# S3 method for desc
plot(x, ..., title = "", ylim = NULL, xlim = NULL,
xlab = "", ylab = "", legend.label = "Group", add.sd = F,
add.ci = F, size.title = 10, add.line = T)
A desc object
Other parameters
Character The title of the plot
Numeric of length 2 for setting y axis limits
Numeric of length 2 for setting x axis limits
Character Label for x-axis
Character Label for y-axis
Character Label for the legend (used only if x1 and x2 are not NULL in the desc object)
Logical. If TRUE it adds bars to the means representing +/-SD (for desc quanti reporting only)
Logical. If TRUE it adds bars to the means representing 95% CI (for LS Means reporting only)
Numeric. used to specify the font size of the title
Logical. If TRUE it joins the dots with a line (default to TRUE)
It's a wrapper function which uses gg_desc_quanti
gg_desc_quali
or gg_desc_lsmeans
depending if
the desc object is of type "quali", "quanti" or "lsmeans"
(argumenttype.desc
in desc
object, see examples below).
# NOT RUN {
data(datafake)
desc=report.quali(data=datafake,y="y_logistic",x1="GROUP",
x2="TIMEPOINT")
plot(desc,
title="Qualitative desc object with 2 explicative variables",
legend.label="Y levels")
desc2=report.quanti(data=datafake,y="y_numeric",x1="GROUP",
x2="TIMEPOINT")
plot(desc2,
title="Quantitative desc object with 2 explicative variables",
legend.label="Treatment groups")
#Removing baseline data in the response, for the model
data.mod=droplevels(datafake[datafake$TIMEPOINT!="D0",])
library(nlme)
library(emmeans)
mod3=lme(y_numeric~baseline+GROUP+TIMEPOINT+GROUP*TIMEPOINT,
random=~1|SUBJID,data=data.mod,na.action=na.omit)
test3=emmeans(mod3,~GROUP|TIMEPOINT)
tab.mod3=report.lsmeans(lsm=test3)
gg=plot(tab.mod3,title="LS Means plot example")
#Print
gg
# }
Run the code above in your browser using DataLab