Change treatments to sequential integers

assign.treatments(data)

Arguments

data

input data

Value

dataframe with sequential treatments

Details

Assigns all control treatments the same value, then assigns unique treatments within each site. Each site is required to have a control treatment. The algorithm (incorrectly) assumes that each site has a unique set of experimental treatments. This assumption is required by the data in BETYdb that does not always consistently name treatments or quantity them in the managements table. Also it avoids having the need to estimate treatment by site interactions in the meta analysis model. This model uses data in the control treatment to estimate model parameters so the impact of the assumption is minimal.

Author

David LeBauer, Carl Davidson, Alexey Shiklomanov