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
Ytitle with euro sign does not display horizontallyDespite putting angle(0) the title will not be displayed horizontally. Since this only happens for t…
Generating random variables based on some predefined correlationsDear Stata Members I would like to ask a few questions and clear some doubts regarding regressions b…
LSDVC methodAfter regressions with LSDVC method stata indicates bootsraps error. I want to know what is differnc…
What should the command be?I would like to ask about the exact command. Assume yt= (infla t, unrate t, hwages t)is(3×1)-vector,…
Export Word putdocxHi I have not had Stata for too long and am trying to create a Word export from Stata. Unfortunatel…
Subscribe to:
Post Comments (Atom)
0 Response to Using foreach to graph many variables vs one dependent variable on separate graphs
Post a Comment