Hi all,
I'm creating a STATA program that will:
1. open a dataset,
2. keep a user defined list of variables,
3. save these to a temporary file,
4. loop through numerous other datasets, repeating the above, appending the users variables to the temporary file.
The program runs fine when no variables are specified in the programs command (i.e. getdata, options) as I have the following in my program:
if "`varlist'" == "" {
local varlist "x y z"
}
However, when the user includes a list of variables when entering the programs command (i.e. getdata x y z, options), STATA returns a "no variables defined" error message.
No dataset is open when the user runs the program and I think that is the problem I'll need to get around.
Thanks for any help.
Related Posts with Problem with a program that will open a dataset with a user defined list of variables
foreach num in numlist - reports error (numlist not found) // what's my syntax mistake?Hello, I would like to run the following loop but I get the message: Code: femnumlist not found …
Exporting Mlogit Marginal Effects to ExcelI am trying to export marginal effects output for mlogit into stata. the commands i used are as foll…
Generating predicted probabilities of random effects after melogitHello, My question is on estimating coefficients for random effects in mixed effect models. I am bu…
Generating variables in migration panelsHi All, This is my first post, so excuse me breaking any rules/conventions. I'm trying to generate…
tabout command generating an easy cross table in wordHey, I try to create an easy cross table. First, I used the tabulate command: tabulate variable1 var…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with a program that will open a dataset with a user defined list of variables
Post a Comment