Message-ID: <CANAWZx-s0jdyB1GcGGYy6mJA71L42e9k-tKxi9cXZaVEM_XhoA@mail.gmail.com>
Date: 2018-01-28T16:43:08Z
From: Blazej Mrozinski
Subject: How to compare two coefficent estimates in a multilevel model?
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]]