Hi there!
I'm having some difficulties saving and combining graphs that I have created using a foreach loop and the mrgraph command. The problem seems to be related to the fact that I'm using a wildcard with the mrtab command, but the resulting graphs can't be saved with the "*" in their name (because I suppose it is invalid syntax).
I'm using the following code:
local Q1a1vars Q1a1_*
local Q1a2vars Q1a2_*
local mrvars `Q1a1vars' `Q1a2vars'
foreach var of local mrvars {
mrtab `var'
mrgraph hbar `var' , stat(col) name(`var')
}
where the local Q1a1vars, for example, contains Q1a1_a Q1a1_b Q1a1_c etc. (which is why I use the wildcard). mrvars is therefore a local of locals. In the actual dataset, I hope to perform this foreach loop over a total of 33 similarly constructed locals, but I'm just including two here so as to not over-complicate things.
I'm able to successfully generate the graphs using mrgraph, it's just the naming that is a problem.
Does anyone have any advice about how I could name the graphs?
Please let me know if any additional information is needed!
-Alec
Related Posts with Problem with saving graphs with wildcard in names
Using mata to create matrixI'd like to create a matrix shown in the figure. It's a NC*(N+C) matrix. All N block matrixes on the…
How to graph difference in means between model 1 and model 2Hi Statalist, I will appreciate help with this problem. First, here is my data: Code: * Example g…
Negative lower confidence interval boundary for variance with nlcom after a multilevel logistic regressionHello, I am conducting a multilevel logistic regression to identify determinants of the availabilit…
Long Data Format: Creating a New Variable with Values Conditional on Combination of Values of Other Variables Across Many ObservationsHello! I am stuck not knowing how to create a variable I need based on my current data. I have a l…
total dose per day with multiple dates and times Code: * Example generated by -dataex-. To install: ssc install dataex clear input int(date_daily_3…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with saving graphs with wildcard in names
Post a Comment