This message contains some R code that some of you may find useful.
Previously, I emailed some R code to various people that I knew were
doing soil feedback studies. However, I began to realize that other
people (e.g. plant competition folks, etc.) might benefit from
seeing/using the code to estimate relative interaction intensity (RII)
[or something else] with a resampling (bootstrapping) approach. The
code is relatively simple so not worthy of a paper but something that is
still worth sharing. You can decide.
Pasted email-
I'm a bit of a newbie with R but after beating my head against a wall
for a couple of days made a (minor to R experts) breakthrough that I
thought was worth sharing. The R code estimates a soil feedback
parameter (RII [relative interaction intensity {Armas et al Ecology
2004}]) and its confidence intervals using a bootstrapping procedure in
R. You can change this equation to something else if you wish. You
should be able to paste it into R and have it work as a trial as written
(you may need to download the boot library 1st if you don't already have
it). You can then adapt it as needed by changing the city, x and u
names to fit your own dataset. Enjoy!
I derived it mostly from here-
http://stat.ethz.ch/R-manual/R-patched/library/boot/html/boot.ci.html
A statistician reviewed and approved it so it should work as expected.
Feel free to share it with others. If you make any useful changes then
please let me know.
Cheers, Kurt
# lets you see city dataset so that you can understand its simple
structure
city
library(boot)
# makes RII calculation for city dataset which has two columns of data
# imagine column U being equivalent to a column of biomass data when
plants
# are grown in soil A and X equivalent to a column of biomass data when
plants
# were grown in soil B
# confidence intervals for the city data
RII <- function(d, w) (mean(d$x * w) - mean(d$u * w))/(mean(d$x * w) +
mean(d$u * w))
boot(city, RII, R=999, stype = "w")
city.boot <- boot(city, RII, R = 999, stype = "w", sim = "ordinary")
boot.ci(city.boot, conf = c(0.90,0.95),
type = c("norm","basic","perc","bca"))
___________________________________________
Kurt Reinhart, Ecologist
USDA-Agricultural Research Service
Fort Keogh Livestock & Range Research Laboratory
<http://www.ars.usda.gov/Main/docs.htm?docid=3087>
243 Fort Keogh Rd.
Miles City, MT 59301
Ph: (406) 874-8219
Email: [email protected]
Personal educational website: http://www.iecology.net/