Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: can you change the -collapse- default?


From   Jorge Eduardo Pérez Pérez <perez.jorge@ur.edu.co>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: can you change the -collapse- default?
Date   Mon, 2 Apr 2012 17:25:43 -0400

As far as I can tell this would require modifying the .ado file for
-collapse-. It is easy, however, to define your own -collapse- with
the median as default:

program define mycollapse
collapse (median) `0'
end
sysuse auto, clear
collapse price, by(foreign)
list
sysuse auto, clear
collapse (median) price [pw=mpg] if turn<46, by(foreign)
list
sysuse auto, clear
mycollapse price [pw=mpg] if turn<46, by(foreign)
list
_______________________
Jorge Eduardo Pérez Pérez



On Mon, Apr 2, 2012 at 4:03 PM, Joshua Dewbre <jdewbre@gmail.com> wrote:
> Dear Statalist,
> At times I find myself using official commands interactively a great
> deal. In these instances it would be nice to change the default
> settings of, e.g., --collapse-- to (median) as opposed to (mean).  Is
> this possible? I use Stata 11.2.
> Thanks,
> Josh
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index