Hello all Statalists!
My dataset deals with students:
Using this code:
I constructed this summary statistics table:
I would like to add one row under the observations row that indicates the number of students.
This should look like this:
I appreciate your help, may thanks!
My dataset deals with students:
- id - student's id
- z_score - average normalized exam score
- boy - 0 if it is a girl, 1 if it is a boy
- n_tests - number of tests taken by each student
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long id float z_score byte boy float n_tests 1 .4175668 0 5 1 .14685987 0 5 1 .3355778 0 5 1 1.2158467 0 5 1 .7733934 0 5 4 1.4691545 0 5 4 1.36611 0 5 4 2.1176353 0 5 4 .8600661 0 5 4 1.5079113 0 5 8 1.3209883 0 9 8 -.5482661 0 9 8 .8338101 0 9 8 .8779632 0 9 8 1.4234405 0 9 8 1.5671417 0 9 8 .7105141 0 9 8 1.352845 0 9 8 1.326775 0 9 16 .54841125 0 4 16 .3468942 0 4 16 .7297521 0 4 16 -.6436306 0 4 17 -.5827441 1 8 17 -.50399095 1 8 17 .6509201 1 8 17 .897974 1 8 17 .7101643 1 8 17 -.06892658 1 8 17 .7585257 1 8 17 -1.2629386 1 8 end label values boy boy
Code:
bys boy: eststo: estpost sum n_tests z_score, listwise
esttab, main(mean) aux(sd) nostar nonote label nodepvar nogaps mtitles("Girls" "Boys")
Code:
----------------------------------------------
(1) (2)
Girls Boys
----------------------------------------------
Number of Tests 6.391 8
(2.169) (0)
Average Normalized~e 0.872 0.0749
(0.670) (0.798)
----------------------------------------------
Observations 23 8
----------------------------------------------
This should look like this:
Code:
----------------------------------------------
(1) (2)
Girls Boys
----------------------------------------------
Number of Tests 6.391 8
(2.169) (0)
Average Normalized~e 0.872 0.0749
(0.670) (0.798)
----------------------------------------------
Observations 23 8
Students 4 1
----------------------------------------------

Comment