[R-sig-ME] significance of slope (different than zero) in triple interaction

Lenth, Russell V ru@@ell-lenth @ending from uiow@@edu
Thu Sep 6 17:05:24 CEST 2018


The emtrends function computes difference quotients using the 'var' argument, which is actually processed as an expression. That makes it possible to scale the slopes. For example (with a different model):

require(emmeans)
fiber.lm <- lm(strength ~ diameter*machine, data=fiber)

summary(emtrends(fiber.lm, "machine", var = "diameter"), infer = TRUE)
## machine diameter.trend        SE df  lower.CL upper.CL t.ratio p.value
## A            1.1042781 0.1936634  9 0.6661810 1.542375   5.702  0.0003
## B            0.8571429 0.2238228  9 0.3508205 1.363465   3.830  0.0040
## C            0.8641975 0.2080707  9 0.3935090 1.334886   4.153  0.0025
## Confidence level used: 0.95 

summary(emtrends(fiber.lm, "machine", var = "2*diameter"), infer = TRUE)
## machine 2*diameter.trend        SE df  lower.CL  upper.CL t.ratio p.value
## A              0.5521390 0.0968317  9 0.3330905 0.7711876   5.702  0.0003
## B              0.4285714 0.1119114  9 0.1754102 0.6817326   3.830  0.0040
## C              0.4320988 0.1040353  9 0.1967545 0.6674430   4.153  0.0025
## Confidence level used: 0.95## Confidence level used: 0.95

The second table has estimates and SEs half as large, because we are differentiating with respect to 2*diameter. Note however that scaling the slopes has no effect on the t (or z) ratios or on the P values. The tests given, in both cases, are tests against the slope being zero. In your own results earlier in this discussion, all the slopes are decidedly negative, no matter how you scale them. 

Russ

PS to Ben: Good call -- I should have said -1.

======================
From: Guillaume Adeux <guillaumesimon.a2 using gmail.com> 
Sent: Thursday, September 6, 2018 5:03 AM
To: Ben Bolker <bbolker using gmail.com>; Lenth, Russell V <russell-lenth using uiowa.edu>
Cc: R-mixed models mailing list <r-sig-mixed-models using r-project.org>
Subject: Re: [R-sig-ME] significance of slope (different than zero) in triple interaction

Ok i found out that was messing up everything.
When an offset is included in the model, the slopes produced by emtrends(model,~factor1|factor2,"num_var") are very different than the ones that can be computed with the model output (the coefficients for the slopes in the output need to be divided by the standard deviation of "num_var" in case of a scaled(num_var) in order to be directly comparable with emtrends output). I don't know what emtrends is doing in this case.
However, the slopes produced by emtrends(model,~factor1|factor2,"num_var") are equivalent to the back transformed scaled coefficients of slopes of the summary output when the offset is taken out. Is there any way to keep the offset and have the correct values of slope? I do not know.
To come back to my original questions, I was indeed looking for the "null" argument which I need to set to 0 because the tests are done on the scale of the linear predictor and a slope of 0 on the log scale is equivalent to a multiplicative factor of 1 on the original scale (which means a flat regression line - no effect).
Don't hesitate to give me your feedback if you believe something I have said above is incorrect.
Thank you a thousand time for you help.
Guillaume ADEUX


Le mer. 5 sept. 2018 à 19:08, Guillaume Adeux <mailto:guillaumesimon.a2 using gmail.com> a écrit :
Sorry for the trouble.

What I want to test is that the slopes are effectively increasing or decreasing; that back on the original scale, the regression line is not parralel to the x-axis. This must be possible but I don't even know if this is the way to go.

Thank you very much for you interest,

Guillaume ADEUX



More information about the R-sig-mixed-models mailing list