• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Analysis Factor

The Analysis Factor

Statistical Consulting, Resources, and Statistics Workshops for Researchers

  • our programs
    • Membership
    • Online Workshops
    • Free Webinars
    • Consulting Services
  • statistical resources
  • blog
  • about
    • Our Team
    • Our Core Values
    • Our Privacy Policy
    • Employment
    • Collaborate with Us
  • contact
  • login

SAS Proc Mixed

Multilevel Models with Crossed Random Effects

by Karen Grace-Martin  28 Comments

Crossed random effects models are a little trickier than most mixed models, but they are quite common in many fields. Recognizing when you have one and knowing how to analyze the data when you do are important statistical skills.

The Nested Multilevel Design

The most straightforward use of Mixed Models is when observations are clustered or nested in some higher group.

It’s also so common that it often has its own name: multilevel model.

Examples include studies where patients share the same doctor, plants grow in the same field, or participants respond to multiple experimental conditions.

The observations at Level 1 (patient, plant, response) are clustered at Level 2 (doctor, field, or participant). This makes the responses from the same cluster correlated.

In these models, the Level 2 cluster is often not of interest. It’s what we call a “blocking factor.” Even so, we need to control for its effects.

If the researcher would like to generalize the results to all doctors, fields, or participants, these clustering variables are random factors.

The observations of the dependent variable are always measured at Level 1 (the patient, plant, or time point). Predictor variables (fixed effects) can be measured at either Level 1 or Level 2. For example, number of years of experience of a doctor would be at Level 2, but patient age would be measured at Level 1.

We assume the observations within cluster are are correlated, but the observations between clusters are independent.

A third level is possible as well. This would happen if each doctor sees all their patients at one of four hospitals or each field has only one of 5 species.

The Crossed Multilevel Design

In one kind of 2-level model, there is not one random factor at Level 2, but two crossed factors.

Each observation at Level 1 is nested in the combination of these two random factors. These models need to be specified correctly to capture the effects of both random factors at Level 2.

Here are the same examples with crossed random effects:

Example 1:

Every patient (Level 1) sees their Doctor (Random Effect at Level 2) at one of four Hospitals (Random Effect at Level 2) for a study comparing a new drug treatment for diabetes to an old one.

Each doctor sees patients at each of the hospitals. Patient responses vary across doctors and hospitals.

Because each Patient sees a single doctor at a single hospital, patients are nested in the combination of Doctor and Hospital.

The response is measured at Level 1–the patient. Predictors can occur at Level 1 (age, diet) or either Level 2 factor (years of practice by doctor, size of hospital).

Example 2:

An agricultural study is studying plants in 6 fields.

While there are many species of plants in each field, the researcher randomly chooses 5 species to study.

Each individual plant (Level 1) lies within one combination of species and field. But since every species is in every field, Species and Field are crossed at Level 2.

The response is measured at Level 1–the plant.  Predictors can occur at Level 1 (height of plant) or either Level 2 factor (fertilizers applied to the field, whether the species is native or introduced).

Example 3:

In a psychological experiment, subjects rate statements that describe behaviors done by a fictional person, Bob.

On each trial, subjects rate whether or not they find Bob friendly. The response time of the rating is recorded.

Each subject sees the same 10 friendly and 10 unfriendly behaviors. The behaviors are not in themselves of interest to the experimenter,but are representative of all friendly and unfriendly behaviors that Bob could perform.

Because responses to the same behavior tend to be similar, it is necessary to control for their effects. Each trial of the experiment (Level 1) is nested both within Subject and Behavior, which are both random effects at Level 2.

Subject and Behavior are crossed at Level 2 since every Subject rates every Behavior. The response is measured at Level 1–the trial. Predictors can occur at Level 1 (a distractor occurs on some trials) or either Level 2 factor (Behavior is friendly or not, Subject is put into positive, neutral, or negative mood).

————————————————————————————————–

Luckily, standard mixed modeling procedures such as SAS Proc Mixed, SPSS Mixed, Stat’s xtmixed, or R’s lmer can all easily run a crossed random effects model. (R’s lme can’t do it).

Use care, however, because like most mixed models, specifying a crossed random effects model correctly can be tricky.

Tagged With: Correlated response, mixed model, multilevel model, SAS Proc Mixed, SPSS Mixed

Related Posts

  • Specifying Fixed and Random Factors in Mixed Models
  • The Difference Between Random Factors and Random Effects
  • Multilevel, Hierarchical, and Mixed Models–Questions about Terminology
  • Examples for Writing up Results of Mixed Models

Primary Sidebar

This Month’s Statistically Speaking Live Training

  • Member Training: Moderated Mediation, Not Mediated Moderation

Upcoming Workshops

    No Events

Upcoming Free Webinars

TBA

Quick links

Our Programs Statistical Resources Blog/News About Contact Log in

Contact

Upcoming

Free Webinars Membership Trainings Workshops

Privacy Policy

Search

Copyright © 2008–2023 The Analysis Factor, LLC.
All rights reserved.

The Analysis Factor uses cookies to ensure that we give you the best experience of our website. If you continue we assume that you consent to receive cookies on all websites from The Analysis Factor.
Continue Privacy Policy
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT