(How) Can I fit a dataset with some parameters fit globally? I want to fit some sigmoidal curves that follow the following equation:
bottom+(top-bottom)/(1+10**((logIC50-x)*HillSlope))

the parameters top and bottom should be constant throughout several data sets, the other parameters can vary within some sets depending on the experimental conditions. Is there a way I can globally fit some parameters while fitting others locally? 
If someone could even help me with getting this done in a programming langruage I would be even more happy. I am using Python 2.7 and was programming in R quite some time ago. Thanks a lot!
 A: It is possible to fit some parameters globally and others locally, in a way that allows you to test whether there are differences among parameter values among some conditions (e.g., do IC50 values or Hill coefficients differ among a set of cell lines). In R, you can use the square-bracket indexing feature in the nls package; parameters that are indexed are calculated locally (by indexed group), while others are calculated globally. Peter Dalgaard gives a worked example of how to do this on an R-help page; as he notes, this useful capacity "is rather easily overlooked." It is also demonstrated, perhaps a bit cryptically, at the very bottom of the help page for nls. Part of my answer to another question on non-linear fitting also shows how to use this bracketing feature.
A: One approach is to construct the fitting function like so:
if (data in dataset 1):
    bottom+(top-bottom)/(1+10**((logIC50_1-x)*HillSlope_1)) # "_1"
elif (data in dataset 2):
    bottom+(top-bottom)/(1+10**((logIC50_2-x)*HillSlope_2)) # "_2"
elif (data in dataset 3):
    bottom+(top-bottom)/(1+10**((logIC50_3-x)*HillSlope_3)) # "_3"
else:
    raise Exception('Data was no from a known dataset') # nice to know

