Skip to content
Prev 19088 / 20628 Next

fixed-effect model matrix is rank deficient so dropping 1 column / coefficient

Dear Iago,

The reference category of x0 (x0 == "0") contains only zeros for x3. This
is why you get the rank deficiency. The solution is to create the
meaningful interactions as new variables.

data2Sh$x3_1 <- ifelse(data2Sh$x0 == "1", data2Sh$x3, 0)
data2Sh$x3_2 <- ifelse(data2Sh$x0 == "2", data2Sh$x3, 0)
lmer(outcome ~ YLD0 + YLD1 + YLD2 + YLD3 + YLD4 + SEV1 + SEV2 + SEV3 + SEV4
+ SEV5 + SEV6 + x0*x1 + x2 + x3 + x3_1 + x3_2 + year + (1|id), data =
data2Sh)

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx at inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////

<https://www.inbo.be>


Op wo 3 mrt. 2021 om 14:23 schreef IAGO GIN? V?ZQUEZ <i.gine at pssjd.org>:

  
  
Message-ID: <CAJuCY5wsRcT1cL4qZFXKC=DMQkGuQu2mnAUSn-qUXOzCzrJX9g@mail.gmail.com>
In-Reply-To: <AM6PR02MB4423D7435049AFAB38610B3E92989@AM6PR02MB4423.eurprd02.prod.outlook.com>