Rebecca Rhead
Rebecca Rhead

Reputation: 1

Dropping columns when using tabout

I use tabout to produce output tables in Stata 14. I want to drop the last two columns of my table. The handbook states that this can be done using the dropc() option.

This is my code:

tabout var_one var_two if year==2014 using table1.xlsx, ///
cells(freq col) format(0 2p) clab(N %) dropc(5 6) ptotal(none) replace 

When I run this I get the following error message:

option dropc() not allowed

The code works fine if I remove the dropc() option. There isn't anything in the handbook that suggests why this is happening and a google search has turned up nothing.

Upvotes: 0

Views: 854

Answers (1)

user8682794
user8682794

Reputation:

You are using version 2 of the community-contributed command tabout, which is available on SSC.

The aforementioned error arises because option dropc() only works in version 3 beta.

You need to manually install this newer version by downloading the following file from the author's website into your adopath (click here for more information):

http://tabout.net.au/downloads/main_version/tabout.txt

You should also rename the extension to tabout.ado. Note that this is the file for Stata 14 and later.

Once installed, the dropc() option will work:

sysuse auto, clear

tabout mpg price if foreign == 1 using table1.txt, ///
cells(freq col) format(0 2p) dropc(5 6) clab(N %) ptotal(none) replace

Upvotes: 1

Related Questions