Thread Subject: Statistical Mode of Data

Subject: Statistical Mode of Data

From: Andrew

Date: 16 Mar, 2010 18:20:22

Message: 1 of 8

Hi all

I had found a program somewhere to calculate the Statistical Mode of an array which gave all modes if the array was multimodal but, I can't seem to find it anywhere now. Does anyone know where I could find a program like this or maybe give me some advice so I can start building one myself?

Many Thanks

Andy

Subject: Statistical Mode of Data

From: us

Date: 16 Mar, 2010 18:28:21

Message: 2 of 8

"Andrew " <atb88@msn.com> wrote in message <hnoi56$7ue$1@fred.mathworks.com>...
> Hi all
>
> I had found a program somewhere to calculate the Statistical Mode of an array which gave all modes if the array was multimodal but, I can't seem to find it anywhere now. Does anyone know where I could find a program like this or maybe give me some advice so I can start building one myself?
>
> Many Thanks
>
> Andy

a hint:

     help mode;
% then, carefully look at the 3rd output arg...

us

Subject: Statistical Mode of Data

From: Andrew

Date: 17 Mar, 2010 07:35:20

Message: 3 of 8

"us " <us@neurol.unizh.ch> wrote in message <hnoik5$f11$1@fred.mathworks.com>...
> "Andrew " <atb88@msn.com> wrote in message <hnoi56$7ue$1@fred.mathworks.com>...
> > Hi all
> >
> > I had found a program somewhere to calculate the Statistical Mode of an array which gave all modes if the array was multimodal but, I can't seem to find it anywhere now. Does anyone know where I could find a program like this or maybe give me some advice so I can start building one myself?
> >
> > Many Thanks
> >
> > Andy
>
> a hint:
>
> help mode;
> % then, carefully look at the 3rd output arg...
>
> us
I'm using MATLAB R2007b if that helps. None of the mode functions give more than one mode, the third output argument is [M,F,C]=mode(x)...if the data is multimodal it just gives, for example, C=[2x1 double]. I need a program which calculates all modes for an array. Thanks for your time anyway.

Subject: Statistical Mode of Data

From: us

Date: 17 Mar, 2010 10:10:09

Message: 4 of 8

"Andrew "
> ...the third output argument is [M,F,C]=mode(x)...if the data is multimodal it just gives, for example, C=[2x1 double]...

well... did you LOOK at the content of C(?)...

us

Subject: Statistical Mode of Data

From: Andrew

Date: 17 Mar, 2010 10:24:04

Message: 5 of 8

"us " <us@neurol.unizh.ch> wrote in message <hnq9q1$so4$1@fred.mathworks.com>...
> "Andrew "
> > ...the third output argument is [M,F,C]=mode(x)...if the data is multimodal it just gives, for example, C=[2x1 double]...
>
> well... did you LOOK at the content of C(?)...
>
> us
Yes, but I don't see how this gives me the values of the modes. I see that it gives me how many modes there are,.

Subject: Statistical Mode of Data

From: us

Date: 17 Mar, 2010 10:56:05

Message: 6 of 8

"Andrew " <atb88@msn.com> wrote in message <hnqak4$bn8$1@fred.mathworks.com>...
> "us " <us@neurol.unizh.ch> wrote in message <hnq9q1$so4$1@fred.mathworks.com>...
> > "Andrew "
> > > ...the third output argument is [M,F,C]=mode(x)...if the data is multimodal it just gives, for example, C=[2x1 double]...
> >
> > well... did you LOOK at the content of C(?)...
> >
> > us
> Yes, but I don't see how this gives me the values of the modes. I see that it gives me how many modes there are,.

no, this is not true - you obviously didn't look at it...
you seem to waste CSSMers time carelessly - not boding well for your future in this NG...

us

Subject: Statistical Mode of Data

From: Tom Lane

Date: 17 Mar, 2010 13:42:48

Message: 7 of 8

>> > ...the third output argument is [M,F,C]=mode(x)...if the data is
>> > multimodal it just gives, for example, C=[2x1 double]...
>>
>> well... did you LOOK at the content of C(?)...
>>
>> us
> Yes, but I don't see how this gives me the values of the modes. I see that
> it gives me how many modes there are,.

Andrew, C is a cell array because different columns/rows of the input might
have different numbers of modes. You're just looking at a display of the
cell array. Here's how to look inside:

>> [a,b,c] = mode([1 2 2 2 3;1 1 2 3 3],2)
a =
     2
     1
b =
     3
     2
c =
    [ 2]
    [2x1 double]
>> c{2}
ans =
     1
     3

Row 1 has mode 2, and it appears 3 times. Row 2 has the value 1 provided as
its mode in the first output, and it appears 2 times, but the final output
shows that 1 and 3 both qualify as modes.

-- Tom

Subject: Statistical Mode of Data

From: Andrew

Date: 19 Mar, 2010 13:24:04

Message: 8 of 8

Apologies us, I'm not an experienced MATLAB user and all I wanted was a bit of help. Sorry if you think I was being ungrateful.

Tom, thanks for that. I'm still not 100% sure of what I'm doing but I'll keep trying. Thanks again.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
scolding us 17 Mar, 2010 06:59:09
reference us 16 Mar, 2010 14:29:14
array Andrew 16 Mar, 2010 14:24:26
multimodal Andrew 16 Mar, 2010 14:24:26
mode Andrew 16 Mar, 2010 14:24:26
rssFeed for this Thread

Contact us at files@mathworks.com