Skip to main content
added 977 characters in body
Source Link
Isabella Ghement
  • 20.9k
  • 2
  • 37
  • 60

The answer is that your model formulation chamgesparametrization changes, which in turns impacts the inference you can conduct based on the output reported by R in the model summary.

Model 1:   

$Height = \beta_0 + \beta_1*SmokeNever + \beta_2*SmokeOccas + \beta_3*SmokeRegul + \epsilon$

Model 2:   

$Height = \beta_0^* + \beta_1^**SmokeReorderedHeavy + \beta_2^**SmokeReorderedOccas + \beta_3^**SmokeReorderedRegul + \epsilon^*$

However, as pointed out by @whuber in his comment, changing the model parametrization will not impact the estimated mean Height values for the four categories of Smoke reported by R. That is because:

  • $\beta_0$ in Model 1 and $\beta_0^*+ \beta_1^*$ in Model 2 are different parametrizations for the same thing, namely the mean Height of heavy smokers in the target population;

  • $\beta_0 + \beta_1$ in Model 1 and $\beta_0^*$ in Model 2 are different parametrizations for the same thing, namely the mean Height of those who never smoke in the target population;

  • $\beta_0 + \beta_2$ in Model 1 and $\beta_0^*+ \beta_2^*$ in Model 2 are different parametrizations for the same thing, namely the mean Height of occasional smokers in the target population;

  • $\beta_0 + \beta_3$ in Model 1 and $\beta_0^*+ \beta_3^*$ in Model 2 are different parametrizations for the same thing, namely the mean Height of regular smokers in the target population.

The answer is that your model formulation chamges, which in turns impacts the inference you can conduct based on the output reported by R in the model summary.

Model 1:  $Height = \beta_0 + \beta_1*SmokeNever + \beta_2*SmokeOccas + \beta_3*SmokeRegul + \epsilon$

Model 2:  $Height = \beta_0^* + \beta_1^**SmokeReorderedHeavy + \beta_2^**SmokeReorderedOccas + \beta_3^**SmokeReorderedRegul + \epsilon^*$

The answer is that your model parametrization changes, which in turns impacts the inference you can conduct based on the output reported by R in the model summary.

Model 1: 

$Height = \beta_0 + \beta_1*SmokeNever + \beta_2*SmokeOccas + \beta_3*SmokeRegul + \epsilon$

Model 2: 

$Height = \beta_0^* + \beta_1^**SmokeReorderedHeavy + \beta_2^**SmokeReorderedOccas + \beta_3^**SmokeReorderedRegul + \epsilon^*$

However, as pointed out by @whuber in his comment, changing the model parametrization will not impact the estimated mean Height values for the four categories of Smoke reported by R. That is because:

  • $\beta_0$ in Model 1 and $\beta_0^*+ \beta_1^*$ in Model 2 are different parametrizations for the same thing, namely the mean Height of heavy smokers in the target population;

  • $\beta_0 + \beta_1$ in Model 1 and $\beta_0^*$ in Model 2 are different parametrizations for the same thing, namely the mean Height of those who never smoke in the target population;

  • $\beta_0 + \beta_2$ in Model 1 and $\beta_0^*+ \beta_2^*$ in Model 2 are different parametrizations for the same thing, namely the mean Height of occasional smokers in the target population;

  • $\beta_0 + \beta_3$ in Model 1 and $\beta_0^*+ \beta_3^*$ in Model 2 are different parametrizations for the same thing, namely the mean Height of regular smokers in the target population.

added 4496 characters in body
Source Link
Isabella Ghement
  • 20.9k
  • 2
  • 37
  • 60

Impact of Re-Ordered Factor Levels

What happens to your model when you re-order the categories of Smoke so that the reference category changes?

The answer is that your model formulation chamges, which in turns impacts the inference you can conduct based on the output reported by R in the model summary.

To illustrate this, assume you consider two competing models. Model 1 uses Heavy as a reference level for the Smoke predictor, while Model 2 uses Never as a reference level. The two models clearly have different formulations, as they include different dummy variables.

Model 1: $Height = \beta_0 + \beta_1*SmokeNever + \beta_2*SmokeOccas + \beta_3*SmokeRegul + \epsilon$

Model 2: $Height = \beta_0^* + \beta_1^**SmokeReorderedHeavy + \beta_2^**SmokeReorderedOccas + \beta_3^**SmokeReorderedRegul + \epsilon^*$

In Model 1, for the target population, the mean Height for heavy smokers is quantified by the parameter $\beta_0$, the mean Height for those who never smoke is quantified by the parameter $\beta_0 + \beta_1$, the mean Height of occasional smokers is quantified by the parameter $\beta_0 + \beta_2$ and the mean Height for regular smokers is quantified by the parameter $\beta_0 + \beta_3$. In the summary for Model 1, R will report estimated values for the parameters $\beta_0$, $\beta_1$, $\beta_2$ and $\beta_3$, along with tests of hypotheses of the form:

  1. Ho: $\beta_0 = 0$ versus Ha: $\beta_0 \neq 0$;
  2. Ho: $\beta_1 = 0$ versus Ha: $\beta_1 \neq 0$;
  3. Ho: $\beta_2 = 0$ versus Ha: $\beta_2 \neq 0$;
  4. Ho: $\beta_3 = 0$ versus Ha: $\beta_3 \neq 0$.

In other words, R will estimate the mean value of Height for heavy smokers (quantified by $\beta_0$) and test whether it is different from 0. It will also (i) estimate the difference in mean Height values between those who never smoke and heavy smokers (quantified by $\beta_1$) and test whether this difference is different from 0, (ii) estimate the difference in mean Height values between those who occasionally smoke and heavy smokers (quantified by $\beta_2$) and test whether it is different from 0 and (iii) estimate the difference in mean Height values between those who regularly smoke and heavy smokers (quantified by $\beta_3$) and test whether it is different from 0.

In Model 2, the mean Height for those who never smoke is quantified by the parameter $\beta_0^*$, the mean Height for those who are heavy smokers is quantified by the parameter $\beta_0^*+ \beta_1^*$, the mean Height of occasional smokers is quantified by the parameter $\beta_0^* + \beta_2^*$ and the mean Height for regular smokers is quantified by the parameter $\beta_0^* + \beta_3^*$. In the summary for Model 2, R will report estimated values for the parameters $\beta_0*$, $\beta_1^*$, $\beta_2^*$ and $\beta_3^*$, along with tests of hypotheses of the form:

  1. Ho: $\beta_0^* = 0$ versus Ha: $\beta_0^* \neq 0$;
  2. Ho: $\beta_1^* = 0$ versus Ha: $\beta_1^* \neq 0$;
  3. Ho: $\beta_2^* = 0$ versus Ha: $\beta_2^* \neq 0$;
  4. Ho: $\beta_3^* = 0$ versus Ha: $\beta_3^* \neq 0$.

Thus, for Model 2, R will estimate the mean value of Height for those who never smoke (quantified by $\beta_0^*$) and test whether it is different from 0. It will also (i) estimate the difference in mean Height values between heavy smokers and those who never smoke (quantified by $\beta_1^*$) and test whether it is different from 0, (ii) estimate the difference in mean Height values between those who occasionally smoke and those who never smoke (quantified by $\beta_2^*$) and test whether it is different from 0 and (iii) estimate the difference in mean Height values between those who regularly smoke and those who never smoker (quantified by $\beta_3^*$) and test whether it is different from 0.

This is the reason why I added my comment to this answer:

When you look at the significance of REGULAR in a model where HEAVY is treated as the reference, you are testing for a difference in the mean Height between subjects in your target population who are REGULAR smokers and those who are HEAVY smokers. When you look at the significance of REGULAR in a model where NEVER is treated as the reference, you are testing for a difference in the mean Height between subjects in your target population who are REGULAR smokers and those who are not smokers.

No wonder you get different p-values - you are performing different tests of hypotheses based on your choice of reference level!

Impact of Re-Ordered Factor Levels

What happens to your model when you re-order the categories of Smoke so that the reference category changes?

The answer is that your model formulation chamges, which in turns impacts the inference you can conduct based on the output reported by R in the model summary.

To illustrate this, assume you consider two competing models. Model 1 uses Heavy as a reference level for the Smoke predictor, while Model 2 uses Never as a reference level. The two models clearly have different formulations, as they include different dummy variables.

Model 1: $Height = \beta_0 + \beta_1*SmokeNever + \beta_2*SmokeOccas + \beta_3*SmokeRegul + \epsilon$

Model 2: $Height = \beta_0^* + \beta_1^**SmokeReorderedHeavy + \beta_2^**SmokeReorderedOccas + \beta_3^**SmokeReorderedRegul + \epsilon^*$

In Model 1, for the target population, the mean Height for heavy smokers is quantified by the parameter $\beta_0$, the mean Height for those who never smoke is quantified by the parameter $\beta_0 + \beta_1$, the mean Height of occasional smokers is quantified by the parameter $\beta_0 + \beta_2$ and the mean Height for regular smokers is quantified by the parameter $\beta_0 + \beta_3$. In the summary for Model 1, R will report estimated values for the parameters $\beta_0$, $\beta_1$, $\beta_2$ and $\beta_3$, along with tests of hypotheses of the form:

  1. Ho: $\beta_0 = 0$ versus Ha: $\beta_0 \neq 0$;
  2. Ho: $\beta_1 = 0$ versus Ha: $\beta_1 \neq 0$;
  3. Ho: $\beta_2 = 0$ versus Ha: $\beta_2 \neq 0$;
  4. Ho: $\beta_3 = 0$ versus Ha: $\beta_3 \neq 0$.

In other words, R will estimate the mean value of Height for heavy smokers (quantified by $\beta_0$) and test whether it is different from 0. It will also (i) estimate the difference in mean Height values between those who never smoke and heavy smokers (quantified by $\beta_1$) and test whether this difference is different from 0, (ii) estimate the difference in mean Height values between those who occasionally smoke and heavy smokers (quantified by $\beta_2$) and test whether it is different from 0 and (iii) estimate the difference in mean Height values between those who regularly smoke and heavy smokers (quantified by $\beta_3$) and test whether it is different from 0.

In Model 2, the mean Height for those who never smoke is quantified by the parameter $\beta_0^*$, the mean Height for those who are heavy smokers is quantified by the parameter $\beta_0^*+ \beta_1^*$, the mean Height of occasional smokers is quantified by the parameter $\beta_0^* + \beta_2^*$ and the mean Height for regular smokers is quantified by the parameter $\beta_0^* + \beta_3^*$. In the summary for Model 2, R will report estimated values for the parameters $\beta_0*$, $\beta_1^*$, $\beta_2^*$ and $\beta_3^*$, along with tests of hypotheses of the form:

  1. Ho: $\beta_0^* = 0$ versus Ha: $\beta_0^* \neq 0$;
  2. Ho: $\beta_1^* = 0$ versus Ha: $\beta_1^* \neq 0$;
  3. Ho: $\beta_2^* = 0$ versus Ha: $\beta_2^* \neq 0$;
  4. Ho: $\beta_3^* = 0$ versus Ha: $\beta_3^* \neq 0$.

Thus, for Model 2, R will estimate the mean value of Height for those who never smoke (quantified by $\beta_0^*$) and test whether it is different from 0. It will also (i) estimate the difference in mean Height values between heavy smokers and those who never smoke (quantified by $\beta_1^*$) and test whether it is different from 0, (ii) estimate the difference in mean Height values between those who occasionally smoke and those who never smoke (quantified by $\beta_2^*$) and test whether it is different from 0 and (iii) estimate the difference in mean Height values between those who regularly smoke and those who never smoker (quantified by $\beta_3^*$) and test whether it is different from 0.

This is the reason why I added my comment to this answer:

When you look at the significance of REGULAR in a model where HEAVY is treated as the reference, you are testing for a difference in the mean Height between subjects in your target population who are REGULAR smokers and those who are HEAVY smokers. When you look at the significance of REGULAR in a model where NEVER is treated as the reference, you are testing for a difference in the mean Height between subjects in your target population who are REGULAR smokers and those who are not smokers.

No wonder you get different p-values - you are performing different tests of hypotheses based on your choice of reference level!

added 392 characters in body
Source Link
Isabella Ghement
  • 20.9k
  • 2
  • 37
  • 60

When excluding the intercept from the model, summary(survfit0) will report the estimated mean Height for each category/level of Smoke.

When including the intercept in the model, summary(survfit0) will report the difference in estimated mean Height values between each non-reference category of Smoke (in your case, Never, Occas and Regul) and the reference category of Smoke (Heavy).

Alphabetical Ordering of Factor Levels

Alphabetical Ordering of Factor Levels

When excluding the intercept from the model, summary(survfit0) will report the estimated mean Height for each category/level of Smoke.

When including the intercept in the model, summary(survfit0) will report the difference in estimated mean Height values between each non-reference category of Smoke (in your case, Never, Occas and Regul) and the reference category of Smoke (Heavy).

Alphabetical Ordering of Factor Levels

Source Link
Isabella Ghement
  • 20.9k
  • 2
  • 37
  • 60
Loading