By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,729 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,729 IT Pros & Developers. It's quick & easy.

Calculating some formulas from database data

P: n/a
I am doing a project on beetle diversity and need to calculate a few
diversity indices for a load of data i have collected. I thought that
maybe i could make a program in php to do that for, and save a bit of
time (as well as prevent calculation errors). I imagine this could be
quite a bit of programming but i have dreamweaver to help me.
Now what i have is a MySQL database full of data on beetle diversity
with the following tables:

Date - the date the sample is from
Habitat - one of 9 habitats that i am testing between (ie. grass,
stones, birch woodland, etc)
Replica - ie 'Repeats', there were two replicas for each habitat from
each date (A and B)
Trap number - from each replica there were 6 traps
Species - the species of beetle that was found in the trap (of course
there are often more than one per trap)
Number of Individuals - the number of individuals of that species
found in that trap

What i need to do is calculate Shannon-Weiner, Shannon Equitability
and Margalefs Diversity indices for each replica from each date for
each habitat (the data for the individual traps will be merged
together).
I have an idea of how to do it but what i am stumbling at is how to
create a recordset which will calculate the total number of
individuals for that species from that replica, date & habitat (I) and
calculate the number of different species for that replica, date &
habitat (S). Once i have S and I i should be able to write the formula
in php to create the indices.
Ideally this could be done in a way to allow for each repeating areas
to be assigned so that all of the indices for that habitat (for each
date and replica) could be shown on one page (to save a lot of
clicking).

Anyone know of a good way of going about this, any help will be
greatly appreciated.

Jan 30 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a


On 30 Jan, 15:55, "chris_huh" <chris....@gmail.comwrote:
I am doing a project on beetle diversity and need to calculate a few
diversity indices for a load of data i have collected. I thought that
maybe i could make a program in php to do that for, and save a bit of
time (as well as prevent calculation errors). I imagine this could be
quite a bit of programming but i have dreamweaver to help me.
Now what i have is a MySQL database full of data on beetle diversity
with the following tables:

Date - the date the sample is from
Habitat - one of 9 habitats that i am testing between (ie. grass,
stones, birch woodland, etc)
Replica - ie 'Repeats', there were two replicas for each habitat from
each date (A and B)
Trap number - from each replica there were 6 traps
Species - the species of beetle that was found in the trap (of course
there are often more than one per trap)
Number of Individuals - the number of individuals of that species
found in that trap

What i need to do is calculate Shannon-Weiner, Shannon Equitability
and Margalefs Diversity indices for each replica from each date for
each habitat (the data for the individual traps will be merged
together).
I have an idea of how to do it but what i am stumbling at is how to
create a recordset which will calculate the total number of
individuals for that species from that replica, date & habitat (I) and
calculate the number of different species for that replica, date &
habitat (S). Once i have S and I i should be able to write the formula
in php to create the indices.
Ideally this could be done in a way to allow for each repeating areas
to be assigned so that all of the indices for that habitat (for each
date and replica) could be shown on one page (to save a lot of
clicking).

Anyone know of a good way of going about this, any help will be
greatly appreciated.
Please do NOT multi-post!
Cross-post if you must but DO NOT multi-post!

See: http://www.blakjak.demon.co.uk/mul_crss.htm

Jan 30 '07 #2

P: n/a


On 30 Jan, 16:17, "Captain Paralytic" <paul_laut...@yahoo.comwrote:
On 30 Jan, 15:55, "chris_huh" <chris....@gmail.comwrote:
I am doing a project on beetle diversity and need to calculate a few
diversity indices for a load of data i have collected. I thought that
maybe i could make a program in php to do that for, and save a bit of
time (as well as prevent calculation errors). I imagine this could be
quite a bit of programming but i have dreamweaver to help me.
Now what i have is a MySQL database full of data on beetle diversity
with the following tables:
Date - the date the sample is from
Habitat - one of 9 habitats that i am testing between (ie. grass,
stones, birch woodland, etc)
Replica - ie 'Repeats', there were two replicas for each habitat from
each date (A and B)
Trap number - from each replica there were 6 traps
Species - the species of beetle that was found in the trap (of course
there are often more than one per trap)
Number of Individuals - the number of individuals of that species
found in that trap
What i need to do is calculate Shannon-Weiner, Shannon Equitability
and Margalefs Diversity indices for each replica from each date for
each habitat (the data for the individual traps will be merged
together).
I have an idea of how to do it but what i am stumbling at is how to
create a recordset which will calculate the total number of
individuals for that species from that replica, date & habitat (I) and
calculate the number of different species for that replica, date &
habitat (S). Once i have S and I i should be able to write the formula
in php to create the indices.
Ideally this could be done in a way to allow for each repeating areas
to be assigned so that all of the indices for that habitat (for each
date and replica) could be shown on one page (to save a lot of
clicking).
Anyone know of a good way of going about this, any help will be
greatly appreciated.Please do NOT multi-post!
Cross-post if you must but DO NOT multi-post!

See:http://www.blakjak.demon.co.uk/mul_crss.htm
Sorry, i didnt see the cross-post text box until i had pressed submit

Jan 30 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.