Hello,
I have to run about 35 regressions and plot the estimates of the key regression coefficient on a histogram. Do you know how to do this?
I have started experimenting with the sample data provided below but I could not manage to plot the estimates of the key regression coefficient mpg on a histogram. First I thought that coefplot may be appropriate, but then I realised that it cannot nicely visualise so many estimates and somehow the data should be plotted as a histogram.
sysuse auto, clear
regress price mpg trunk length turn if foreign==0
estimates store ELF1
regress price mpg trunk length turn if for==1
estimates store ELF2
regress price mpg trunk length if for==1
estimates store ELF3
regress price mpg trunk length turn if foreign==0
estimates store ELF4
regress price mpg trunk length turn if foreign==0
estimates store ELF5
regress price mpg trunk length turn if for==1
estimates store ELF6
regress price mpg trunk length turn if foreign==0
estimates store ELF7
regress price mpg trunk length turn if for==1
estimates store ELF8
regress price mpg trunk length turn if foreign==0
estimates store ELF9
regress price mpg trunk length turn if for==1
estimates store ELF10
regress price mpg trunk length turn if foreign==0
estimates store ELF11
regress price mpg trunk length turn if for==1
estimates store ELF12
regress price mpg trunk length turn if foreign==0
estimates store ELF13
regress price mpg trunk length turn if for==1
estimates store ELF14
regress price mpg trunk length turn if foreign==0
estimates store ELF15
regress price mpg trunk length turn if for==1
estimates store ELF16
regress price mpg trunk length turn if foreign==0
estimates store ELF17
regress price mpg trunk length turn if for==1
estimates store ELF18
coefplot ELF1 ELF2 ELF3 ELF4 ELF5 ELF6 ELF7 ELF8 ELF9 ELF10 ELF11 ELF12 ELF13 ELF14 ELF15 ELF16 , xline(0) keep(mpg) drop(_cons)
I have to run about 35 regressions and plot the estimates of the key regression coefficient on a histogram. Do you know how to do this?
I have started experimenting with the sample data provided below but I could not manage to plot the estimates of the key regression coefficient mpg on a histogram. First I thought that coefplot may be appropriate, but then I realised that it cannot nicely visualise so many estimates and somehow the data should be plotted as a histogram.
sysuse auto, clear
regress price mpg trunk length turn if foreign==0
estimates store ELF1
regress price mpg trunk length turn if for==1
estimates store ELF2
regress price mpg trunk length if for==1
estimates store ELF3
regress price mpg trunk length turn if foreign==0
estimates store ELF4
regress price mpg trunk length turn if foreign==0
estimates store ELF5
regress price mpg trunk length turn if for==1
estimates store ELF6
regress price mpg trunk length turn if foreign==0
estimates store ELF7
regress price mpg trunk length turn if for==1
estimates store ELF8
regress price mpg trunk length turn if foreign==0
estimates store ELF9
regress price mpg trunk length turn if for==1
estimates store ELF10
regress price mpg trunk length turn if foreign==0
estimates store ELF11
regress price mpg trunk length turn if for==1
estimates store ELF12
regress price mpg trunk length turn if foreign==0
estimates store ELF13
regress price mpg trunk length turn if for==1
estimates store ELF14
regress price mpg trunk length turn if foreign==0
estimates store ELF15
regress price mpg trunk length turn if for==1
estimates store ELF16
regress price mpg trunk length turn if foreign==0
estimates store ELF17
regress price mpg trunk length turn if for==1
estimates store ELF18
coefplot ELF1 ELF2 ELF3 ELF4 ELF5 ELF6 ELF7 ELF8 ELF9 ELF10 ELF11 ELF12 ELF13 ELF14 ELF15 ELF16 , xline(0) keep(mpg) drop(_cons)
Comment