| scam.emmeans.support | R Documentation |
Function required for compatibility of scam with the emmeans package.
The function is not normally called directly, but rather service routines for emmeans function
of the emmeans package.
recover_data.scam(object, ...)
object |
A fitted model object of the class |
... |
Additional parameters that may be supported by the method. |
Searle, S. R., Speed, F. M., and Milliken, G. A. (1980). Population Marginal Means in the Linear Model: An Alternative to Least Squares Means. The American Statistician, 34(4), 216-221. https://doi.org/10.1080/00031305.1980.10483031
require(scam)
require(emmeans)
set.seed(2)
n <- 100
x <- sort(runif(n,-.5,.5))
f <- -20*x^2
fac <- as.factor(sample(1:3,n,replace=TRUE))
y <- ifelse(fac == 1, 4, ifelse(fac == 2, 1, -2)) +
f + rnorm(n, 0, 1.5)
dat <- data.frame(y=y,x=x,fac=fac)
m <- scam(y ~ fac+s(x,bs="cv"), data=dat)
em <- emmeans(m, ~ fac)
em
pairs(em)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.