Yes, but.... [🇷 for BE/BA]
Hi Mittyri,
A full rank model matrix means there are not more columns than the rank. Then XtX becomes invertible.
A model matrix with a column for every level of every factor (plus intercept) is not the same. Rather that's redundancy. XtX now becomes trouble
My function creates a full rank model matrix.
❝ may be I misunderstood your
❝
❝ ❝ is not full rank. Neither is does it contain a column for every level of every factor.
❝ The solution you proposed with qr() does not give a column for every level of every factor
❝ > (MakeFullRank(model.matrix(~ f + g)))
❝ 1 1 0 0 1 0
❝ 2 1 0 1 1 0
❝ 3 1 1 0 0 1
❝ 4 1 0 1 1 0
❝ 5 1 0 0 0 0
❝ 6 1 0 0 0 1
❝ 7 1 0 1 0 0
❝ 8 1 1 0 0 0
❝ 9 1 0 1 1 0
❝ 10 1 1 0 0 0
❝ 11 1 0 0 0 1
❝ 12 1 1 0 0 1
A full rank model matrix means there are not more columns than the rank. Then XtX becomes invertible.
A model matrix with a column for every level of every factor (plus intercept) is not the same. Rather that's redundancy. XtX now becomes trouble
My function creates a full rank model matrix.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- lm and the model matrix ElMaestro 2024-02-19 09:51 [🇷 for BE/BA]
- the model matrix and the contrasts mittyri 2024-02-22 20:21
- Yes, but.... ElMaestro 2024-02-23 17:41
- Yes, but.... mittyri 2024-02-23 19:39
- Yes, but....ElMaestro 2024-02-23 22:15
- Yes, but.... mittyri 2024-02-23 19:39
- Yes, but.... ElMaestro 2024-02-23 17:41
- the model matrix and the contrasts mittyri 2024-02-22 20:21