Discussion:
[R] Difference between summary.lm() and summary.aov()
Alexander Sirotkin [at Yahoo]
2003-12-06 16:10:55 UTC
Permalink
I have a simple linear model (fitted with lm()) with 2
independant
variables : one categorical and one integer.

When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical variable
has to be
converted into many indicator variables) which looks
like :

Estimate Std. Error t value Pr(>|t|)
(Intercept) -3595.3 2767.1 -1.299 0.2005
physicianB 802.0 2289.5 0.350 0.7277
physicianC 4906.8 2419.8 2.028 0.0485 *
severity 7554.4 906.3 8.336 1.12e-10 ***

and when I run summary.aov() I get similar ANOVA table
:

Df Sum Sq Mean Sq F value Pr(>F)
physician 2 294559803 147279901 3.3557 0.04381
*
severity 1 3049694210 3049694210 69.4864 1.124e-10
***
Residuals 45 1975007569 43889057

What is absolutely unclear to me is how F-value and
Pr(>F) for the
categorical "physician" variable of the summary.aov()
is calculated
from the t-value of the summary.lm() table.

I looked at the summary.aov() source code but still
could not figure
it.

Thanks a lot.

__________________________________

New Yahoo! Photos - easier uploading and sharing.
Spencer Graves
2003-12-06 17:17:15 UTC
Permalink
The square of a Student's t with "df" degrees of freedom is an F
distribution with 1 and "df" degrees of freedom.

hope this helps. spencer graves
Post by Alexander Sirotkin [at Yahoo]
I have a simple linear model (fitted with lm()) with 2
independant
variables : one categorical and one integer.
When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical variable
has to be
converted into many indicator variables) which looks
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3595.3 2767.1 -1.299 0.2005
physicianB 802.0 2289.5 0.350 0.7277
physicianC 4906.8 2419.8 2.028 0.0485 *
severity 7554.4 906.3 8.336 1.12e-10 ***
and when I run summary.aov() I get similar ANOVA table
Df Sum Sq Mean Sq F value Pr(>F)
physician 2 294559803 147279901 3.3557 0.04381
*
severity 1 3049694210 3049694210 69.4864 1.124e-10
***
Residuals 45 1975007569 43889057
What is absolutely unclear to me is how F-value and
Pr(>F) for the
categorical "physician" variable of the summary.aov()
is calculated
from the t-value of the summary.lm() table.
I looked at the summary.aov() source code but still
could not figure
it.
Thanks a lot.
__________________________________
New Yahoo! Photos - easier uploading and sharing.
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
John Fox
2003-12-06 23:24:27 UTC
Permalink
Dear Spencer and Alexander,

In this case, physician is apparently a factor with three levels, so
summary.aov() gives you a sequential ANOVA, equivalent to what you'd get
from anova(). There no simple relationship between the F-statistic for
physician, which has 2 df in the numerator, and the two t's. (By the way, I
doubt whether a sequential ANOVA is what's wanted here.)

Regards,
John
Post by Spencer Graves
The square of a Student's t with "df" degrees of freedom is an F
distribution with 1 and "df" degrees of freedom.
hope this helps. spencer graves
Post by Alexander Sirotkin [at Yahoo]
I have a simple linear model (fitted with lm()) with 2
independant
variables : one categorical and one integer.
When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical variable
has to be
converted into many indicator variables) which looks
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3595.3 2767.1 -1.299 0.2005
physicianB 802.0 2289.5 0.350 0.7277
physicianC 4906.8 2419.8 2.028 0.0485 *
severity 7554.4 906.3 8.336 1.12e-10 ***
and when I run summary.aov() I get similar ANOVA table
Df Sum Sq Mean Sq F value Pr(>F)
physician 2 294559803 147279901 3.3557 0.04381
*
severity 1 3049694210 3049694210 69.4864 1.124e-10
***
Residuals 45 1975007569 43889057
What is absolutely unclear to me is how F-value and
Pr(>F) for the
categorical "physician" variable of the summary.aov()
is calculated
from the t-value of the summary.lm() table.
I looked at the summary.aov() source code but still
could not figure
it.
Thanks a lot.
__________________________________
New Yahoo! Photos - easier uploading and sharing.
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
Alexander Sirotkin [at Yahoo]
2003-12-07 12:21:47 UTC
Permalink
John,

What you are saying is that any conclusion I can make
from summary.aov (for instance, to answer a question
if physician is a significant variable) will not be
correct ?
Post by John Fox
Dear Spencer and Alexander,
In this case, physician is apparently a factor with
three levels, so
summary.aov() gives you a sequential ANOVA,
equivalent to what you'd get
from anova(). There no simple relationship between
the F-statistic for
physician, which has 2 df in the numerator, and the
two t's. (By the way, I
doubt whether a sequential ANOVA is what's wanted
here.)
Regards,
John
Post by Spencer Graves
The square of a Student's t with "df" degrees
of freedom is an F
Post by Spencer Graves
distribution with 1 and "df" degrees of freedom.
hope this helps. spencer graves
Post by Alexander Sirotkin [at Yahoo]
I have a simple linear model (fitted with lm())
with 2
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
independant
variables : one categorical and one integer.
When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical
variable
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
has to be
converted into many indicator variables) which
looks
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3595.3 2767.1 -1.299 0.2005
physicianB 802.0 2289.5 0.350 0.7277
physicianC 4906.8 2419.8 2.028 0.0485 *
severity 7554.4 906.3 8.336 1.12e-10
***
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
and when I run summary.aov() I get similar ANOVA
table
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Df Sum Sq Mean Sq F value
Pr(>F)
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physician 2 294559803 147279901 3.3557
0.04381
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
*
severity 1 3049694210 3049694210 69.4864
1.124e-10
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
***
Residuals 45 1975007569 43889057
What is absolutely unclear to me is how F-value
and
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Pr(>F) for the
categorical "physician" variable of the
summary.aov()
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
is calculated
from the t-value of the summary.lm() table.
I looked at the summary.aov() source code but
still
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
could not figure
it.
Thanks a lot.
__________________________________
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
-----------------------------------------------------
Post by John Fox
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------
Peter Dalgaard
2003-12-07 13:17:11 UTC
Permalink
Post by Alexander Sirotkin [at Yahoo]
John,
What you are saying is that any conclusion I can make
from summary.aov (for instance, to answer a question
if physician is a significant variable) will not be
correct ?
Summary.aov is for summarizing aov objects, so you're lucky to get
something that is sensible at all. You should use anova() to get
analysis of variance tables. These are sequential so that you can use
them (give or take some quibbles about the residual variance) for
reducing the model from the "bottom up". I.e. if you place "physician"
last, you get the F test for whether that variable is significant.
However, a more convenient way of getting that result is to use
drop1(). Even then there's no simple relation to the two
t-tests, except that the F test tests the hypothesis that *both*
coefficients are zero, where the t-tests do so individually.
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Dear Spencer and Alexander,
In this case, physician is apparently a factor with
three levels, so
summary.aov() gives you a sequential ANOVA,
equivalent to what you'd get
from anova(). There no simple relationship between
the F-statistic for
physician, which has 2 df in the numerator, and the
two t's. (By the way, I
doubt whether a sequential ANOVA is what's wanted
here.)
Regards,
John
Post by Spencer Graves
The square of a Student's t with "df" degrees
of freedom is an F
Post by Spencer Graves
distribution with 1 and "df" degrees of freedom.
hope this helps. spencer graves
Post by Alexander Sirotkin [at Yahoo]
I have a simple linear model (fitted with lm())
with 2
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
independant
variables : one categorical and one integer.
When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical
variable
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
has to be
converted into many indicator variables) which
looks
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3595.3 2767.1 -1.299 0.2005
physicianB 802.0 2289.5 0.350 0.7277
physicianC 4906.8 2419.8 2.028 0.0485 *
severity 7554.4 906.3 8.336 1.12e-10
***
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
and when I run summary.aov() I get similar ANOVA
table
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Df Sum Sq Mean Sq F value
Pr(>F)
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physician 2 294559803 147279901 3.3557
0.04381
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
*
severity 1 3049694210 3049694210 69.4864
1.124e-10
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
***
Residuals 45 1975007569 43889057
What is absolutely unclear to me is how F-value
and
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Pr(>F) for the
categorical "physician" variable of the
summary.aov()
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
is calculated
from the t-value of the summary.lm() table.
I looked at the summary.aov() source code but
still
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
could not figure
it.
Thanks a lot.
__________________________________
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
-----------------------------------------------------
Post by John Fox
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
John Fox
2003-12-17 01:32:33 UTC
Permalink
Post by Alexander Sirotkin [at Yahoo]
Thanks a lot to everybody. Two more questions, if you
How anova() treats non-categorical variables, such as
severity in my case ? I was under impression that
ANOVA is defined for categorical variables only.
The term ANOVA is commonly used in two related but distinct senses: a
linear model in which the predictors are factors (categorical variables),
and a table with sums of squares, associated df, and F-tests for various
terms in a linear model, which need not consist only of factors. The
anova() function computes the latter, and generalizes this, e.g., to
analysis of deviance table for generalized linear models.
Post by Alexander Sirotkin [at Yahoo]
I read about drop1() and I understand that it performs
F-test for nested models, correct me if I'm wrong. It
is unclear to me, however, how it manages to do this
F-test for interactions ?
Actually, tests for the highest-order terms in the model are more
straightforward than those for lower-order terms. The drop1() function does
just that -- that is, drops a high-order term from the model and (for a
linear model) computes the change in the residual sum of squares.

I hope that this helps,
John
Post by Alexander Sirotkin [at Yahoo]
Thanks a lot.
"Alexander Sirotkin [at Yahoo]"
Post by Alexander Sirotkin [at Yahoo]
John,
What you are saying is that any conclusion I can
make
Post by Alexander Sirotkin [at Yahoo]
from summary.aov (for instance, to answer a
question
Post by Alexander Sirotkin [at Yahoo]
if physician is a significant variable) will not
be
Post by Alexander Sirotkin [at Yahoo]
correct ?
Summary.aov is for summarizing aov objects, so
you're lucky to get
something that is sensible at all. You should use
anova() to get
analysis of variance tables. These are sequential so
that you can use
them (give or take some quibbles about the residual
variance) for
reducing the model from the "bottom up". I.e. if you
place "physician"
last, you get the F test for whether that variable
is significant.
However, a more convenient way of getting that
result is to use
drop1(). Even then there's no simple relation to the
two
t-tests, except that the F test tests the hypothesis
that *both*
coefficients are zero, where the t-tests do so
individually.
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Dear Spencer and Alexander,
In this case, physician is apparently a factor
with
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
three levels, so
summary.aov() gives you a sequential ANOVA,
equivalent to what you'd get
from anova(). There no simple relationship
between
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
the F-statistic for
physician, which has 2 df in the numerator, and
the
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
two t's. (By the way, I
doubt whether a sequential ANOVA is what's
wanted
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
here.)
Regards,
John
At 09:17 AM 12/6/2003 -0800, Spencer Graves
Post by Spencer Graves
The square of a Student's t with "df"
degrees
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
of freedom is an F
Post by Spencer Graves
distribution with 1 and "df" degrees of
freedom.
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
hope this helps. spencer graves
Post by Alexander Sirotkin [at Yahoo]
I have a simple linear model (fitted with
lm())
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
with 2
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
independant
variables : one categorical and one integer.
When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical
variable
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
has to be
converted into many indicator variables) which
looks
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Estimate Std. Error t value
Pr(>|t|)
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
(Intercept) -3595.3 2767.1 -1.299
0.2005
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physicianB 802.0 2289.5 0.350
0.7277
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physicianC 4906.8 2419.8 2.028
0.0485 *
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
severity 7554.4 906.3 8.336
1.12e-10
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
***
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
and when I run summary.aov() I get similar
ANOVA
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
table
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Df Sum Sq Mean Sq F value
Pr(>F)
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physician 2 294559803 147279901 3.3557
0.04381
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
*
severity 1 3049694210 3049694210 69.4864
1.124e-10
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
***
Residuals 45 1975007569 43889057
What is absolutely unclear to me is how
F-value
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
and
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Pr(>F) for the
categorical "physician" variable of the
summary.aov()
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
is calculated
from the t-value of the summary.lm() table.
I looked at the summary.aov() source code but
still
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
could not figure
it.
Thanks a lot.
__________________________________
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox

Prof Brian Ripley
2003-12-07 12:57:10 UTC
Permalink
Post by Alexander Sirotkin [at Yahoo]
John,
What you are saying is that any conclusion I can make
from summary.aov (for instance, to answer a question
if physician is a significant variable) will not be
correct ?
If that is your question *both* are incorrect. The correct function to
use is drop1() (or equivalently Anova from car with the right options).

For a detailed comparison of two t tests and the F test (for a term fitted
last) see Largey & Spencer (1996) _The Statistician_ 45, 105-9.

Once again, aov() and its methods are designed for classical AoV problems
which are balanced and in which sequential anova (as implemented here,
that is with a common denominator) is appropriate and interpreting
coefficients (as in summary.lm) is not.
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Dear Spencer and Alexander,
In this case, physician is apparently a factor with
three levels, so
summary.aov() gives you a sequential ANOVA,
equivalent to what you'd get
from anova(). There no simple relationship between
the F-statistic for
physician, which has 2 df in the numerator, and the
two t's. (By the way, I
doubt whether a sequential ANOVA is what's wanted
here.)
Regards,
John
Post by Spencer Graves
The square of a Student's t with "df" degrees
of freedom is an F
Post by Spencer Graves
distribution with 1 and "df" degrees of freedom.
hope this helps. spencer graves
Post by Alexander Sirotkin [at Yahoo]
I have a simple linear model (fitted with lm())
with 2
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
independant
variables : one categorical and one integer.
When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical
variable
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
has to be
converted into many indicator variables) which
looks
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3595.3 2767.1 -1.299 0.2005
physicianB 802.0 2289.5 0.350 0.7277
physicianC 4906.8 2419.8 2.028 0.0485 *
severity 7554.4 906.3 8.336 1.12e-10
***
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
and when I run summary.aov() I get similar ANOVA
table
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Df Sum Sq Mean Sq F value
Pr(>F)
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physician 2 294559803 147279901 3.3557
0.04381
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
*
severity 1 3049694210 3049694210 69.4864
1.124e-10
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
***
Residuals 45 1975007569 43889057
What is absolutely unclear to me is how F-value
and
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Pr(>F) for the
categorical "physician" variable of the
summary.aov()
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
is calculated
from the t-value of the summary.lm() table.
I looked at the summary.aov() source code but
still
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
could not figure
it.
Thanks a lot.
__________________________________
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
-----------------------------------------------------
Post by John Fox
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
Alexander Sirotkin [at Yahoo]
2003-12-16 21:52:27 UTC
Permalink
Thanks a lot to everybody. Two more questions, if you
don't mind :

How anova() treats non-categorical variables, such as
severity in my case ? I was under impression that
ANOVA is defined for categorical variables only.

I read about drop1() and I understand that it performs
F-test for nested models, correct me if I'm wrong. It
is unclear to me, however, how it manages to do this
F-test for interactions ?

Thanks a lot.
"Alexander Sirotkin [at Yahoo]"
Post by Alexander Sirotkin [at Yahoo]
John,
What you are saying is that any conclusion I can
make
Post by Alexander Sirotkin [at Yahoo]
from summary.aov (for instance, to answer a
question
Post by Alexander Sirotkin [at Yahoo]
if physician is a significant variable) will not
be
Post by Alexander Sirotkin [at Yahoo]
correct ?
Summary.aov is for summarizing aov objects, so
you're lucky to get
something that is sensible at all. You should use
anova() to get
analysis of variance tables. These are sequential so
that you can use
them (give or take some quibbles about the residual
variance) for
reducing the model from the "bottom up". I.e. if you
place "physician"
last, you get the F test for whether that variable
is significant.
However, a more convenient way of getting that
result is to use
drop1(). Even then there's no simple relation to the
two
t-tests, except that the F test tests the hypothesis
that *both*
coefficients are zero, where the t-tests do so
individually.
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Dear Spencer and Alexander,
In this case, physician is apparently a factor
with
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
three levels, so
summary.aov() gives you a sequential ANOVA,
equivalent to what you'd get
from anova(). There no simple relationship
between
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
the F-statistic for
physician, which has 2 df in the numerator, and
the
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
two t's. (By the way, I
doubt whether a sequential ANOVA is what's
wanted
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
here.)
Regards,
John
At 09:17 AM 12/6/2003 -0800, Spencer Graves
Post by Spencer Graves
The square of a Student's t with "df"
degrees
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
of freedom is an F
Post by Spencer Graves
distribution with 1 and "df" degrees of
freedom.
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
hope this helps. spencer graves
Post by Alexander Sirotkin [at Yahoo]
I have a simple linear model (fitted with
lm())
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
with 2
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
independant
variables : one categorical and one integer.
When I run summary.lm() on this model, I get a
standard linear
regression summary (in which one categorical
variable
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
has to be
converted into many indicator variables) which
looks
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Estimate Std. Error t value
Pr(>|t|)
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
(Intercept) -3595.3 2767.1 -1.299
0.2005
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physicianB 802.0 2289.5 0.350
0.7277
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physicianC 4906.8 2419.8 2.028
0.0485 *
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
severity 7554.4 906.3 8.336
1.12e-10
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
***
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
and when I run summary.aov() I get similar
ANOVA
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
table
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Df Sum Sq Mean Sq F value
Pr(>F)
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
physician 2 294559803 147279901 3.3557
0.04381
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
*
severity 1 3049694210 3049694210 69.4864
1.124e-10
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
***
Residuals 45 1975007569 43889057
What is absolutely unclear to me is how
F-value
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
and
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
Pr(>F) for the
categorical "physician" variable of the
summary.aov()
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
is calculated
from the t-value of the summary.lm() table.
I looked at the summary.aov() source code but
still
Post by Spencer Graves
Post by Alexander Sirotkin [at Yahoo]
could not figure
it.
Thanks a lot.
__________________________________
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Post by John Fox
Post by Spencer Graves
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
-----------------------------------------------------
Post by Alexander Sirotkin [at Yahoo]
Post by John Fox
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------
Post by Alexander Sirotkin [at Yahoo]
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
--
O__ ---- Peter Dalgaard Blegdamsvej
3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark
Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)
FAX: (+45) 35327907
Loading...