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.