I don’t know if this will make a difference, but I believe it is generally
preferred to use the poly() function (for lm()/glm()) or the pol() function
(for rms functions) to include the quadratic (and higher order terms).
Kevin
> On Feb 18, 2025, at 12:23 PM, Ben Bolker wrote:
>
> Looking a
Looking at the 'contrasts' function, it seems to be imported from
'rms' and to take only 'rms'-type fits (which are different from base-R
[g]lm() fits) as input.
I'm not sure exactly what contrasts you're trying to generate, but I
would probably use the emmeans package for the task, since
I am using the contrast package to produce contrasts from a glm model that
contains a quadratic term:
fit0 <- glm(y ~ x + I(x*x),data=mydata)
I would like to know how to specify the quadratic term, I(x*x), in the contrast
function.
When I try to use
contrast(fit0,list(x=4))
I receive an error me
3 matches
Mail list logo