# [R-sig-ME] How to compare two coefficent estimates in a multilevel model?

Blazej Mrozinski blazej.mrozinski at gmail.com
Sun Jan 28 17:43:08 CET 2018

```Greetings,

Could anyone help me in answering the following question:

How can I compare two coefficient estimates from a lme4 or nlme model?

In HLM7 (software I'm more familiar with) such comparisons are evaluated
with χ2 tests. I can't find out what function in lme4, nlme or just base
can do the same.

An imaginary example I'm working with, is a modified sleepstudy dataset -
with two score variables added at level 2. The model being tested is this:

Level1:
Reaction=β0+r

Level2:
β0=γ00+γ01(score1)+γ02(score2)+u0j

I'm looking for a χ2 comparing both level 2 coefficients (or 3+ if there
are more of them)

Here is my modified dataset:

library(lme4)

set.seed(123)
score1=NULL
score2=NULLfor(i in 1:18) {
x1 = rep(sample(1:5, size = 1), 10)
score1 = c(score1, x1)
x2 = rep(sample(1:5, size = 1), 10)
score2 = c(score2, x2)}

sleepstudy\$score1 <- score1
sleepstudy\$score2 <- score2

model <-lmer(Reaction ~ score1 + score2 + (1|Subject), data=sleepstudy)

Best regards,
Blazej Mrozinski

ps. this question was posted on CrossValidated:
https://stats.stackexchange.com/questions/325302/how-to-compare-two-coefficent-estimates-in-a-multilevel-model

[[alternative HTML version deleted]]

```