rvlenth / emmeans

Estimated marginal means
https://rvlenth.github.io/emmeans/
355 stars 31 forks source link

Standard deviations in emmeans #295

Closed hunt410 closed 2 years ago

hunt410 commented 3 years ago

Hello, is it possible to obtain standard deviations for the marginal means provided by emmeans::emmeans?

Thank you!

rvlenth commented 3 years ago

There are two ways to answer that.

If you mean the SD of the sampling distribution of the EMMs, those are shown in the summary as SE.

If you are talking about estimating the SD of the response variable at each factor combination, you would need a model for that. Typically, such models are generalized linear models with a gamma family.

rvlenth commented 2 years ago

I am closing this as I believe I have answered your question. However, please feel free to re-open it if you want to add more specific information, especially regarding the second part of my answer. There are some packages that provide ways of modeling both the mean and SD simultaneously, e.g., the gamlss package. In short, emmeans can estimate SDs, but it needs a model that estimates them.