Home  /  Resources & support  /  FAQs  /  Programming Stata

Programming Stata

FAQ:   Programming Stata
Search the FAQs: spacer.gif spacer.gif

Questions are listed below in the following categories:
  1. General programming FAQs
  2. Dialog FAQs
  3. FAQs concerning releases before Stata 18

1. General programming FAQs

How do I share my command with Stata users?

Why don’t my community-contributed estimation commands work after Stata 11?

I have a certain version of Stata and have come across a community-contributed program that is apparently written for a later version of Stata. What are my options?

Is there any way to get around the option limit in Stata’s syntax command?

How do I process parallel lists?

How do I signal that there are alternative types of arguments to program options?

What is the difference between a release marker and a version number in a ado-file?

How can I use Stata to solve a system of nonlinear equations?

How can I automatically execute certain commands every time I start Stata?

I have an if command in my program that only seems to evaluate the first observation, what's going on?

Why does my do-file or ado-file produce different results every time I run it?

How can I pass arguments to my do-file?

Why do I get errors with my local macros?

Why do I get syntax errors when I use local macros in my do-file?

How do I debug my program?

How do I add an observation to a dataset when coding an ado-file?

I coded `a'^2 and got the wrong sign. Why?

How can I save matrices?

Where is the official ado directory?

Where is my personal ado directory?

How do I assign multiple backslash characters to macros in Stata?

How do I use Python within Stata?

2. Dialog FAQs

A. How do I get started writing Stata dialogs?

Dialog programming (part 1)—Getting started
Dialog programming (part 2)—Adding features
Dialog programming (part 3)—Using tabs
Dialog programming (part 4)—Using options

B. How do I share community-contributed dialogs and Stata menus?

Sharing dialogs (part 1)—Basic terminology and overview
Sharing dialogs (part 2)—Dialog-box programs
Sharing dialogs (part 3)—Stata menus
Sharing dialogs (part 4)—Submenus and dialogs

C. Advanced dialog topics

What can you tell me about using the .idlg files that are written by StataCorp and used in their dialogs?

How can I take care of prerequisites in dialog boxes?

Can I use existing Stata .idlg files for my own graphics command dialog?

3. FAQs concerning releases before Stata 18

Why does a program defined by an ado-file sometimes not work when given a string comparison?

How do I modify an ado-file created for previous versions of Stata to support factor variables and the collinearity behavior introduced in Stata 11?

How do I convert date variables into Stata elapsed dates in Stata 9 or earlier when the numbers run together, like 4151999?

What can you tell me about the Windows 98 operating system and dialogs?

Why do I get puzzling results with the for command and local or global macros?

Why do some nested for commands produce an error?

Why is post giving a syntax error?

How can I remove collinear variables from a varlist?

I just downloaded and installed an ado-file from an early STB (before STB-7), and I am having trouble running it. What's wrong?

Where does Stata look for ado-files?

Where should I keep my ado-files?