
Last chance! 50% off unlimited learning
Sale ends in
Estimates least square means using g2 inverse.
LSM(Formula, Data, Term, conf.level=0.95, adj="lsd", hideNonEst=TRUE,
PLOT=FALSE, descend=FALSE, ...)
Returns a table of expectations, t values and p-values.
group character. This appears with one-way ANOVA or Term
or adj
argument is provided.
point estimate of least square mean
lower confidence limit with the given confidence level by "lsd" method
upper confidence limit with the given confidence level by "lsd" method
standard error of the point estimate
degree of freedom of point estimate
a conventional formula of model
data.frame
term name to be returned. If there is only one independent variable, this can be omitted.
confidence level for the confidence limit
adjustment method for grouping, "lsd"(default), "tukey", "bon", "duncan", "scheffe" are available. This does not affects SE, Lower CL, Upper CL of the output table.
logical. hide non-estimables
logical. whether to plot LSMs and their confidence intervals
logical. This specifies the plotting order be ascending or descending.
arguments to be passed to plot
Kyun-Seop Bae k@acr.kr
It corresponds to SAS PROC GLM LSMEANS. The result of the second example below may be different from emmeans
. This is because SAS or this function calculates mean of the transformed continuous variable. However, emmeans
calculates the average before the transformation. Interaction of three variables is not supported yet. For adjust method "dunnett", see PDIFF
function.
PDIFF
, Diffogram
LSM(uptake ~ Type, CO2[-1,])
LSM(uptake ~ Type - 1, CO2[-1,])
LSM(uptake ~ Type*Treatment + conc, CO2[-1,])
LSM(uptake ~ Type*Treatment + conc - 1, CO2[-1,])
LSM(log(uptake) ~ Type*Treatment + log(conc), CO2[-1,])
LSM(log(uptake) ~ Type*Treatment + log(conc) - 1, CO2[-1,])
LSM(log(uptake) ~ Type*Treatment + as.factor(conc), CO2[-1,])
LSM(log(uptake) ~ Type*Treatment + as.factor(conc) - 1, CO2[-1,])
LSM(log(CMAX) ~ SEQ/SUBJ + PRD + TRT, BEdata)
LSM(log(CMAX) ~ SEQ/SUBJ + PRD + TRT - 1, BEdata)
Run the code above in your browser using DataLab