Take the 2-minute tour ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.
lme.1.combo <- lme(ComboRate ~ p_w, random = ~1 | Rat,data=x)

The line above will return a fitted intercept term, and a fitted beta (slope) term given these variables (allowing for random intercepts for each rat).

What I would like to do, is run the same regression, but with a FIXED slope. That is, if I keep the slope at a given value, what is the best fitting intercept going to be? So my output would be the best intercept value, given the slope value I assigned.

Is there a way to do this using lme or any other function in R?

share|improve this question

1 Answer 1

Yes. If you know that the slope is, for example, 1.5, then you just subtract 1.5 * p_w from the outcome and refit the model with just the intercept term. So, in your example:

x$ComboRate.adj <- x$ComboRate - 1.5 * x$p_w
lme.2.combo <- lme(ComboRate.adj ~ 1, random = ~1 | Rat,data=x)

This is the same as using an offset in your model.

To check that this works, first try using the actual slope estimate you got from the lme.1.combo model to make sure you get the same intercept estimate from the offset model.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.