In mixed effect models, how account for grouped random effects?Group level random effectAllowed comparisons...

Cookies - Should the toggles be on?

Why would space fleets be aligned?

Has any human ever had the choice to leave Earth permanently?

Is subjunctive always used in the attributive clause of a superlative expression?

Dilemma of explaining to interviewer that he is the reason for declining second interview

How to tell if a BJT is PNP or NPN by looking at the circuit?

Workflow Comment popup does not show up

How to play electric guitar and bass as a duet

Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?

How to deal with possible delayed baggage?

Is it a fallacy if someone claims they need an explanation for every word of your argument to the point where they don't understand common terms?

A Missing Symbol for This Logo

Why do neural networks need so many training examples to perform?

How should I handle players who ignore the session zero agreement?

Why is working on the same position for more than 15 years not a red flag?

What is the purpose of easy combat scenarios that don't need resource expenditure?

How can prove this integral

Does Skippy chunky peanut butter contain trans fat?

What sets the resolution of an analog resistive sensor?

Consequences of lack of rigour

Is Krishna the only avatar among dashavatara who had more than one wife?

If I delete my router's history can my ISP still provide it to my parents?

Non-Cancer terminal illness that can affect young (age 10-13) girls?

Absorbing damage with Planeswalker



In mixed effect models, how account for grouped random effects?


Group level random effectAllowed comparisons of mixed effects models (random effects primarily)Mixed effect logistic regression in R: choosing random effectsNested data analysis using nlme: Analysis leaves out factor levelsNested mixed effects with lme4Formula of Linear Mixed Effect ModelTrouble setting up a linear mixed effects modelMixed-effects model for response dataMixed Effects Model, Levels of grouping factor < observationsInterpreting main effect that is significant in some models and not others - Mixed Effects ModelsLinear Mixed Model in R: Rep. Measures, Nested, Random Effects













3












$begingroup$


In my experiment, each subject sees 10 different stimuli and provides one measure for each stimulus. All subjects saw the same stimuli. Among the 10 stimuli, 3 are of category A, 3 of category B, and 4 of category C. I want to model this with lme4 so I wrote:



lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


I am not comfortable with this model because the stimuli are random in the model, and the category is an intrinsic property of them. So it seems that I put twice some information here. How should I model the setting?



This question did not help me:
Group level random effect










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    What is your research question ? Are you interested in the treatment effects of stimulus ? Please edit your question to include the output of str(My_data) and the output of xtabs(~ stimulus + subject, My_data) and xtabs(~ category + subject, My_data) and xtabs(~ category + stimulus, My_data)
    $endgroup$
    – Robert Long
    32 mins ago


















3












$begingroup$


In my experiment, each subject sees 10 different stimuli and provides one measure for each stimulus. All subjects saw the same stimuli. Among the 10 stimuli, 3 are of category A, 3 of category B, and 4 of category C. I want to model this with lme4 so I wrote:



lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


I am not comfortable with this model because the stimuli are random in the model, and the category is an intrinsic property of them. So it seems that I put twice some information here. How should I model the setting?



This question did not help me:
Group level random effect










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    What is your research question ? Are you interested in the treatment effects of stimulus ? Please edit your question to include the output of str(My_data) and the output of xtabs(~ stimulus + subject, My_data) and xtabs(~ category + subject, My_data) and xtabs(~ category + stimulus, My_data)
    $endgroup$
    – Robert Long
    32 mins ago
















3












3








3





$begingroup$


In my experiment, each subject sees 10 different stimuli and provides one measure for each stimulus. All subjects saw the same stimuli. Among the 10 stimuli, 3 are of category A, 3 of category B, and 4 of category C. I want to model this with lme4 so I wrote:



lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


I am not comfortable with this model because the stimuli are random in the model, and the category is an intrinsic property of them. So it seems that I put twice some information here. How should I model the setting?



This question did not help me:
Group level random effect










share|cite|improve this question









$endgroup$




In my experiment, each subject sees 10 different stimuli and provides one measure for each stimulus. All subjects saw the same stimuli. Among the 10 stimuli, 3 are of category A, 3 of category B, and 4 of category C. I want to model this with lme4 so I wrote:



lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


I am not comfortable with this model because the stimuli are random in the model, and the category is an intrinsic property of them. So it seems that I put twice some information here. How should I model the setting?



This question did not help me:
Group level random effect







r mixed-model lme4-nlme






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked 2 hours ago









RtistRtist

1384




1384








  • 1




    $begingroup$
    What is your research question ? Are you interested in the treatment effects of stimulus ? Please edit your question to include the output of str(My_data) and the output of xtabs(~ stimulus + subject, My_data) and xtabs(~ category + subject, My_data) and xtabs(~ category + stimulus, My_data)
    $endgroup$
    – Robert Long
    32 mins ago
















  • 1




    $begingroup$
    What is your research question ? Are you interested in the treatment effects of stimulus ? Please edit your question to include the output of str(My_data) and the output of xtabs(~ stimulus + subject, My_data) and xtabs(~ category + subject, My_data) and xtabs(~ category + stimulus, My_data)
    $endgroup$
    – Robert Long
    32 mins ago










1




1




$begingroup$
What is your research question ? Are you interested in the treatment effects of stimulus ? Please edit your question to include the output of str(My_data) and the output of xtabs(~ stimulus + subject, My_data) and xtabs(~ category + subject, My_data) and xtabs(~ category + stimulus, My_data)
$endgroup$
– Robert Long
32 mins ago






$begingroup$
What is your research question ? Are you interested in the treatment effects of stimulus ? Please edit your question to include the output of str(My_data) and the output of xtabs(~ stimulus + subject, My_data) and xtabs(~ category + subject, My_data) and xtabs(~ category + stimulus, My_data)
$endgroup$
– Robert Long
32 mins ago












3 Answers
3






active

oldest

votes


















2












$begingroup$

If you believe the different categories vary in terms of their measurement and you want to test that, you need to model the category as a random intercept with (1|category).



However, I think we need more information as to what you are actually looking to decide. For example, are you wondering if each person measures them different? Or if each stimulus is measured differently?






share|cite|improve this answer









$endgroup$





















    2












    $begingroup$

    It seems that in the model:



    lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


    category is being used to denote the levels of stimulus. As such, this does not make sense, since category is not an actual variable.



    Even though stimulus is random in the sense that it has (presumably) been randomly assigned to each subject, this does not mean that is should be included as a random effect - unless there is no interest in the treatment effect of stimulus. In that case, you would simply be partitioning variance into the subject level and the stimulus level.



    It seems more likely that you are in fact interested in the associations between each level of the stimulus and the outcome - that is, you are interested in the treatment effect and therefore the model should be of the form:



    measure ~ stimulus + (1|subject)





    share|cite|improve this answer









    $endgroup$









    • 2




      $begingroup$
      Interesting perspective, Robert! If the 10 stimuli are the only ones @Rtist is interested in, then your suggested approach makes sense. But if he only included the 10 stimuli in the study because he is interested in generalizing the findings of the study to all stimuli represented by these 10 items, then stimulus should be treated as a random grouping factor (assuming there are multiple observations for at least some of all the subject by stimulus combinations). It really all depends on the purpose of the study - if we don't know the purpose, we can only speculate about the model set up.
      $endgroup$
      – Isabella Ghement
      1 hour ago












    • $begingroup$
      @IsabellaGhement there are only 3 levels of stimulus, so fitting random effects for it and estimating a variance would not be advisable in my opinion.
      $endgroup$
      – Robert Long
      58 mins ago






    • 1




      $begingroup$
      But the question says each subject sees 10 stimuli and that these 10 stimuli can be categorized into 3 different categories? I am not suggesting stimulus category (3 levels) could be treated as a random grouping factor, but rather stimulus (10 levels). However, if there aren't repeated values of measure for each subject by stimulus combination OR if the research question calls for it (i.e., the 10 stimuli are the only ones @Rtist wants to learn something about), then the option you suggested would work.
      $endgroup$
      – Isabella Ghement
      43 mins ago








    • 1




      $begingroup$
      @IsabellaGhement perhaps I misunderstood the question. I read it that stimulus has 3 levels, not 10. Anyway, we can wait for clarification from @Rtist
      $endgroup$
      – Robert Long
      36 mins ago



















    1












    $begingroup$

    In your setting, subject and stimulus seem to be fully crossed random grouping factors - since each subject sees each stimulus and (I am assuming) you are using the subjects and stimuli included in your studies to represent all the subjects and all the stimuli you wish to generalize your study findings to.



    The key word here is grouping - for your model to be a linear mixed effects model (lmer), each subject by stimulus combination should act like a container which holds together a group of values for your measure outcome. All the values of measure that belong to the same container are more similar to each other than values that belong to different containers, as they are subjected to the same subject-level and stimulus-level influences (presuming these influences are constant over time).



    The group of values in a specific container could arise, for instance, if you record the value of measure at several time points for each subject by stimulus combination, or under two or more different conditions, etc.



    If you only have one value of measure per subject by stimulus combination, then you're dealing with a linear model (lm). There is no grouping of observations according to each subject per stimulus combination, so there are no random grouping factors which means there aren't any effects that can vary randomly across combinations of levels of the grouping factors (i.e., random effects). If there aren't any random effects, there can't be a mixed effects model, as such a model would require both fixed and random effects to be part of it!



    If you do have multiple values of measure per container (i.e., subject by stimulus combination), then your model can include subject-level predictors (e.g., subject gender, subject age) and/or stimulus-level predictors (e.g., stimulus category).






    share|cite|improve this answer











    $endgroup$













      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "65"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f394706%2fin-mixed-effect-models-how-account-for-grouped-random-effects%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2












      $begingroup$

      If you believe the different categories vary in terms of their measurement and you want to test that, you need to model the category as a random intercept with (1|category).



      However, I think we need more information as to what you are actually looking to decide. For example, are you wondering if each person measures them different? Or if each stimulus is measured differently?






      share|cite|improve this answer









      $endgroup$


















        2












        $begingroup$

        If you believe the different categories vary in terms of their measurement and you want to test that, you need to model the category as a random intercept with (1|category).



        However, I think we need more information as to what you are actually looking to decide. For example, are you wondering if each person measures them different? Or if each stimulus is measured differently?






        share|cite|improve this answer









        $endgroup$
















          2












          2








          2





          $begingroup$

          If you believe the different categories vary in terms of their measurement and you want to test that, you need to model the category as a random intercept with (1|category).



          However, I think we need more information as to what you are actually looking to decide. For example, are you wondering if each person measures them different? Or if each stimulus is measured differently?






          share|cite|improve this answer









          $endgroup$



          If you believe the different categories vary in terms of their measurement and you want to test that, you need to model the category as a random intercept with (1|category).



          However, I think we need more information as to what you are actually looking to decide. For example, are you wondering if each person measures them different? Or if each stimulus is measured differently?







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered 2 hours ago









          Craig K. Van PayCraig K. Van Pay

          587




          587

























              2












              $begingroup$

              It seems that in the model:



              lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


              category is being used to denote the levels of stimulus. As such, this does not make sense, since category is not an actual variable.



              Even though stimulus is random in the sense that it has (presumably) been randomly assigned to each subject, this does not mean that is should be included as a random effect - unless there is no interest in the treatment effect of stimulus. In that case, you would simply be partitioning variance into the subject level and the stimulus level.



              It seems more likely that you are in fact interested in the associations between each level of the stimulus and the outcome - that is, you are interested in the treatment effect and therefore the model should be of the form:



              measure ~ stimulus + (1|subject)





              share|cite|improve this answer









              $endgroup$









              • 2




                $begingroup$
                Interesting perspective, Robert! If the 10 stimuli are the only ones @Rtist is interested in, then your suggested approach makes sense. But if he only included the 10 stimuli in the study because he is interested in generalizing the findings of the study to all stimuli represented by these 10 items, then stimulus should be treated as a random grouping factor (assuming there are multiple observations for at least some of all the subject by stimulus combinations). It really all depends on the purpose of the study - if we don't know the purpose, we can only speculate about the model set up.
                $endgroup$
                – Isabella Ghement
                1 hour ago












              • $begingroup$
                @IsabellaGhement there are only 3 levels of stimulus, so fitting random effects for it and estimating a variance would not be advisable in my opinion.
                $endgroup$
                – Robert Long
                58 mins ago






              • 1




                $begingroup$
                But the question says each subject sees 10 stimuli and that these 10 stimuli can be categorized into 3 different categories? I am not suggesting stimulus category (3 levels) could be treated as a random grouping factor, but rather stimulus (10 levels). However, if there aren't repeated values of measure for each subject by stimulus combination OR if the research question calls for it (i.e., the 10 stimuli are the only ones @Rtist wants to learn something about), then the option you suggested would work.
                $endgroup$
                – Isabella Ghement
                43 mins ago








              • 1




                $begingroup$
                @IsabellaGhement perhaps I misunderstood the question. I read it that stimulus has 3 levels, not 10. Anyway, we can wait for clarification from @Rtist
                $endgroup$
                – Robert Long
                36 mins ago
















              2












              $begingroup$

              It seems that in the model:



              lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


              category is being used to denote the levels of stimulus. As such, this does not make sense, since category is not an actual variable.



              Even though stimulus is random in the sense that it has (presumably) been randomly assigned to each subject, this does not mean that is should be included as a random effect - unless there is no interest in the treatment effect of stimulus. In that case, you would simply be partitioning variance into the subject level and the stimulus level.



              It seems more likely that you are in fact interested in the associations between each level of the stimulus and the outcome - that is, you are interested in the treatment effect and therefore the model should be of the form:



              measure ~ stimulus + (1|subject)





              share|cite|improve this answer









              $endgroup$









              • 2




                $begingroup$
                Interesting perspective, Robert! If the 10 stimuli are the only ones @Rtist is interested in, then your suggested approach makes sense. But if he only included the 10 stimuli in the study because he is interested in generalizing the findings of the study to all stimuli represented by these 10 items, then stimulus should be treated as a random grouping factor (assuming there are multiple observations for at least some of all the subject by stimulus combinations). It really all depends on the purpose of the study - if we don't know the purpose, we can only speculate about the model set up.
                $endgroup$
                – Isabella Ghement
                1 hour ago












              • $begingroup$
                @IsabellaGhement there are only 3 levels of stimulus, so fitting random effects for it and estimating a variance would not be advisable in my opinion.
                $endgroup$
                – Robert Long
                58 mins ago






              • 1




                $begingroup$
                But the question says each subject sees 10 stimuli and that these 10 stimuli can be categorized into 3 different categories? I am not suggesting stimulus category (3 levels) could be treated as a random grouping factor, but rather stimulus (10 levels). However, if there aren't repeated values of measure for each subject by stimulus combination OR if the research question calls for it (i.e., the 10 stimuli are the only ones @Rtist wants to learn something about), then the option you suggested would work.
                $endgroup$
                – Isabella Ghement
                43 mins ago








              • 1




                $begingroup$
                @IsabellaGhement perhaps I misunderstood the question. I read it that stimulus has 3 levels, not 10. Anyway, we can wait for clarification from @Rtist
                $endgroup$
                – Robert Long
                36 mins ago














              2












              2








              2





              $begingroup$

              It seems that in the model:



              lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


              category is being used to denote the levels of stimulus. As such, this does not make sense, since category is not an actual variable.



              Even though stimulus is random in the sense that it has (presumably) been randomly assigned to each subject, this does not mean that is should be included as a random effect - unless there is no interest in the treatment effect of stimulus. In that case, you would simply be partitioning variance into the subject level and the stimulus level.



              It seems more likely that you are in fact interested in the associations between each level of the stimulus and the outcome - that is, you are interested in the treatment effect and therefore the model should be of the form:



              measure ~ stimulus + (1|subject)





              share|cite|improve this answer









              $endgroup$



              It seems that in the model:



              lmer(measure ~ category + (1|subject) + (1|stimulus), data = My_data)


              category is being used to denote the levels of stimulus. As such, this does not make sense, since category is not an actual variable.



              Even though stimulus is random in the sense that it has (presumably) been randomly assigned to each subject, this does not mean that is should be included as a random effect - unless there is no interest in the treatment effect of stimulus. In that case, you would simply be partitioning variance into the subject level and the stimulus level.



              It seems more likely that you are in fact interested in the associations between each level of the stimulus and the outcome - that is, you are interested in the treatment effect and therefore the model should be of the form:



              measure ~ stimulus + (1|subject)






              share|cite|improve this answer












              share|cite|improve this answer



              share|cite|improve this answer










              answered 1 hour ago









              Robert LongRobert Long

              10.5k22549




              10.5k22549








              • 2




                $begingroup$
                Interesting perspective, Robert! If the 10 stimuli are the only ones @Rtist is interested in, then your suggested approach makes sense. But if he only included the 10 stimuli in the study because he is interested in generalizing the findings of the study to all stimuli represented by these 10 items, then stimulus should be treated as a random grouping factor (assuming there are multiple observations for at least some of all the subject by stimulus combinations). It really all depends on the purpose of the study - if we don't know the purpose, we can only speculate about the model set up.
                $endgroup$
                – Isabella Ghement
                1 hour ago












              • $begingroup$
                @IsabellaGhement there are only 3 levels of stimulus, so fitting random effects for it and estimating a variance would not be advisable in my opinion.
                $endgroup$
                – Robert Long
                58 mins ago






              • 1




                $begingroup$
                But the question says each subject sees 10 stimuli and that these 10 stimuli can be categorized into 3 different categories? I am not suggesting stimulus category (3 levels) could be treated as a random grouping factor, but rather stimulus (10 levels). However, if there aren't repeated values of measure for each subject by stimulus combination OR if the research question calls for it (i.e., the 10 stimuli are the only ones @Rtist wants to learn something about), then the option you suggested would work.
                $endgroup$
                – Isabella Ghement
                43 mins ago








              • 1




                $begingroup$
                @IsabellaGhement perhaps I misunderstood the question. I read it that stimulus has 3 levels, not 10. Anyway, we can wait for clarification from @Rtist
                $endgroup$
                – Robert Long
                36 mins ago














              • 2




                $begingroup$
                Interesting perspective, Robert! If the 10 stimuli are the only ones @Rtist is interested in, then your suggested approach makes sense. But if he only included the 10 stimuli in the study because he is interested in generalizing the findings of the study to all stimuli represented by these 10 items, then stimulus should be treated as a random grouping factor (assuming there are multiple observations for at least some of all the subject by stimulus combinations). It really all depends on the purpose of the study - if we don't know the purpose, we can only speculate about the model set up.
                $endgroup$
                – Isabella Ghement
                1 hour ago












              • $begingroup$
                @IsabellaGhement there are only 3 levels of stimulus, so fitting random effects for it and estimating a variance would not be advisable in my opinion.
                $endgroup$
                – Robert Long
                58 mins ago






              • 1




                $begingroup$
                But the question says each subject sees 10 stimuli and that these 10 stimuli can be categorized into 3 different categories? I am not suggesting stimulus category (3 levels) could be treated as a random grouping factor, but rather stimulus (10 levels). However, if there aren't repeated values of measure for each subject by stimulus combination OR if the research question calls for it (i.e., the 10 stimuli are the only ones @Rtist wants to learn something about), then the option you suggested would work.
                $endgroup$
                – Isabella Ghement
                43 mins ago








              • 1




                $begingroup$
                @IsabellaGhement perhaps I misunderstood the question. I read it that stimulus has 3 levels, not 10. Anyway, we can wait for clarification from @Rtist
                $endgroup$
                – Robert Long
                36 mins ago








              2




              2




              $begingroup$
              Interesting perspective, Robert! If the 10 stimuli are the only ones @Rtist is interested in, then your suggested approach makes sense. But if he only included the 10 stimuli in the study because he is interested in generalizing the findings of the study to all stimuli represented by these 10 items, then stimulus should be treated as a random grouping factor (assuming there are multiple observations for at least some of all the subject by stimulus combinations). It really all depends on the purpose of the study - if we don't know the purpose, we can only speculate about the model set up.
              $endgroup$
              – Isabella Ghement
              1 hour ago






              $begingroup$
              Interesting perspective, Robert! If the 10 stimuli are the only ones @Rtist is interested in, then your suggested approach makes sense. But if he only included the 10 stimuli in the study because he is interested in generalizing the findings of the study to all stimuli represented by these 10 items, then stimulus should be treated as a random grouping factor (assuming there are multiple observations for at least some of all the subject by stimulus combinations). It really all depends on the purpose of the study - if we don't know the purpose, we can only speculate about the model set up.
              $endgroup$
              – Isabella Ghement
              1 hour ago














              $begingroup$
              @IsabellaGhement there are only 3 levels of stimulus, so fitting random effects for it and estimating a variance would not be advisable in my opinion.
              $endgroup$
              – Robert Long
              58 mins ago




              $begingroup$
              @IsabellaGhement there are only 3 levels of stimulus, so fitting random effects for it and estimating a variance would not be advisable in my opinion.
              $endgroup$
              – Robert Long
              58 mins ago




              1




              1




              $begingroup$
              But the question says each subject sees 10 stimuli and that these 10 stimuli can be categorized into 3 different categories? I am not suggesting stimulus category (3 levels) could be treated as a random grouping factor, but rather stimulus (10 levels). However, if there aren't repeated values of measure for each subject by stimulus combination OR if the research question calls for it (i.e., the 10 stimuli are the only ones @Rtist wants to learn something about), then the option you suggested would work.
              $endgroup$
              – Isabella Ghement
              43 mins ago






              $begingroup$
              But the question says each subject sees 10 stimuli and that these 10 stimuli can be categorized into 3 different categories? I am not suggesting stimulus category (3 levels) could be treated as a random grouping factor, but rather stimulus (10 levels). However, if there aren't repeated values of measure for each subject by stimulus combination OR if the research question calls for it (i.e., the 10 stimuli are the only ones @Rtist wants to learn something about), then the option you suggested would work.
              $endgroup$
              – Isabella Ghement
              43 mins ago






              1




              1




              $begingroup$
              @IsabellaGhement perhaps I misunderstood the question. I read it that stimulus has 3 levels, not 10. Anyway, we can wait for clarification from @Rtist
              $endgroup$
              – Robert Long
              36 mins ago




              $begingroup$
              @IsabellaGhement perhaps I misunderstood the question. I read it that stimulus has 3 levels, not 10. Anyway, we can wait for clarification from @Rtist
              $endgroup$
              – Robert Long
              36 mins ago











              1












              $begingroup$

              In your setting, subject and stimulus seem to be fully crossed random grouping factors - since each subject sees each stimulus and (I am assuming) you are using the subjects and stimuli included in your studies to represent all the subjects and all the stimuli you wish to generalize your study findings to.



              The key word here is grouping - for your model to be a linear mixed effects model (lmer), each subject by stimulus combination should act like a container which holds together a group of values for your measure outcome. All the values of measure that belong to the same container are more similar to each other than values that belong to different containers, as they are subjected to the same subject-level and stimulus-level influences (presuming these influences are constant over time).



              The group of values in a specific container could arise, for instance, if you record the value of measure at several time points for each subject by stimulus combination, or under two or more different conditions, etc.



              If you only have one value of measure per subject by stimulus combination, then you're dealing with a linear model (lm). There is no grouping of observations according to each subject per stimulus combination, so there are no random grouping factors which means there aren't any effects that can vary randomly across combinations of levels of the grouping factors (i.e., random effects). If there aren't any random effects, there can't be a mixed effects model, as such a model would require both fixed and random effects to be part of it!



              If you do have multiple values of measure per container (i.e., subject by stimulus combination), then your model can include subject-level predictors (e.g., subject gender, subject age) and/or stimulus-level predictors (e.g., stimulus category).






              share|cite|improve this answer











              $endgroup$


















                1












                $begingroup$

                In your setting, subject and stimulus seem to be fully crossed random grouping factors - since each subject sees each stimulus and (I am assuming) you are using the subjects and stimuli included in your studies to represent all the subjects and all the stimuli you wish to generalize your study findings to.



                The key word here is grouping - for your model to be a linear mixed effects model (lmer), each subject by stimulus combination should act like a container which holds together a group of values for your measure outcome. All the values of measure that belong to the same container are more similar to each other than values that belong to different containers, as they are subjected to the same subject-level and stimulus-level influences (presuming these influences are constant over time).



                The group of values in a specific container could arise, for instance, if you record the value of measure at several time points for each subject by stimulus combination, or under two or more different conditions, etc.



                If you only have one value of measure per subject by stimulus combination, then you're dealing with a linear model (lm). There is no grouping of observations according to each subject per stimulus combination, so there are no random grouping factors which means there aren't any effects that can vary randomly across combinations of levels of the grouping factors (i.e., random effects). If there aren't any random effects, there can't be a mixed effects model, as such a model would require both fixed and random effects to be part of it!



                If you do have multiple values of measure per container (i.e., subject by stimulus combination), then your model can include subject-level predictors (e.g., subject gender, subject age) and/or stimulus-level predictors (e.g., stimulus category).






                share|cite|improve this answer











                $endgroup$
















                  1












                  1








                  1





                  $begingroup$

                  In your setting, subject and stimulus seem to be fully crossed random grouping factors - since each subject sees each stimulus and (I am assuming) you are using the subjects and stimuli included in your studies to represent all the subjects and all the stimuli you wish to generalize your study findings to.



                  The key word here is grouping - for your model to be a linear mixed effects model (lmer), each subject by stimulus combination should act like a container which holds together a group of values for your measure outcome. All the values of measure that belong to the same container are more similar to each other than values that belong to different containers, as they are subjected to the same subject-level and stimulus-level influences (presuming these influences are constant over time).



                  The group of values in a specific container could arise, for instance, if you record the value of measure at several time points for each subject by stimulus combination, or under two or more different conditions, etc.



                  If you only have one value of measure per subject by stimulus combination, then you're dealing with a linear model (lm). There is no grouping of observations according to each subject per stimulus combination, so there are no random grouping factors which means there aren't any effects that can vary randomly across combinations of levels of the grouping factors (i.e., random effects). If there aren't any random effects, there can't be a mixed effects model, as such a model would require both fixed and random effects to be part of it!



                  If you do have multiple values of measure per container (i.e., subject by stimulus combination), then your model can include subject-level predictors (e.g., subject gender, subject age) and/or stimulus-level predictors (e.g., stimulus category).






                  share|cite|improve this answer











                  $endgroup$



                  In your setting, subject and stimulus seem to be fully crossed random grouping factors - since each subject sees each stimulus and (I am assuming) you are using the subjects and stimuli included in your studies to represent all the subjects and all the stimuli you wish to generalize your study findings to.



                  The key word here is grouping - for your model to be a linear mixed effects model (lmer), each subject by stimulus combination should act like a container which holds together a group of values for your measure outcome. All the values of measure that belong to the same container are more similar to each other than values that belong to different containers, as they are subjected to the same subject-level and stimulus-level influences (presuming these influences are constant over time).



                  The group of values in a specific container could arise, for instance, if you record the value of measure at several time points for each subject by stimulus combination, or under two or more different conditions, etc.



                  If you only have one value of measure per subject by stimulus combination, then you're dealing with a linear model (lm). There is no grouping of observations according to each subject per stimulus combination, so there are no random grouping factors which means there aren't any effects that can vary randomly across combinations of levels of the grouping factors (i.e., random effects). If there aren't any random effects, there can't be a mixed effects model, as such a model would require both fixed and random effects to be part of it!



                  If you do have multiple values of measure per container (i.e., subject by stimulus combination), then your model can include subject-level predictors (e.g., subject gender, subject age) and/or stimulus-level predictors (e.g., stimulus category).







                  share|cite|improve this answer














                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited 1 hour ago

























                  answered 1 hour ago









                  Isabella GhementIsabella Ghement

                  6,966320




                  6,966320






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Cross Validated!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f394706%2fin-mixed-effect-models-how-account-for-grouped-random-effects%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

                      Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

                      VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...