Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How can I change 0's in the data set to do a LOG with base 2?

I'm analyzing a large data set (80 columns, 800 rows) and some of my values
are 0, but I need to find out how to incoporate/exclude them, because I need
to do a Log with a base 2 on each value in all 80 categories. I'm trying to
calculate the Shannon-Wiener Index on each column (if that helps).

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default How can I change 0's in the data set to do a LOG with base 2?

Hi,

Does the following help ...

=IF(ISERROR(LOG(A1,2)),"",LOG(A1,2))

HTH
Carim

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 266
Default How can I change 0's in the data set to do a LOG with base 2?

"j_erussell01" skrev i en
meddelelse ...
I'm analyzing a large data set (80 columns, 800 rows) and some of my
values
are 0, but I need to find out how to incoporate/exclude them, because I
need
to do a Log with a base 2 on each value in all 80 categories. I'm trying
to
calculate the Shannon-Wiener Index on each column (if that helps).


I'm not an expert on Shannon-Wiener Index, but is it not supposed
to use the *number* of individuals in a species relative to the
entire population, not the individual itself?

My understanding is, that you have a column of numbers and
you need to know the total amount of numbers, how many different
numbers are present and how many of each in order to calculate the index.

Please bear with me, if I haven't understood, what you're trying to
accomplish.


--
Best regards
Leo Heuser

Followup to newsgroup only please.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 418
Default How can I change 0's in the data set to do a LOG with base 2?

j_erussell01 wrote:
I'm analyzing a large data set (80 columns, 800 rows) and some of my values
are 0, but I need to find out how to incoporate/exclude them, because I need
to do a Log with a base 2 on each value in all 80 categories. I'm trying to
calculate the Shannon-Wiener Index on each column (if that helps).


I know nothing about the Shannon-Wiener index beyond what I just read
on a wikipedia.org web page. But my understanding is that it is
computed using LN(), not LOG(...,2).

In either case, your problem is the same. That is, I think you want to
compute -SUM(p[i]*LN(p[i]), i=1,...,S), and you need to avoid the error
caused by evaluating LN(0)

One solution is the following array formula (enter using
ctrl-shift-Enter):

=-sumproduct(A1:CB800, if(A1:CB800<=0, 0, ln(A1:CB800)))

Someone else might be able to provide a SUMPRODUCT() formula that does
not require an array formula. But the IF() function seems necessary to
avoid evaluating LN(0).

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel references change when importing data jimithing1980 Excel Discussion (Misc queries) 1 July 17th 06 05:02 PM
ranking query JaimeTimbrell Excel Discussion (Misc queries) 2 February 16th 06 08:09 AM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
pivot table with selection values not included in the base data confused Charts and Charting in Excel 0 June 21st 05 02:42 PM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 05:55 PM


All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"