| LSM | R Documentation |
Estimates least squares means using the g2 inverse.
LSM(Formula, Data, Term, conf.level=0.95, adj="lsd", hideNonEst=TRUE,
PLOT=FALSE, descend=FALSE, ...)
Formula |
a conventional formula for a linear model |
Data |
a |
Term |
a term name to be returned. If there is only one independent variable, this can be omitted. |
conf.level |
confidence level for the confidence limit |
adj |
adjustment method for grouping; "lsd" (default), "tukey", "bon", "duncan", and "scheffe" are available. This does not affect the SE, Lower CL, and Upper CL of the output table. |
hideNonEst |
logical. whether to hide non-estimable values |
PLOT |
logical. whether to plot LSMs and their confidence intervals |
descend |
logical. This specifies whether the plotting order is ascending or descending. |
... |
arguments to be passed to |
It is equivalent to the LSMEANS statement of SAS PROC GLM. The result of the second example below may be different from emmeans. This is because SAS and this function calculate the mean of the transformed continuous variable. However, emmeans calculates the average before the transformation. An interaction of three variables is not supported yet. For the "dunnett" adjustment method, see the PDIFF function.
Returns a table of expectations, t values and p-values.
Group |
group character. This appears when the model is one-way ANOVA or when the |
LSmean |
point estimate of the least squares mean |
LowerCL |
lower confidence limit at the given confidence level by the "lsd" method |
UpperCL |
upper confidence limit at the given confidence level by the "lsd" method |
SE |
standard error of the point estimate |
Df |
degrees of freedom of the point estimate |
Kyun-Seop Bae k@acr.kr
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.