By the way, the model you have fit is not a varying slope model because
temperature is a factor.

> str(cake)
'data.frame': 270 obs. of  5 variables:
 $ replicate  : Factor w/ 15 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 1
...
 $ recipe     : Factor w/ 3 levels "A","B","C": 1 1 1 1 1 1 2 2 2 2 ...
 $ temperature: Ord.factor w/ 6 levels "175"<"185"<"195"<..: 1 2 3 4 5 6 1
2 3 4 ...
 $ angle      : int  42 46 47 39 53 42 39 46 51 49 ...
 $ temp       : num  175 185 195 205 215 225 175 185 195 205 ...

If you want the varying intercept and varying slope model use

lmer(angle ~ temp + (temp|recipe), cake)



On Tue, Jun 18, 2013 at 11:18 AM, Douglas Bates <bates@stat.wisc.edu> wrote:

> On Tue, Jun 18, 2013 at 10:43 AM, Ross Ahmed <rossahmed@googlemail.com>wrote:
>
>> I靶e made this varying intercept and varying slope model:
>>
>> lmer(angle ~ temperature + (temperature | recipe), data=cake)
>>
>> I two questions:
>> 1. Does this code made exactly the same model as above: lmer(angle ~
>> temperature + (1 + temperature | recipe), data=cake)?
>>
>
> Yes.  As a linear model formula
>
> temperature
>
> is equivalent to
>
> 1 + temperature.
>
> If you wanted to get the indicators for the levels of temperature instead
> you suppress the intercept term using
>
> 0 + temperature
>
> or
>
> temperature - 1
>
> I prefer the first form.
>
>
>> 2. Why does temperature have L, Q, C, ^4 and ^5 in the output?
>>
>
> temperature is an ordered factor and the default contrasts for an ordered
> factor are orthogonal polynomial contrasts.
>

	[[alternative HTML version deleted]]

