Hello all. I am wondering if it is possible to fix some parameters within a
glm(), lmer(), or lme() routine, but leave others to be optimized.  I want
to assess what the values for the "free" parameters would be as well as the
overall model fit when using the fixed and free parameters in conjunction.
For example, I specify the model: 

 

glm(data$log10(N) ~ log10(data$Mass) + log10(data$Temp) +
log10(data$Precipitation) + data$DIET) 

 

where all variables are continuous except DIET, which is categorical.  The
output is the set of optimized coefficients that in the mathematical formula
would precede the predictor variables (i.e. in log10 space:  N ~ a*Mass +
b*Temp + c*Precipitation + {d,e,f,g}*DIET ).  So parameters a,b,c,d,e,f,g
are being optimized to achieve the best model fit possible.

 

I am also trying the mixed effects model

 

lmer(log10(N) ~ log10(Mass) + log10(Temp) + log10(Precipitation) + DIET +
1|SpeciesID, data= data, REML=T) 

 

The interest is still in the coefficients described above, but now
accounting for speciesID as a random variable.

 

Now what I want to do is to fix a couple of the parameters while solving for
the rest. So, in the simple model (in log10 space):

 

N ~ a*Mass + b*Temp + c*Precipitation + {d,e,f,g}*DIET

 

I want to force a =1 and b= -1, yielding:

 

N ~ 1*Mass + (-1)*Temp + c*Precipitation + {d,e,f,g}*DIET

 

and then see what the values of the other parameters (c-g) turn out to be,
as well as the model fit when using the forced parameters in conjunction
with the free parameters.

 

Is there a way to do this using the glm() and lmer() or lme() routines? I
know how to write R script to do a simple maximum likelihood routine in R
that would maximize the log likelihood to optimize parameters, but only
using all continuous predictors.  Adding a categorical predictor, then
moving on to mixed effects models puts the writing it up in R out of my
league.  Any suggestions on how to do this are heartily welcome. I spent
some time looking through the source code for the lmer routine, trying to
find where parameters for the model are defined and then where they are
optimized but I must admit it was overwhelming and I have no hope of being
able to manipulate the source code to do what I need. Thanks!!

 

Regards,

 

Hamish Wilman

UC San Diego

hwilman@ucsd.edu

 


	[[alternative HTML version deleted]]

