*! version 0.3 07nov2014

Title

ssccount -- download ssc hits data over time for user-written packages

Syntax

ssccount , [ from(first_month) to(last_month) author(author_name) clear fillin(#) graph package(pkg_name) saving(filename, replace) ]

Main
from(first_month) first month to download data for, specified in %tm format; default is 2007m7

to(last_month) last month to download data for, specified in %tm format; default is 3 months ago

author(author_name) name of author whose packages are of interest, if applicable

clear specifies that existing data be cleared from memory

fillin(#) specifies the # to fill in for missing months. Default is not to use fillin.

graph specifies that a graph be drawn of results

package(pkg_name) exact name of the package of interest, if applicable

saving(filename, replace) asks Stata to save the files downloaded as filename.dta

Description

For authors of user-written packages released on SSC, ssccount is a command
to keep track of monthly hits. It uses the same datasets as ssc hot and appends
them over time. Datasets are downloaded for the specified date range and loaded into
memory. If neither author() nor package() options are specified,
ssccount will download data for all authors and packages for the specified
months. It is then up to the user to process as they wish.

Note that records began in 2007m7 (that is, July 2007) and ssccount will react
angrily if dates before this are specified. Unfortunately ssccount is not a crystal
ball, and if dates specified are in the future you will not get any results. There
also tends to be a lag of around two months on the release of the datasets. Specifying
months that are not yet available will display an error but ssccount will load
into memory the datasets it was able to download, if any.

Options

from(first_month) specifies the first month you are interested in.
Must be specified in Stata's %tm format. For example, Jan 2010 is specified as
"2010m1". Must be no later than the date specified in the to() option.
Default is 2007m7.

to(last_month) specifies the last month you are interested in.
Must be specified in Stata's %tm format. For example, Feb 2010 is given as
"2010m2". Cannot be earlier than the date specified in the from() option.
Default is three months earlier than the current month, chosen due to a lag before
hits files become available online.

author() specifies the name of the author being searched for. Note that the names
on SSC packages can be of an inconsistent form. You do not have to get it exactly right,
as long as the name used contains what you specify in author. Note that the option is not
sensitive to case, so specifiying author(bloggs) is the same as author(BLOGGS)
or anything in between, like author(bLoGgS).

clear specifies that any dataset currently in memory be cleared. If there is a dataset
in memory and the clear option is not specified, ssccount will exit with an
error.

fillin(#) calls the fillin command. This is for use with plots when more than
one author and/or package has been specified. It creates missing months to form a rectangular
dataset and fills each one in with # hits. Filling as missing (.) is allowed. Default is not
to fill anything.

graph draws a simple graph of the month-by-month hits using twoway line and
overlays a smoothed trend using lowess. If the data contains multiple authors or
packages, the graphs will be drawn by author and/or package.

package(pkg_name) specifies the name of the package of interest. This may be useful if
an author has written multiple packages but is interested in one in particular. It
can also be helpful if the author's name is a substring of one or more other authors'
names.

saving(filename, replace) saves a copy of the dataset you have downloaded.

Examples

Download all hits for 2008:

ssccount , from(2008m1) to(2008m12) saving(2008data)

Download and plot hits for the ice package by Patrick Royston from Jun 2007 to Sep 2014:

ssccount , from(2007m7) to(2014m9) author(Royston) graph package(ice) saving(icehits)

Download and plot hits for the psmatch2 package from Jan to May 2015:

ssccount , from(2015m1) to(2015m5) graph package(psmatch2) saving(psmatch2_2015)

Reference

Choodari-Oskooei, B. and Morris, T. P. (2016). Quantifying the uptake of user-written commands over
time. The Stata Journal 16(1)88–95.

Acknowledgements

We are grateful to Patrick Royston and Roger Newson for helpful advice on the command.

Authors

Tim Morris, MRC Clinical Trials Unit at UCL, London UK

Email: tim.morris@ucl.ac.uk

Twitter: @tmorris_mrc

Babak Choodari-Oskooei, MRC Clinical Trials Unit at UCL, London UK

Email: b.choodari-oskooei@ucl.ac.uk