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
For loop in StataHi, I want to loop over 150 variables, which has the format like code_001, code_002, ....., code_150…
New versions of xdir and descgen on SSCThanks as always to Kit Baum, new versions of the xdir and descgen packages are now avaiilable for d…
Adding highly correlated explanatory variablesHello, do we add explanatory variables that are highly correlated with the other explanatory variabl…
label & then encode - Assigning 2 or more values to same numberI have the following string variable that has 60 unique values. I want to assign Bureau Veritas Cert…
Generating a rate variable (number of events per year) using date and string variablesDear Statalist, I want to create a variable giving rate of exacerbations per year for each individu…
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