Dear Statalisters,
I suspect that the missing in my database is NOT completely at random. For this reason, I will check this assumption later with the -mcartest.
But before that, I will create a table reporting the means for the whole sample and for the final estimated sample. (You can experiment yourself in Stata as follow).
Note that the table above is comparing two groups (missing = 0 vs missing = 1). But this is not exactly what I am looking for.
I would like to create a table where the first group is the whole sample, this means the first estimation with N = 4,948. While the second group remains the same (second estimation with N = 2,569). The first rows could be similar to:
Does anyone have any idea of how can I change the "eststo diff" to achieve this goal?
I suspect that the missing in my database is NOT completely at random. For this reason, I will check this assumption later with the -mcartest.
But before that, I will create a table reporting the means for the whole sample and for the final estimated sample. (You can experiment yourself in Stata as follow).
PHP Code:
webuse nhanes2
misstable summarize bpdiast lead fhtatk loglead highlead
qui regress bpdiast lead
eststo whole
qui regress bpdiast lead fhtatk loglead highlead
eststo subsample
esttab whole subsample // Note that N decreased from 4,948 to 2,569
--------------------------------------------
(1) (2)
bpdiast bpdiast
--------------------------------------------
lead 0.251*** -0.194
(8.45) (-0.83)
fhtatk 2.648
(1.69)
loglead 6.488*
(2.43)
highlead 2.208
(0.78)
_cons 78.11*** 66.75***
(169.00) (17.45)
--------------------------------------------
N 4948 2569
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
generate missing=0
replace missing = 1 if lead==. | fhtatk==. | loglead==. | highlead==.
eststo nomissing: quietly estpost summarize lead fhtatk loglead highlead if missing == 0
eststo missing: quietly estpost summarize lead fhtatk loglead highlead if missing == 1
eststo diff: quietly estpost ttest lead fhtatk loglead highlead, by(missing) unequal
esttab nomissing missing diff, cells("mean(pattern(1 1 0) fmt(3)) sd(pattern(1 1 0)) b(star pattern(0 0 1) fmt(3)) t(pattern(0 0 1) par fmt(3))") nolabel
---------------------------------------------------------------------------------------------
(1) (2) (3)
mean sd mean sd b t
---------------------------------------------------------------------------------------------
lead 11.968 4.651 16.860 6.581 -4.892*** (-29.982)
fhtatk 0.028 0.164 0.030 0.172 -0.003 (-0.599)
loglead 2.411 0.381 2.758 0.365 -0.347*** (-32.689)
highlead 0.014 0.119 0.108 0.310 -0.093*** (-13.756)
---------------------------------------------------------------------------------------------
N 2569 5244 7813
---------------------------------------------------------------------------------------------
Note that the table above is comparing two groups (missing = 0 vs missing = 1). But this is not exactly what I am looking for.
I would like to create a table where the first group is the whole sample, this means the first estimation with N = 4,948. While the second group remains the same (second estimation with N = 2,569). The first rows could be similar to:
PHP Code:
eststo nomissing: quietly estpost summarize lead fhtatk loglead highlead
eststo missing: quietly estpost summarize lead fhtatk loglead highlead if missing == 1
eststo diff: quietly estpost ttest ????
Does anyone have any idea of how can I change the "eststo diff" to achieve this goal?
Comment