Hi all,
I am not familiar with the foreach command and have been trying to loop a twoway scatterplot command to create many scatterplots at once of different variables against the same dependent variable (and also graph a linear fit over each scatterplot) in separate graphs.
My code is as below:
foreach var of varlist v1-v127 {graph twoway (scatter `var' dependentvar) (lfit `var' dependentvar)}
The error it gives me is:
program error: code follows on the same line as open brace
I'm not really sure what I'm doing wrong- any insight would be greatly appreciated.
Related Posts with Using foreach to graph many variables vs one dependent variable on separate graphs
Constrained Nonlinear RegressionHi all, I am trying to estimate the parameter delta using the nl command in Stata 15.1, as follows:…
Histogram with log scale both below and above 0Dear Statalisters. I have been puzzling over what I would have thought would be a simple challenge.…
cmp for instrumental multinomial probit when there are many categoriesDependent variable Y1 has three categories 1, 2, 3 Dependent variable Y2 has four categories 1, 2, …
graph stata HR and tertilesArray Good morning, I'm trying to make a graph as follows after a cox model but I have never used st…
why i can't convert from yyyy/mm/dd to timehello i have variable for time like this : Day (variable name) 2011/12/01 2011/12/02 2011/12/03 . .…
Subscribe to:
Post Comments (Atom)
0 Response to Using foreach to graph many variables vs one dependent variable on separate graphs
Post a Comment