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
How to plot these graphs?Dear all, I want to plot two graphs shown pictures below. I would appreciate if anyone can help me …
Stochastic Search and Optimization in StataDear all, I am having a panel data of some quality indicators say ind1 ind2 it's up to ind8 and som…
Using loop to create state-codes for statesHi, I have the following states. I want to assign a 2-digit code to each state. The dataex is given…
Egen with weights?Hello, I am new to Stata and I am trying to calculate the proportion of women in different regions …
Can I take fixed effects( such as country id) as a continues covariate to controlHi guys, I am using a cross-section data to run 2sls regression. And there is a bunch of dummies com…
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