Interaction of terms I'm fitting a model using R's glm and I would like to add a term with a particular interaction of variables:
$$
a\frac{K+0.6b}{T+b}
$$
where $K$ and $T$ are columns of data and $a$ and $b$ are constants to be fitted.
The overall model, then, looks like
$$
p=a\frac{K+0.6b}{T+b}+c_1C_1+c_2C_2+\cdots+c_\ell C_\ell
$$
where the $C_i$ are additional columns, the $c_i$ additional constants for the model to fit, and $\frac{1}{1+e^{-p}}$ is the estimate for the binary variable to be predicted.
What kind of analysis is needed to fit this model? Can it be done in R? I can use offset on $T$ and $K$ to ensure that they have no coefficients, and I can use 1 to represent a bare variable like $b$. But, having set $b$, how can I represent the $0.6b$ in the numerator?
 A: This would have been better presented with a test data object but based on your comments (that change the question) you could try using offset() on K and T and I() on your proposed "one" variable:
> dat <- data.frame(Y=1:10, one=1, K=rnorm(10), T=rnorm(10))
> lm(Y~ I( ( offset(T)+0.6*one )/offset(K)+one), data=dat)

Call:
lm(formula = Y ~ I((offset(T) + 0.6 * one)/offset(K) + one), 
    data = dat)

Coefficients:
                               (Intercept)  I((offset(T) + 0.6 * one)/offset(K) + one)  
                                   5.42701                                     0.04631  

That's probably not a complete answer, since it doesn't separately estimate a "b" coefficient for "one", but at least it estimates an "a". Now you can take the methods and see if nls is effective:
> nls(Y~  ( offset(T)+0.6*beta )/( offset(K)+beta), data=dat, start=list(beta=1)
+ )
Nonlinear regression model
  model:  Y ~ (offset(T) + 0.6 * beta)/(offset(K) + beta) 
   data:  dat 
 beta 
2.123 
 residual sum-of-squares: 317.8

Number of iterations to convergence: 12 
Achieved convergence tolerance: 8.603e-06 

I don't think you can add another parameter to that model without creating a singular predictor matrix.
A: This model is nonlinear in $b$, so unless you use a package that will fit generalized nonlinear models, this will force you to resort to fiddling about similar to what you mention (but moreso - and that will still leave you with a number of issues). Given $b$, it's linear in the rest.
The package gnm is an example of a package that can fit generalized nonlinear models in R, but I haven't really used it.
It is possible to sort of deal with it using a sequence of GLMs, maximizing the profile likelihood of $b$, but I'd only head down that path if I couldn't figure out how to get gnm to do it.
