Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best Practices for Organizing/Finding the Right User-Written Program?

    Hi all -- over the (many) years, I've aggregated a bunch of super useful user-written commands, from SSC to Github and beyond. Some I use regularly and are in the forefront of my mind when coding. Others are used sparingly, but unbelievably useful when deployed. My problem is that I forget what tools I have available to me. Of course, I rely heavily on the ado command, including ado, find(); however, the latter is only useful if I know the name or a few keywords of the program while the former is just a blunt force approach that takes a lot of time. And I have a lot of similar commands, but some do one thing better than others and vice versa.

    All that to say: does anyone know of a "command manager" or something like that? How do you all keep track of your installed user-written commands?

    Am I alone in thinking that there is massive utility to be able to organize these commands within Stata via folders, tags, etc? Help!

  • #2
    I had a broadly similar problem in keeping track of some user-written (community-contributed (*)) commands I cared about, those I wrote and made public and wrote a help file for.

    My first solution was dopey, a Stata dataset with an observation for each. But that was not much use. Before frames, I had to read in the dataset before I could look at it.

    My second solution is better for me. Maintain a help file -- call it what you like but the name must be memorable and not already in use. I got the idea from a throw-away remark by Michael Hills at a Stata London meeting. He pointed out that you can write your own help files on anything you want, such as notes on a dataset that students are expected to use. (I immediately felt foolish for not seeing that much earlier.)

    Let's say that you use the name kb_extras.

    The help file needs the extension .sthlp and it must lie somewhere along your adopath.

    You need to use a little SMCL to make the idea useful. Top of my list is making each command name clickable so that you can go directly to its help.

    Here are some extracts from the mark-up for one of my help files. This one is part of the njc_stuff package on SSC.

    Clearly you're in charge you can write as little or as much as you like on each command. You don't need to be consistent on the amount of detail you record.

    Code:
    {smcl}
    {hline}
    index of NJC's best Stata stuff (version 30 March 2024)  
    {hline}
    
    {title:Description}
    
    {p 4 4 2}This is a list of what I regard as my best Stata packages or commands
    that are in the public domain.  If a help file is not accessible to you, use
    {help search} to find out where the files are. The help files carry details on
    people who kindly reported bugs or made useful suggestions. A fuller list is
    available at {help njc_stuff:NJC stuff}.
    
    
    
    
    {title:Packages, mostly on SSC}
    
    {title:General graphics commands}
    
    {space 4}{help aaplot}              scatter plot with linear and/or quadratic fit, automatically annotated
    {space 4}{help binsm}               bin smoothing and summary on scatter plots
    {space 4}{help catplot}             plots of categorical data
    {space 4}{help ciplot}              plots of confidence intervals
    {space 4}{help combineplot}         combine similar plots for different variables
    {space 4}{help corrtable}           correlation matrix as graphical table
    {space 4}{help crossplot}           scatter (twoway) plots for each y vs each x
    {space 4}{help cycleplot}           cycle plots (seasonal subseries plots)
    {space 4}{help depthplot}           plot variable(s) with depth as vertical axis
    {space 4}{help designplot}          graphical summary of response given one or more factors
    {space 4}{help diagsm}              diagonal smoothing
    {space 4}{help distplot}            distribution function plots
    {space 4}{help domdiag}             dominance diagrams
    {space 4}{help doublesm}            double smoothing
    {space 4}{help dpplot}              density probability plots
    {space 4}{help eofplot}             plot coefficients or loadings after PCA or factor analysis
    {space 4}{help eqprhistogram}       equal probability histograms
    {space 4}{help fabplot}             plots for each subset, rest of data as backdrop
    {space 4}{help favplots}            formatted added-variable plot(s)
    {space 4}{help floatplot}           floating or sliding stacked bar plot
    {space 4}{help fractileplot}        smoothing with distribution function predictors
    {space 4}{help jaccard}             Jaccard similarity or dissimilarity of sets
    {space 4}{help kaplansky}           graph examples of distributions of varying kurtosis
    {space 4}{help linkplot}            linked scatter plots
    {space 4}{help localp}              kernel-weighted local polynomial smoothing
    {space 4}{help missingplot}         plot showing patterns of missing values in a dataset
    {space 4}{help mlowess}             lowess smoothing with multiple predictors
    {space 4}{help modeldiag}           model diagnostics after regression-type commands
    {space 4}{help multidot}            multiple panel dot charts and similar
    {space 4}{help multiline}           multiple panel line plots
    {space 4}{help multqplot}           multiple quantile plots
    {space 4}{help mycolours}           set a palette of colours through local macros
    {space 4}{help mylabels}            axis labels or ticks on specified scales
    {space 4}{help nicelabels}          nice axis labels for general scales
    {space 4}{help niceloglabels}       nice axis labels for logarithmic scales
    {space 4}{help pairplot}            plots of paired observations
    {space 4}{help parplot}             parallel coordinates plots  
    {space 4}{help pdplot}              Pareto dot plots
    {space 4}{help polarsm}             polar smoothing
    {space 4}{help ppplot}              P-P plots
    {space 4}{help qplot}               quantile plots
    {space 4}{help qqplotg}             quantile-quantile plots, generalized
    {space 4}{help rcspline}            restricted cubic spline smoothing
    {space 4}{help sdline}              SD line (reduced major axis)
    {space 4}{help sepscatter}          scatter plots separated by a third variable
    {space 4}{help skewplot}            skewness plots
    {space 4}{help sliceplot}           time series or other plot in slices
    {space 4}{help sparkline}           sparkline-type plots
    {space 4}{help spineplot}           spine plots for two-way categorical data
    {space 4}{help statplot}            plots of summary statistics
    {space 4}{help stemplot}            stem-and-leaf plots
    {space 4}{help stripplot}           strip plots
    {space 4}{help tabplot}             one-, two- and three-way bar charts for tables  
    {space 4}{help transplot}           plots for trying out transformations
    {space 4}{help triplot}             triangular plots
    {space 4}{help trimplot}            plots of trimmed means
    {space 4}{help twoway__whistogram_gen}
    {space 4}                           histogram subroutine supporting aweights and iweights
    {space 4}{help upsetplot}           Euler or Venn diagrams mapped to bar charts, upsetplot style
    {space 4}{help vennbar}             Euler or Venn diagrams mapped to bar or dot charts
    {space 4}{help zmap}                binned scatter maps
    (*) StataCorp has taken to saying "community-contributed" but that wording is naturally not compulsory, It's likely that user-written is clear enough to anyone who cares.

    Comment


    • #3
      This is excellent, Nick. Thank you! I particularly like the idea/freedom of organizing into my own domains simply by creating headers. This will be my solution moving forward until StataNow has something more natively built-in to manage user/community written/contributed programs (say that 5 times fast).

      Seriously, thank you for sharing!!

      Comment

      Working...
      X