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]

From |
Steve Samuels <sjsamuels@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

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

Date |
Fri, 13 Jul 2012 19:33:54 -0400 |

If your subset "represents 100% of the population", the implication is that you have survey data, and must, therefore, have a weight variable e.g. "final_wt". Add [pw = final_wt] before the comma. To compute standard errors, -svyset- your data and use Stata's survey commands. Steve sjsamuels@gmail.com On Jul 13, 2012, at 4:36 PM, Matt Vivier 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) Thank you for your help, Matt -- ---------------------------------------------------------------------- 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/ * * 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/

**References**:**st: Trouble producing population standard deviations with collapse (sd)***From:*Matt Vivier <mvivier@remedypartners.net>

- Prev by Date:
**st: aggregation of Fisher's exact test p-values** - Next by Date:
**st:graph mean with missing groups** - Previous by thread:
**st: Trouble producing population standard deviations with collapse (sd)** - Next by thread:
**Re: st: Trouble producing population standard deviations with collapse (sd)** - Index(es):