My colleagues and I have access to separate confidential datasets on municipal water use. Each person has access to one dataset; we cannot easily share them with each other without negotiating new data agreements with water utilities. We are trying to do parallel analyses but combine our results in overlaid graphs.
Here is an analogy using Stata's "auto" dataset. My code below plots a simple scatterplot of weight against mpg separately for foreign and domestic automakers. The first graph is what we want: an overlay of data from the two. But suppose that the data on domestic automakers was stored in a separate file on a separate computer (owned by Mauricio) from the data on foreign automakers (owned by me). Can Mauricio and I generate separate scatterplots, output them (to .gph?), and them combine them somehow to recreate the first graph?
Here is an analogy using Stata's "auto" dataset. My code below plots a simple scatterplot of weight against mpg separately for foreign and domestic automakers. The first graph is what we want: an overlay of data from the two. But suppose that the data on domestic automakers was stored in a separate file on a separate computer (owned by Mauricio) from the data on foreign automakers (owned by me). Can Mauricio and I generate separate scatterplots, output them (to .gph?), and them combine them somehow to recreate the first graph?
Code:
clear use https://www.stata-press.com/data/r7/auto.dta twoway (scatter weight mpg if foreign==0, mcolor(red)) (scatter weight mpg if foreign==1, mcolor(black)), legend(label(1 "Domestic") label(2 "Foreign")) use https://www.stata-press.com/data/r7/auto.dta, clear keep if foreign==0 twoway (scatter weight mpg if foreign==0, mcolor(red)) *save how? use https://www.stata-press.com/data/r7/auto.dta, clear keep if foreign==1 twoway (scatter weight mpg if foreign==1, mcolor(black)) *save how? *graph combine?
Comment