I am analyzing data on stream community before and after an invasive species removal event and have a dataset of dissimilarity values comparing the stream community at each time point in the dataset with the average community pre-removal. I have constructed a model for this dataset dissimilarity ~ cycle + discharge + biomass where cycle is the time of the measurement, discharge is mean stream discharge, and biomass is the biomass of invasive species removed from the stream as a measure of initial invasive community. Each variable is significant, as are the interactions cycle:discharge and cycle:biomass.

I am trying to assess the persistence of removal effects across discharge and biomass. I have the following code that will produce a graph very near what I want using the glht function in the multcomp library.

## create a graph of difference in predicted dissimilarity between cycle 8.2
##  (first post removal time point) with cycle 1
# create a sequence of discharge values
# create a matrix for glht function providing coefficients for the model
#  components (i.e. 0s for unused components, 1*adjustment of the
#  intercept for cycle 8.2, Mean.Q.seq*adjustment of beta Mean.Q:Cycle8.2,
#  average biomass of 4750.5*adjustment of beta Inv.biomass:Cycle8.2)
# use glht to calculate the differences
# calculate the confidence intervals at each discharge value
# create graph
     xlab="Mean discharge",ylab="Predicted Dissimilarity, Cycle 8.1 - Pre-removal average")

My question is whether there is any way to create this graph where the y values are the difference between predicted dissimilarity at cycle 8.2 and the average predicted dissimilarity for pre-removal time points (cycles 1-8.1) such that I can show with the CIs at what range of flow values the community is different from the pre-removal average at this time point? Comparing it to cycle 1 assumes that dissimilarity at cycle 1 is representative of general dissimilarity pre-removal, which is not given.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.