Skip to content

Comparing mixed models

6 messages · Carlos Barboza, John Fox

#
Dear all,
why Anova type III function gives different results if I change the names
of a categorical factor? I suspect that is because contrast type but it's
something strange get different results using the same data.
thank you

Em s?b., 7 de mai. de 2016 ?s 12:26, Carlos Barboza <
carlosambarboza at gmail.com> escreveu:

  
    
#
sorry, Anova type III function form car package in R

Em ter., 18 de jun. de 2024 ?s 06:59, Carlos Barboza <
carlosambarboza at gmail.com> escreveu:

  
    
1 day later
#
Dear Carlos,

 From ?Anova:

"Warning

Be careful of type-III tests: For a traditional multifactor ANOVA model 
with interactions, for example, these tests will normally only be 
sensible when using contrasts that, for different terms, are orthogonal 
in the row-basis of the model, such as those produced by contr.sum, 
contr.poly, or contr.helmert, but not by the default contr.treatment. In 
a model that contains factors, numeric covariates, and interactions, 
main-effect tests for factors will be for differences over the origin. 
In contrast (pun intended), type-II tests are invariant with respect to 
(full-rank) contrast coding. If you don't understand this issue, then 
you probably shouldn't use Anova for type-III tests."

I hope this helps,
  John
#
Thank you Jonh for you answer
I indeed used contr.sum, contr.poly before to model definition
after that I get the same results using any names for the same factors
but, what do you exactly mean when testing for factors for differences over
the origin?
best regards
Carlos


Em qua., 19 de jun. de 2024 ?s 10:14, John Fox <jfox at mcmaster.ca> escreveu:

  
    
#
Dear Carlos,
On 2024-06-19 11:13 a.m., Carlos Barboza wrote:
The context here is models with both numeric and factor predictors. 
Consider a model of the form y ~ x*f, where x is numeric and f is a 
factor. A type-III test for the "main effect" of f tests for differences 
among factor levels where x = 0 (the origin).

More generally, the issues concerning "types" of tests in models with 
linear predictors are sufficiently complicated that discussing them in a 
help file or by email is likely to prove unsatisfactory. See the first 
two references in ?Anova for more details.

I hope this helps,
  John
#
Thank you,
yes I know that, it's the same interpretation when using the summary
function when we have f*x
thank you
Carlos

Em qua., 19 de jun. de 2024 ?s 12:20, John Fox <jfox at mcmaster.ca> escreveu: