Skip to main content
added 304 characters in body
Source Link
Sextus Empiricus
  • 86.6k
  • 6
  • 115
  • 304

There must be someAn illustrative problems that showshows how the factors of $n$ levels are only fitted with $n-1$ coefficients and one term gets absorbed into the intercept is: Fitting a Logistic Regression Without an Intercept . I have seen such problems several times, but I canIn that problem you see that the person who ask's the questions tries to get rid of this 'dropping of one level for each factor' by not find them backusing an intercept. But this only works for one factor. The factor for which this works is the one which is the beginning of the model.

I found one, but it is a bitA more silly example is: Why do output coefficients not resemble true coefficients in a linear model? In that particular example pay especially attention to the nls model where the dropping of the first level of each factor must be done explicitly

There must be some illustrative problems that show how the factors of $n$ levels are only fitted with $n-1$ coefficients and one term gets absorbed into the intercept. I have seen such problems several times, but I can not find them back.

I found one, but it is a bit silly example: Why do output coefficients not resemble true coefficients in a linear model? In that particular example pay especially attention to the model

An illustrative problems that shows how the factors of $n$ levels are only fitted with $n-1$ coefficients and one term gets absorbed into the intercept is: Fitting a Logistic Regression Without an Intercept . In that problem you see that the person who ask's the questions tries to get rid of this 'dropping of one level for each factor' by not using an intercept. But this only works for one factor. The factor for which this works is the one which is the beginning of the model.

A more silly example is: Why do output coefficients not resemble true coefficients in a linear model? In that particular example pay especially attention to the nls model where the dropping of the first level of each factor must be done explicitly

added 339 characters in body
Source Link
Sextus Empiricus
  • 86.6k
  • 6
  • 115
  • 304

(There There must be some illustrative problems that show how the factors of $n$ levels are only fitted with $n-1$ coefficients and one term gets absorbed into the intercept. I have seen such problems several times, but I can not find them back. 

I found one, but it is a bit silly example: Why do output coefficients not resemble true coefficients in a linear model? In that particular example pay especially attention to the model

modelnls2 <- nls(Y ~ exp(a + c(0,b1,b2)[Home] + c(0,c1)[Gender] + c(0,d1,d2)[Rank]), 
                start = c(a=1,b1=1,b2=1,c1=1,d1=1,d2=1), data=dune)

For each of the factors (Home, Gender, Rank), the related coefficients are set explicitly at 0 for one of the levels. If you would take away the intercept coefficient a then you could add it to one of the others. For instance:

modelnls2 <- nls(Y ~ exp(c(a,b1+a,b2+a)[Home] + c(0,c1)[Gender] + c(0,d1,d2)[Rank]), 
                start = c(a=1,b1=1,b2=1,c1=1,d1=1,d2=1), data=dune)
### or equivalent
modelnls2 <- nls(Y ~ exp(c(a,b1,b2)[Home] + c(0,c1)[Gender] + c(0,d1,d2)[Rank]), 
                start = c(a=1,b1=1,b2=1,c1=1,d1=1,d2=1), data=dune)

This is what happens with the lm function for the referenced question and is the reason why the order matters.

(There must be some illustrative problems that show how the factors of $n$ levels are only fitted with $n-1$ coefficients and one term gets absorbed into the intercept. I have seen such problems several times, but I can not find them back. I found one, but it is a bit silly example: Why do output coefficients not resemble true coefficients in a linear model?)

There must be some illustrative problems that show how the factors of $n$ levels are only fitted with $n-1$ coefficients and one term gets absorbed into the intercept. I have seen such problems several times, but I can not find them back. 

I found one, but it is a bit silly example: Why do output coefficients not resemble true coefficients in a linear model? In that particular example pay especially attention to the model

modelnls2 <- nls(Y ~ exp(a + c(0,b1,b2)[Home] + c(0,c1)[Gender] + c(0,d1,d2)[Rank]), 
                start = c(a=1,b1=1,b2=1,c1=1,d1=1,d2=1), data=dune)

For each of the factors (Home, Gender, Rank), the related coefficients are set explicitly at 0 for one of the levels. If you would take away the intercept coefficient a then you could add it to one of the others. For instance:

modelnls2 <- nls(Y ~ exp(c(a,b1+a,b2+a)[Home] + c(0,c1)[Gender] + c(0,d1,d2)[Rank]), 
                start = c(a=1,b1=1,b2=1,c1=1,d1=1,d2=1), data=dune)
### or equivalent
modelnls2 <- nls(Y ~ exp(c(a,b1,b2)[Home] + c(0,c1)[Gender] + c(0,d1,d2)[Rank]), 
                start = c(a=1,b1=1,b2=1,c1=1,d1=1,d2=1), data=dune)

This is what happens with the lm function for the referenced question and is the reason why the order matters.

added 339 characters in body
Source Link
Sextus Empiricus
  • 86.6k
  • 6
  • 115
  • 304

(There must be some illustrative problems that show how the factors of $n$ levels are only fitted with $n-1$ coefficients and one term gets absorbed into the intercept. I have seen such problems several times, but I can not find them back. I found one, but it is a bit silly example: Why do output coefficients not resemble true coefficients in a linear model?)

(There must be some illustrative problems that show how the factors of $n$ levels are only fitted with $n-1$ coefficients and one term gets absorbed into the intercept. I have seen such problems several times, but I can not find them back. I found one, but it is a bit silly example: Why do output coefficients not resemble true coefficients in a linear model?)

added 270 characters in body
Source Link
Sextus Empiricus
  • 86.6k
  • 6
  • 115
  • 304
Loading
added 301 characters in body
Source Link
Sextus Empiricus
  • 86.6k
  • 6
  • 115
  • 304
Loading
Source Link
Sextus Empiricus
  • 86.6k
  • 6
  • 115
  • 304
Loading