I have the following code:
hist house1 if house1 >0 & house1 <200000, bin(25) fraction by(Year)
graph export house1.png, replace
I would like to iterate it substituting house1
with car1
and bed1
without copy-pasting the code and substituting, or at least something like:
var = "house1"
hist var if house1 >0 & house1 <200000, bin(25) fraction by(Year)
graph export var.png, replace
So that I can change just the value assigned to var
.