I was trying to use collect layout after rdrobust. Everything works fine example the sample size does not appear. I have adapted the example in https://users.ssc.wisc.edu/~dimond/r...ld_tables/reg3.
First, I rerun the example with "reg" to show that it produces the coefficients and sample sizes. Second, I run the example with "rdrobust" to show that it produces the coefficient but not the sample sizes. Any suggestions on how to fix this?
clear all
use https://sscc.wisc.edu/~rdimond/real_world_tables/reg3
gen x = runiform(0,1)
gen y = 0.9*x + 0.1*nicu
local model 1
foreach outcome in mort6 mort364 {
foreach low in 0 1 {
quietly: collect, tag(outcome[`outcome'] wt[`low'] model[`model']): reg `outcome' nets y if low==`low', robust
collect get controls = "N", tag(outcome[`outcome'] wt[`low'] model[`model'])
local model = `model' + 1
quietly: collect, tag(outcome[`outcome'] wt[`low'] controls[Y] model[`model']): reg `outcome' nets y employed if low==`low', robust
collect get controls = "Y", tag(outcome[`outcome'] wt[`low'] model[`model'])
local model = `model' + 1
}
}
collect layout (colname[nets y]#result[_r_b _r_se] result[controls N]) (outcome#wt#model)
clear all
use https://sscc.wisc.edu/~rdimond/real_world_tables/reg3
gen x = runiform(0,1)
gen y = 0.9*x + 0.1*nicu
local model 1
foreach outcome in mort6 mort364 {
foreach low in 0 1 {
quietly: collect, tag(outcome[`outcome'] wt[`low'] model[`model']): rdrobust `outcome' y if low==`low', c(0.5)
collect get controls = "N", tag(outcome[`outcome'] wt[`low'] model[`model'])
local model = `model' + 1
quietly: collect, tag(outcome[`outcome'] wt[`low'] controls[Y] model[`model']): rdrobust `outcome' y if low==`low', c(0.5)
collect get controls = "Y", tag(outcome[`outcome'] wt[`low'] model[`model'])
local model = `model' + 1
}
}
collect layout (colname[RD_Estimate]#result[_r_b _r_se] result[controls N]) (outcome#wt#model)
First, I rerun the example with "reg" to show that it produces the coefficients and sample sizes. Second, I run the example with "rdrobust" to show that it produces the coefficient but not the sample sizes. Any suggestions on how to fix this?
clear all
use https://sscc.wisc.edu/~rdimond/real_world_tables/reg3
gen x = runiform(0,1)
gen y = 0.9*x + 0.1*nicu
local model 1
foreach outcome in mort6 mort364 {
foreach low in 0 1 {
quietly: collect, tag(outcome[`outcome'] wt[`low'] model[`model']): reg `outcome' nets y if low==`low', robust
collect get controls = "N", tag(outcome[`outcome'] wt[`low'] model[`model'])
local model = `model' + 1
quietly: collect, tag(outcome[`outcome'] wt[`low'] controls[Y] model[`model']): reg `outcome' nets y employed if low==`low', robust
collect get controls = "Y", tag(outcome[`outcome'] wt[`low'] model[`model'])
local model = `model' + 1
}
}
collect layout (colname[nets y]#result[_r_b _r_se] result[controls N]) (outcome#wt#model)
clear all
use https://sscc.wisc.edu/~rdimond/real_world_tables/reg3
gen x = runiform(0,1)
gen y = 0.9*x + 0.1*nicu
local model 1
foreach outcome in mort6 mort364 {
foreach low in 0 1 {
quietly: collect, tag(outcome[`outcome'] wt[`low'] model[`model']): rdrobust `outcome' y if low==`low', c(0.5)
collect get controls = "N", tag(outcome[`outcome'] wt[`low'] model[`model'])
local model = `model' + 1
quietly: collect, tag(outcome[`outcome'] wt[`low'] controls[Y] model[`model']): rdrobust `outcome' y if low==`low', c(0.5)
collect get controls = "Y", tag(outcome[`outcome'] wt[`low'] model[`model'])
local model = `model' + 1
}
}
collect layout (colname[RD_Estimate]#result[_r_b _r_se] result[controls N]) (outcome#wt#model)

Comment