-1
$\begingroup$

I would like to know whether it is possible to do multilevel modelling with variables that have different number of trials. To be more specific, let's say we have x(a), y(a), x(b), y(b) variables. x(a) and y(a) have 100 trials, and x(b) and y(b) have 200 trials. So it's like having two different tasks that were solved by the same participants.

Now I want to build a model where y(a) is predicted by x(a), and y(b) is predicted by x(b), and where subject random effects from both are extracted (for a and b) as latent variables and used for further modelling.

An example of model

How to prepare a dataset for such modeling, e.g. in MPlus? One idea was to leave the 100 trials per person for a simply empty, but I don't know where to start from...

$\endgroup$

1 Answer 1

0
$\begingroup$

Yes, that's possible (if I understand you correctly). Some packages can make this simple, with some it may be harder. One simple way is to "explode" your matrix into single trials like this,

subject | test | trial | success
--- | --- | --- | ---
123 | A | 45 | 1
110 | B | 40 | 0
100 | B | 40 | 1
100 | A | 40 | 0

Then you model this as a simple logistic regression. The formula with glmer in R is then

glmer(success ~ 1 + (1 | subject) + test, family = "binomial").

$\endgroup$
2
  • $\begingroup$ I am sorry to reply now, but I somehow missed the answer. First, I think in glmer it should be glmer(sucess ~ 1 + test + (1+test | subject). If you don't specify the test in random effects you get only random effects around the main intercept (test a), but not around the intercept for test b. But do you have any idea, how I could do this in Mplus? $\endgroup$
    – User33268
    Commented Jan 9, 2018 at 11:09
  • $\begingroup$ Sure, and, no, no idea.. ! $\endgroup$
    – Gijs
    Commented Jan 9, 2018 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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