I am trying to use the table and collect commands to generate a table of descriptive statistics for a report that I am creating using putdocx.
The table I am creating includes columns with both factor variables and continuous variables. I would like to remove the column headers that say "Factor-variable percent" and "Mean" but I do not know what these table elements are called or how to modify them.
I have provided an example below (I am using confidential data, but NLSW88 is a similar format to my data). I am using Stata 18.0
Result:
Apologies if this has been asked elsewhere and I did not see the post.
The table I am creating includes columns with both factor variables and continuous variables. I would like to remove the column headers that say "Factor-variable percent" and "Mean" but I do not know what these table elements are called or how to modify them.
I have provided an example below (I am using confidential data, but NLSW88 is a similar format to my data). I am using Stata 18.0
Code:
sysuse nlsw88 table race, statistic(fvpercent never_married) statistic(mean hours) statistic(mean wage) /// sformat("%s%%" fvpercent) nformat(%2.1f) collect layout (race) (result#var[1.never_married hours wage])
Code:
collect preview --------------------------------------------------------------------- | Factor-variable percent Mean | Never married Usual hours worked Hourly wage | Never married --------+------------------------------------------------------------ Race | White | 7.7% 36.9 8.1 Black | 18.0% 38.1 6.8 Other | 11.5% 36.8 8.6 Total | 10.4% 37.2 7.8 ---------------------------------------------------------------------
Comment