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.
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:
1// Wrong: no variables specified2regress "stata-comment">// r(100)34// Right: specify dependent and independent variables5regress wage education experience67// Wrong: using a prefix as a standalone command8bysort "stata-comment">// r(100)910// Right: prefix needs a command11bysort firm_id: summarize wage“varlist not allowed” — Remove variable names:
1// Wrong: clear doesn't take a varlist2clear wage education "stata-comment">// r(100)34// Right: clear takes no arguments (or "all")5clear6clear all78// Wrong: variable after options comma9summarize, wage "stata-comment">// r(100)1011// Right: variable before comma12summarize wageCause 1: Forgetting the Variable List
Many estimation commands require at least one variable name. Running them without variables produces r(100).
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 variable67// Fix: add the variables8regress wage education experience9logit employed education age10tabulate industrysummarize 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.
// 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)// Prefixes need a command after them:by firm_id, sort: summarize wagebysort year: regress wage educationquietly regress wage educationnoisily 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.
// Comma before varlist — WRONGsummarize, wage education// Stata reads: summarize (no vars), with options "wage education"regress, wage education experience// Stata reads: regress (no vars), with options...// Varlist before comma — CORRECTsummarize wage education// No options neededregress wage education experience, robust// Options come after commaCause 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.
1// WRONG: passing a string value, not a variable name2tabulate "industry" "stata-comment">// r(100)34// RIGHT: variable name, no quotes5tabulate industry67// WRONG: quoted variable name in regression8regress "wage" "education" "stata-comment">// r(100)910// RIGHT: bare variable names11regress wage educationCause 5: Factor Variable Notation Errors
Factor variable prefixes must be attached directly to the variable name. Spaces or wrong syntax cause r(100).
1// WRONG: space between i. and variable2regress wage i. industry "stata-comment">// r(100)34// RIGHT: no space5regress wage i.industry67// WRONG: using i() instead of i.8regress wage i(industry) "stata-comment">// r(198) or r(100)910// RIGHT: dot notation11regress wage i.industry c.educationCause 6: Commands That Don’t Take Variables
Some commands don’t accept variable names at all. Providing them causes “varlist not allowed.”
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 complete4pwd education "stata-comment">// r(100) — pwd takes no arguments5exit wage "stata-comment">// r(100) — exit takes a return code, not vars67// Correct usage:8clear9set more off10pwd11exitDebugging Strategy
- Read the error message carefully. “varlist required” means add variables. “varlist not allowed” means remove them.
- Check the help file. Run
help commandnameto see the exact syntax, including whether a varlist is required, optional, or not allowed. - Check for misplaced commas. Variables go before the comma, options after.
- Check for prefix misuse.
by,quietly,captureneed a command after them. - 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.
Related Guides
- Stata Error r(198): Every Cause of Invalid Syntax
- Stata Error r(111): Variable Not Found — Complete Fix Guide
- Stata ‘variable already defined’: gen vs replace
We build practical, reproducible workflows for Stata and R teams working on real empirical research pipelines.