Re: [R] calculating area of ellipse

2021-05-11 Thread John Fox

Dear Jeff,

I don't think that it would be sensible to claim that it *never* makes 
sense to multiply quantities measured in different units, but rather 
that this would rarely make sense for regression coefficients. James 
might have a justification for finding the area, but it is still, I 
think, reasonable to point out that doing so may be problematic.


With respect to ratios of areas: I apologize if my examples were 
cryptic. Imagine, for example, that the same regression model is fit to 
two groups and joint-confidence ellipse for two coefficients computed 
for each. The ratio of the two areas would reflect the relative 
precision of the estimates in the two groups, which is unaffected by the 
units of measurement of the coefficients. This is also the idea behind 
generalized variance inflation, where the comparison is to a "utopian" 
situation in which the parameters are uncorrelated. For details, see 
help("vif", package="car") and in particular Fox, J. and Monette, G. 
(1992) Generalized collinearity diagnostics. JASA, 87, 178–183.


Best,
 John


On 2021-05-11 10:48 a.m., Jeff Newmiller wrote:

The area is a product, not a ratio. There are certainly examples out there of 
meaningful products of different units, such as distance * force (work) or power 
" time (work).

If you choose to form a ratio with the area as numerator, you could conceivably 
obtain the numerator with force snd distance and then meaningfully form a ratio 
with time (power). So this asserted requirement as to homogeneous units seems 
inaccurate. But without context I don't know if any of this will aid in 
interpretation of variance for the OP.

On May 11, 2021 7:30:22 AM PDT, John Fox  wrote:

Dear Stephen,

On 2021-05-11 10:20 a.m., Stephen Ellison wrote:

In doing meta-analysis of diagnostic accuracy I produce ellipses of

confidence

and prediction intervals in two dimensions.  How can I calculate the


area of

the ellipse in ggplot2 or base R?


There are established formulae for ellipse area, but I am curious: in


a 2-d ellipse with different quantities (eg coefficients for salary and

age) represented by the different dimensions, what does 'area' mean?

I answered James's question narrowly, but the point you raise is
correct
-- the area isn't directly interpretable unless the coefficients are
measured in the same units.

It still may be possible to compare areas of ellipsoids for, say,
different regressions with the same predictors, as ratios, however,
since these ratios would be unaffected by rescaling the coefficients.
The generalization of this idea to ellipsoids of any dimension is the
basis for the generalized variance-inflation factors computed by the
vif() function in the car package.

Best,
  John

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/



S


***
This email and any attachments are confidential. Any

use...{{dropped:8}}


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide

http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-11 Thread Michael Dewey

Dear Stephen

In that application the axes would be sensitivity and specificity (or 
their inverses) or some transformation of them like logits so the units 
would be the same. Whether the area has any scientific meaning I am not 
sure.


Michael

On 11/05/2021 15:20, Stephen Ellison wrote:

In doing meta-analysis of diagnostic accuracy I produce ellipses of confidence
and prediction intervals in two dimensions.  How can I calculate the area of
the ellipse in ggplot2 or base R?


There are established formulae for ellipse area, but I am curious: in a 2-d 
ellipse with different quantities (eg coefficients for salary and age) 
represented by the different dimensions, what does 'area' mean?

S


***
This email and any attachments are confidential. Any u...{{dropped:13}}


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-11 Thread Jeff Newmiller
The area is a product, not a ratio. There are certainly examples out there of 
meaningful products of different units, such as distance * force (work) or 
power " time (work).

If you choose to form a ratio with the area as numerator, you could conceivably 
obtain the numerator with force snd distance and then meaningfully form a ratio 
with time (power). So this asserted requirement as to homogeneous units seems 
inaccurate. But without context I don't know if any of this will aid in 
interpretation of variance for the OP.

On May 11, 2021 7:30:22 AM PDT, John Fox  wrote:
>Dear Stephen,
>
>On 2021-05-11 10:20 a.m., Stephen Ellison wrote:
>>> In doing meta-analysis of diagnostic accuracy I produce ellipses of 
>confidence
>>> and prediction intervals in two dimensions.  How can I calculate the
>
>area of
> >> the ellipse in ggplot2 or base R?
> >
>> There are established formulae for ellipse area, but I am curious: in
>
>a 2-d ellipse with different quantities (eg coefficients for salary and
>
>age) represented by the different dimensions, what does 'area' mean?
>
>I answered James's question narrowly, but the point you raise is
>correct 
>-- the area isn't directly interpretable unless the coefficients are 
>measured in the same units.
>
>It still may be possible to compare areas of ellipsoids for, say, 
>different regressions with the same predictors, as ratios, however, 
>since these ratios would be unaffected by rescaling the coefficients. 
>The generalization of this idea to ellipsoids of any dimension is the 
>basis for the generalized variance-inflation factors computed by the 
>vif() function in the car package.
>
>Best,
>  John
>
>John Fox, Professor Emeritus
>McMaster University
>Hamilton, Ontario, Canada
>web: https://socialsciences.mcmaster.ca/jfox/
>
> >
> > S
> >
> >
> > ***
>> This email and any attachments are confidential. Any
>use...{{dropped:8}}
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide 
>http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-11 Thread John Fox

Dear Stephen,

On 2021-05-11 10:20 a.m., Stephen Ellison wrote:
>> In doing meta-analysis of diagnostic accuracy I produce ellipses of 
confidence
>> and prediction intervals in two dimensions.  How can I calculate the 
area of

>> the ellipse in ggplot2 or base R?
>
> There are established formulae for ellipse area, but I am curious: in 
a 2-d ellipse with different quantities (eg coefficients for salary and 
age) represented by the different dimensions, what does 'area' mean?


I answered James's question narrowly, but the point you raise is correct 
-- the area isn't directly interpretable unless the coefficients are 
measured in the same units.


It still may be possible to compare areas of ellipsoids for, say, 
different regressions with the same predictors, as ratios, however, 
since these ratios would be unaffected by rescaling the coefficients. 
The generalization of this idea to ellipsoids of any dimension is the 
basis for the generalized variance-inflation factors computed by the 
vif() function in the car package.


Best,
 John

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/

>
> S
>
>
> ***
> This email and any attachments are confidential. Any use...{{dropped:8}}
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-11 Thread Stephen Ellison
> In doing meta-analysis of diagnostic accuracy I produce ellipses of confidence
> and prediction intervals in two dimensions.  How can I calculate the area of
> the ellipse in ggplot2 or base R?

There are established formulae for ellipse area, but I am curious: in a 2-d 
ellipse with different quantities (eg coefficients for salary and age) 
represented by the different dimensions, what does 'area' mean?

S


***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-07 Thread Jim Lemon
Hi John,
Thanks for that. An education for me and my advice to use "str" to
check for the radii in the return value
 was clearly mistaken.

Jim

On Sat, May 8, 2021 at 2:15 AM John Fox  wrote:
>
> Dear David and Jim,
>
> As I explained yesterday, a confidence ellipse is based on a quadratic
> form in the inverse of the covariance matrix of the estimated
> coefficients. When the coefficients are uncorrelated, the axes of the
> ellipse are parallel to the parameter axes, and the radii of the ellipse
> are just a constant times the inverses of the standard deviations of the
> coefficients. The constant is typically the square root of twice a
> corresponding quantile (say, 0.95) of an F distribution with 2 numerator
> df, or a quantile of the chi-square distribution with 2 df.
>
> In the more general case, the confidence ellipse is tilted, and the
> radii correspond to the square roots of the eigenvalues of the
> coefficient covariance matrix, again multiplied by a constant. That
> explains the result I gave yesterday based on the determinant of the
> coefficient covariance matrix, which is the product of its eigenvalues.
>
> These results generalize readily to ellipsoids in higher dimensions, and
> to degenerate cases, such as perfectly correlated coefficients.
>
> For more on the statistics of ellipses, see
> .
>
> Best,
>   John
>
> John Fox, Professor Emeritus
> McMaster University
> Hamilton, Ontario, Canada
> web: https://socialsciences.mcmaster.ca/jfox/
>
> On 2021-05-06 10:31 p.m., David Winsemius wrote:
> >
> > On 5/6/21 6:29 PM, Jim Lemon wrote:
> >> Hi James,
> >> If the result contains the major (a) and minor (b) axes of the
> >> ellipse, it's easy:
> >>
> >> area<-pi*a*b
> >
> >
> > ITYM semi-major and semi-minor axes.
> >
> >

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-07 Thread John Fox

Dear David and Jim,

As I explained yesterday, a confidence ellipse is based on a quadratic 
form in the inverse of the covariance matrix of the estimated 
coefficients. When the coefficients are uncorrelated, the axes of the 
ellipse are parallel to the parameter axes, and the radii of the ellipse 
are just a constant times the inverses of the standard deviations of the 
coefficients. The constant is typically the square root of twice a 
corresponding quantile (say, 0.95) of an F distribution with 2 numerator 
df, or a quantile of the chi-square distribution with 2 df.


In the more general case, the confidence ellipse is tilted, and the 
radii correspond to the square roots of the eigenvalues of the 
coefficient covariance matrix, again multiplied by a constant. That 
explains the result I gave yesterday based on the determinant of the 
coefficient covariance matrix, which is the product of its eigenvalues.


These results generalize readily to ellipsoids in higher dimensions, and 
to degenerate cases, such as perfectly correlated coefficients.


For more on the statistics of ellipses, see 
.


Best,
 John

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/

On 2021-05-06 10:31 p.m., David Winsemius wrote:


On 5/6/21 6:29 PM, Jim Lemon wrote:

Hi James,
If the result contains the major (a) and minor (b) axes of the
ellipse, it's easy:

area<-pi*a*b



ITYM semi-major and semi-minor axes.




__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-06 Thread David Winsemius



On 5/6/21 6:29 PM, Jim Lemon wrote:

Hi James,
If the result contains the major (a) and minor (b) axes of the
ellipse, it's easy:

area<-pi*a*b



ITYM semi-major and semi-minor axes.


--

David



try using str() on the result you get.

Jim

On Fri, May 7, 2021 at 3:51 AM james meyer  wrote:

In doing meta-analysis of diagnostic accuracy I produce ellipses of confidence
and prediction intervals in two dimensions.  How can I calculate the area of
the ellipse in ggplot2 or base R?

thank you
James Meyer

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-06 Thread Jim Lemon
Hi James,
If the result contains the major (a) and minor (b) axes of the
ellipse, it's easy:

area<-pi*a*b

try using str() on the result you get.

Jim

On Fri, May 7, 2021 at 3:51 AM james meyer  wrote:
>
> In doing meta-analysis of diagnostic accuracy I produce ellipses of confidence
> and prediction intervals in two dimensions.  How can I calculate the area of
> the ellipse in ggplot2 or base R?
>
> thank you
> James Meyer
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] calculating area of ellipse

2021-05-06 Thread John Fox

Dear James,

To mix notation a bit, presumably the (border of the) confidence ellipse 
is of the form (b - beta)'V(b)^-1 (b - beta) = c, where V(b) is the 
covariance matrix of b and c is a constant. Then the area of the ellipse 
is pi*c^2*sqrt(det(V(b))). It shouldn't be hard to translate that into R 
code.


I hope this helps,
 John

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/

John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/

On 2021-05-06 7:24 a.m., james meyer wrote:

In doing meta-analysis of diagnostic accuracy I produce ellipses of confidence
and prediction intervals in two dimensions.  How can I calculate the area of
the ellipse in ggplot2 or base R?

thank you
James Meyer

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] calculating area of ellipse

2021-05-06 Thread james meyer
In doing meta-analysis of diagnostic accuracy I produce ellipses of confidence
and prediction intervals in two dimensions.  How can I calculate the area of
the ellipse in ggplot2 or base R?

thank you
James Meyer

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.