• 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

  • Home
  • Our Programs
    • Membership
    • Online Workshops
    • Free Webinars
    • Consulting Services
  • About
    • Our Team
    • Our Core Values
    • Our Privacy Policy
    • Employment
    • Collaborate with Us
  • Statistical Resources
  • Contact
  • Blog
  • Login

Mixed and Multilevel Models

When NOT to Center a Predictor Variable in Regression

by Karen Grace-Martin 22 Comments

There are two reasons to center predictor variables in any type of regression analysis–linear, logistic, multilevel, etc.

1. To lessen the correlation between a multiplicative term (interaction or polynomial term) and its component variables (the ones that were multiplied).

2. To make interpretation of parameter estimates easier.

I was recently asked when is centering NOT a good idea? [Read more…] about When NOT to Center a Predictor Variable in Regression

Tagged With: centering, interaction, linear regression, multilevel model, polynomials

Related Posts

  • How to Combine Complicated Models with Tricky Effects
  • Understanding Interactions Between Categorical and Continuous Variables in Linear Regression
  • Member Training: Using Excel to Graph Predicted Values from Regression Models
  • Should You Always Center a Predictor on the Mean?

Concepts in Linear Regression you need to know before learning Multilevel Models

by Karen Grace-Martin 2 Comments

It seems very many researchers are needing to learn multilevel and mixed models, and I have to say, it’s not so easy on your own.

I too went to graduate school before it was taught in classes–we did learn mixed models as in Split Plot designs, but things have progressed a bit since then.  So I too have had to learn them without benefit of a class, or teacher.  So I feel your pain.  But I’ve struggled through and learned a [Read more…] about Concepts in Linear Regression you need to know before learning Multilevel Models

Tagged With: centering, dummy coding, effect coding, interaction, interpreting regression coefficients, mixed model, multilevel model, Polynomial terms

Related Posts

  • How to Combine Complicated Models with Tricky Effects
  • When NOT to Center a Predictor Variable in Regression
  • Specifying Fixed and Random Factors in Mixed Models
  • Multilevel, Hierarchical, and Mixed Models–Questions about Terminology

Multilevel Models with Crossed Random Effects

by Karen Grace-Martin 27 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

Confusing Statistical Terms #3: Level

by Karen Grace-Martin 1 Comment

Level is a term in statistics that is confusing because it has multiple meanings in different contexts (much like alpha and beta).

There are three different uses of the term Level in statistics that mean completely different things. What makes this especially confusing is that all three of them can be used in the exact same research context.

I’ll show you an example of that at the end.

So when you’re talking to someone who is learning statistics or who happens to be thinking of that term in a different context, this gets especially confusing.

Levels of Measurement

The most widespread of these is levels of measurement. Stanley Stevens came up with this taxonomy of assigning numerals to variables in the 1940s. You probably learned about them in your Intro Stats course: the nominal, ordinal, interval, and ratio levels.

Levels of measurement is really a measurement concept, not a statistical one. It refers to how much and the type of information a variable contains. Does it indicate an unordered category, a quantity with a zero point, etc?

It is important in statistics because it has a big impact on which statistics are appropriate for any given variable. For example, you would not do the same test of association between two nominal variables as you would between two interval variables.

Levels of a Factor

A related concept is a Factor. Although Factor itself has multiple meanings in statistics, here we are talking about a categorical predictor variable.

The typical use of Factor as a categorical predictor variable comes from experimental design. In experimental design, the predictor variables (also often called Independent Variables) are generally categorical and nominal. They represent different experimental conditions, like treatment and control traditions.

Each of these categorical conditions is called a level.

Here are a few examples:

In an agricultural study, a fertilizer treatment variable has three levels: Organic fertilizer (composted manure); High concentration of chemical fertilizer; low concentration of chemical fertilizer.

In a medical study, a drug treatment has four levels: Placebo; low dosage; medium dosage; high dosage.

In a linguistics study, a word frequency variable has two levels: high frequency words; low frequency words.

Although this use of level is very widespread, I try to avoid it personally. Instead I use the word “value” or “category” both of which are accurate, but without other meanings.

Level in Multilevel Models

A completely different use of the term is in the context of multilevel models. Multilevel models is a term for some mixed models. (The terms multilevel models and mixed models are often used interchangably, though mixed model is a bit more flexible).

Multilevel models have two or more sources of random variation.  A two level model has two sources of random variation and can have predictors at each level.

A common example is a model from a design where the response variable of interest is measured on students. It’s hard though, to sample students directly or to randomly assign them to treatments, since there is a natural clustering of students within schools.

So the resource-efficient way to do this research is to sample students within schools.

Predictors can be measured at the student level (eg. gender, SES, age) or the school level (enrollment, % who go on to college).  The dependent variable has variation from student to student (level 1) and from school to school (level 2).

We always count these levels from the bottom up. So if we have students clustered within classroom and classroom clustered within school and school clustered within district, we have:

  • Level 1: Students
  • Level 2: Classroom
  • Level 3: School
  • Level 4: District

So this use of the term level describes the design of the study, not the measurement of the variables or the categories of the factors.

Putting them together

So this is the truly unfortunate part. There are situations where all three definitions of level are relevant within the same statistical analysis context.

I find this unfortunate because I think using the same word to mean completely different things just confuses people. But here it is:

Picture that study in which students are clustered within school (a two-level design). Each school is assigned to use one of three math curricula (the independent variable, which happens to be categorical).

So, the variable “math curriculum” is a factor with 3 levels (ie, three categories). Because those three categories of “math curriculum” are unordered, “math curriculum” has a nominal level of measurement. And since “math curriculum” is assigned to each school, it is considered a level 2 variable in the two-level model.

See the rest of the Confusing Statistical Terms series.

Tagged With: ANOVA, Fixed Factor, level of measurement, multilevel model, nominal variable

Related Posts

  • Specifying Fixed and Random Factors in Mixed Models
  • Member Training: Elements of Experimental Design
  • The Difference Between Random Factors and Random Effects
  • Confusing Statistical Terms #1: The Many Names of Independent Variables

Mixed Up Mixed Models

by Karen Grace-Martin 1 Comment

A great article for specifying Mixed Models in SAS:

Mixed up Mixed Models
by Robert Harner & P.M. Simpson

Anyone doing mixed modeling in SAS should read this paper, originally presented at SUGI: SAS Users Group International conference. It compares the output from Proc Mixed and Proc GLM when specified different ways. There are some subtle distinctions in the meaning of the defaults in the Repeated and Random statements, and this paper does an excellent job of clarifying them.

Tagged With: mixed model, multilevel model, Random Statement, Repeated Statement, SAS

Related Posts

  • The Repeated and Random Statements in Mixed Models for Repeated Measures
  • Specifying Fixed and Random Factors in Mixed Models
  • Multilevel, Hierarchical, and Mixed Models–Questions about Terminology
  • Covariance Matrices, Covariance Structures, and Bears, Oh My!

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 10
  • Go to page 11
  • Go to page 12

Primary Sidebar

This Month’s Statistically Speaking Live Training

  • Member Training: Assumptions of Linear Models

Upcoming Free Webinars

The Pathway: Steps for Staying Out of the Weeds in any Data Analysis

Upcoming Workshops

  • Analyzing Count Data: Poisson, Negative Binomial, and Other Essential Models (Jul 2022)
  • Introduction to Generalized Linear Mixed Models (Jul 2022)

Copyright © 2008–2022 The Analysis Factor, LLC. All rights reserved.
877-272-8096   Contact Us

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