Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Trouble producing population standard deviations with collapse (sd)


From   Matt Vivier <[email protected]>
To   [email protected]
Subject   Re: st: Trouble producing population standard deviations with collapse (sd)
Date   Mon, 16 Jul 2012 09:39:04 -0400

Great, thank you for the help everyone.

On Fri, Jul 13, 2012 at 11:35 PM, Austin Nichols
<[email protected]> wrote:
> Matt Vivier <[email protected]>:
> Also collapse the count N for each var, then multiply each SD by sqrt((N-1)/N)
>
> On Fri, Jul 13, 2012 at 4:36 PM, Matt Vivier <[email protected]> wrote:
>> Hello all,
>>
>> My specs are:
>> Stata/IC 12.1 for Windows (64-bit x86-64)
>> Revision 06 Feb 2012
>>
>> I am having some trouble getting collapse to produce the result I am
>> looking for. I have done some searching, and have not found anyone
>> else presenting this problem. I need it to generate the population
>> standard deviation for a large number of subsets of data, but it
>> appears the command I am using is generating a sample standard
>> deviation. Each subset of the data represents 100% of the population I
>> am interested in the SD for. Is there a simple way to do this, or will
>> I need to compute the SD using another process?
>>
>> My code is as follows:
>>
>> collapse (sum) TotCost TotAcute TotPostAcute ReadmissionCost
>> ReadmissionClaims count (sd) SDTotCost=TotCost
>> SDTotPostAcute=TotPostAcute SDReadmissionCost=ReadmissionCost (mean)
>> AvgTotCost=TotCost AvgTotPostAcute=TotPostAcute
>> AvgReadmissionCost=ReadmissionCost, by(drg_condition TriggerProvider
>> year)
>>
> *
> *   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/



-- 
Matt Vivier
Data Analyst / Stata Programmer
Remedy Partners
1 (781) 343-1473

-- 
----------------------------------------------------------------------
The information contained in this message may be privileged, confidential, 
and protected from disclosure. If you are not the intended recipient, or an 
employee, or agent responsible for delivering this message to the intended 
recipient, you are hereby notified that any dissemination, distribution, or 
copying of this communication is strictly prohibited. If you have received 
this communication in error, please notify us immediately by replying to 
the message and deleting from your computer.
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index