Stata Errors
2026-02-108 min read

Stata Error r(100): 'varlist required' and 'varlist not allowed' Explained

r(100) means Stata expected variable names and didn't get them — or got them when it didn't want them. Here's every scenario and the fix.

Sytra Team
Research Engineering Team, Sytra AI

Stata error r(100) comes in two flavors: “varlist required” (you didn’t provide variable names when the command needs them) and “varlist not allowed” (you provided variable names when the command doesn’t want them). Both are easy to fix once you know which commands expect what.

All examples tested in Stata 18 SE. Compatible with Stata 15+.


Quick Answer

“varlist required” — Add variable names to your command:

quick-fix.do
stata
1// Wrong: no variables specified
2regress "stata-comment">// r(100)
3
4// Right: specify dependent and independent variables
5regress wage education experience
6
7// Wrong: using a prefix as a standalone command
8bysort "stata-comment">// r(100)
9
10// Right: prefix needs a command
11bysort firm_id: summarize wage

“varlist not allowed” — Remove variable names:

not-allowed.do
stata
1// Wrong: clear doesn't take a varlist
2clear wage education "stata-comment">// r(100)
3
4// Right: clear takes no arguments (or "all")
5clear
6clear all
7
8// Wrong: variable after options comma
9summarize, wage "stata-comment">// r(100)
10
11// Right: variable before comma
12summarize wage

Cause 1: Forgetting the Variable List

Many estimation commands require at least one variable name. Running them without variables produces r(100).

missing-varlist.do
stata
1// These all need variable names:
2regress "stata-comment">// r(100)
3logit "stata-comment">// r(100)
4summarize "stata-comment">// works! (summarizes all variables)
5tabulate "stata-comment">// r(100) — needs at least one variable
6
7// Fix: add the variables
8regress wage education experience
9logit employed education age
10tabulate industry
💡Tip
Some commands like summarize and describe work without a varlist by operating on all variables. Others like regress and tabulate require at least one variable. Check with help commandname.

Cause 2: Running a Prefix as a Command

Stata prefixes like by, bysort, quietly, and captureare not standalone commands. They modify the command that follows.

Prefix used as command
stata
// These are prefixes, not commands:
by firm_id "stata-comment">// r(100)
bysort year "stata-comment">// r(100)
quietly "stata-comment">// r(100)
noisily "stata-comment">// r(100)
Prefix with command
stata
// Prefixes need a command after them:
by firm_id, sort: summarize wage
bysort year: regress wage education
quietly regress wage education
noisily display "Done"

Cause 3: Comma Between Command and Variables

In Stata, the comma separates variables from options. If you accidentally put a comma between the command and the variable list, Stata thinks you have no variables and everything after the comma is options.

Misplaced comma
stata
// Comma before varlist — WRONG
summarize, wage education
// Stata reads: summarize (no vars), with options "wage education"
regress, wage education experience
// Stata reads: regress (no vars), with options...
Correct placement
stata
// Varlist before comma — CORRECT
summarize wage education
// No options needed
regress wage education experience, robust
// Options come after comma

Cause 4: String Value Where Variable Name Expected

If you accidentally pass a string literal instead of a variable name, Stata can’t find it in the varlist.

string-confusion.do
stata
1// WRONG: passing a string value, not a variable name
2tabulate "industry" "stata-comment">// r(100)
3
4// RIGHT: variable name, no quotes
5tabulate industry
6
7// WRONG: quoted variable name in regression
8regress "wage" "education" "stata-comment">// r(100)
9
10// RIGHT: bare variable names
11regress wage education
👁Gotcha
Variable names are never quoted in Stata commands. Quotes are for string valuesand file paths, not variable names. If you’re coming from R or Python, this is a common adjustment.

Cause 5: Factor Variable Notation Errors

Factor variable prefixes must be attached directly to the variable name. Spaces or wrong syntax cause r(100).

factor-errors.do
stata
1// WRONG: space between i. and variable
2regress wage i. industry "stata-comment">// r(100)
3
4// RIGHT: no space
5regress wage i.industry
6
7// WRONG: using i() instead of i.
8regress wage i(industry) "stata-comment">// r(198) or r(100)
9
10// RIGHT: dot notation
11regress wage i.industry c.education

Cause 6: Commands That Don’t Take Variables

Some commands don’t accept variable names at all. Providing them causes “varlist not allowed.”

no-varlist.do
stata
1// These commands don't take a varlist:
2clear wage "stata-comment">// r(100) — just use "clear"
3set more off wage "stata-comment">// r(100) — "set more off" is complete
4pwd education "stata-comment">// r(100) — pwd takes no arguments
5exit wage "stata-comment">// r(100) — exit takes a return code, not vars
6
7// Correct usage:
8clear
9set more off
10pwd
11exit

Debugging Strategy

  1. Read the error message carefully. “varlist required” means add variables. “varlist not allowed” means remove them.
  2. Check the help file. Run help commandname to see the exact syntax, including whether a varlist is required, optional, or not allowed.
  3. Check for misplaced commas. Variables go before the comma, options after.
  4. Check for prefix misuse. by, quietly, capture need a command after them.
  5. Check for quoted variable names. Variable names are never quoted.

Sytra catches these errors before you run.

Sytra validates your command syntax before execution — it knows which commands need varlists, which don't, and catches prefix errors. Write your analysis in plain English and get syntactically correct Stata code.

Join the Waitlist →

FAQ

What does r(100) mean in Stata?

Error r(100) has two forms: “varlist required” means the command expects variable names but you didn’t provide any. “varlist not allowed” means the command doesn’t take variable names but you provided some.

What is a varlist in Stata?

A varlist is a list of variable names. In summarize wage education age, the varlist is wage education age. Many commands accept varlists to specify which variables to operate on.

Why does Stata say “varlist required” when I typed a variable?

Common causes: a comma between the command and variables, a quoted variable name, a prefix used without a command, or a factor variable with a space after i.. Check your syntax against help commandname.

Why does Stata say “varlist not allowed”?

Some commands don’t accept variable names. clear, exit, andset commands don’t take varlists. Check the command’s help file.


Written by Sytra Team
Research Engineering Team, Sytra AI

We build practical, reproducible workflows for Stata and R teams working on real empirical research pipelines.

#Stata#Errors#Debugging#Syntax

Enjoyed this article?