Quantcast

Bimodal distribution

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bimodal distribution

Samor Gandhi
Hello,

Is there any test  for bimodality in R that

x <- c(rnorm(1000,0,1),rnorm(1000,3,1))
hist(x,nclass=100)

Thank you in advance for any help.

Regards,
Samor


     
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bimodal distribution

Ingmar Visser
Samor,

A somewhat indirect answer: you could fit a mixture distribution to your
data and test
how many components are needed to best describe your data.

hth, Ingmar


On Wed, Feb 24, 2010 at 1:22 PM, Samor Gandhi <[hidden email]> wrote:

> Hello,
>
> Is there any test  for bimodality in R that
>
> x <- c(rnorm(1000,0,1),rnorm(1000,3,1))
> hist(x,nclass=100)
>
> Thank you in advance for any help.
>
> Regards,
> Samor
>
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [hidden email] mailing list
> 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.
>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bimodal distribution

Samor Gandhi
Hi Ingmar,

Thank you for your reply! How to fit a mixture distribution to the data, do you mean by using mixed model?

Regards,
Samor

--- On Wed, 24/2/10, Ingmar Visser <[hidden email]> wrote:

From: Ingmar Visser <[hidden email]>
Subject: Re: [R] Bimodal distribution
To: "Samor Gandhi" <[hidden email]>
Cc: [hidden email]
Date: Wednesday, 24 February, 2010, 19:14

Samor,

A somewhat indirect answer: you could fit a mixture distribution to your data and test
how many components are needed to best describe your data.

hth, Ingmar


On Wed, Feb 24, 2010 at 1:22 PM, Samor Gandhi <[hidden email]> wrote:

Hello,



Is there any test  for bimodality in R that



x <- c(rnorm(1000,0,1),rnorm(1000,3,1))

hist(x,nclass=100)



Thank you in advance for any help.



Regards,

Samor







        [[alternative HTML version deleted]]




______________________________________________

[hidden email] mailing list

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.







     
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bimodal distribution

Greg Snow-2
In reply to this post by Samor Gandhi
You could use:

library(TeachingDemos)

x <- c(rnorm(1000,0,1),rnorm(1000,3,1))
TeachingDemos:::vis.test( x, TeachingDemos:::vt.normhist )

Then click on the plot that looks most different.

Sorry about needing TeachingDemos::: for now, the functions were accidentally left out of the NAMESPACE file, this has been fixed and will not be needed for version 2.6 on.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[hidden email]
801.408.8111


> -----Original Message-----
> From: [hidden email] [mailto:r-help-bounces@r-
> project.org] On Behalf Of Samor Gandhi
> Sent: Wednesday, February 24, 2010 5:23 AM
> To: [hidden email]
> Subject: [R] Bimodal distribution
>
> Hello,
>
> Is there any test  for bimodality in R that
>
> x <- c(rnorm(1000,0,1),rnorm(1000,3,1))
> hist(x,nclass=100)
>
> Thank you in advance for any help.
>
> Regards,
> Samor
>
>
>
> [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
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.
Loading...