Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Creating a Non-Self Mean (Score)


From   Chao Yawo <[email protected]>
To   [email protected]
Subject   Re: st: RE: Creating a Non-Self Mean (Score)
Date   Sun, 13 Jul 2008 08:58:11 -0700 (PDT)

Hi,

Thanks for the suggestions.  I was able to create (Sum of Others - This Value), as suggested, hence I have the numerator for creating the Mean of Others.  However, I am running into a bit of a problem creating the denominator.

Here is what my data looks like at the moment:

Obs   Strata  SumOthers  MeanOthers

1      1        3            2
2      1        1 
3      1        2
4      2        1
5      2        3
6      1        3

The Mean for observation 1 = ([3+1+2+3]-3 / 4 - 1) = 2.  

That is, to the get the mean of others, I have to divide the "Sum of Others - This Value"  by a denominator that counts the "number of observations within each strata - 1". I looked at the Count option, however, I realized that it saves it output as a scalar, hence I am unable to get the denominator required.

I would appreciate any assistance to get around this.

Thanks in advance -- CY


Mean of others = (Sum of all - This value) / (Number in group - 1) 


--- On Thu, 7/3/08, Chao Yawo <[email protected]> wrote:

> From: Chao Yawo <[email protected]>
> Subject: Re: st: RE: Creating a Non-Self Mean (Score)
> To: [email protected]
> Date: Thursday, July 3, 2008, 2:22 PM
> Nick,  thanks very much.  I will review the documents and
> get back to the list with any further questions.
> 
> I appreciate your assistance.
> 
> rgds, CY
> 
> 
> --- On Thu, 7/3/08, Nick Cox <[email protected]>
> wrote:
> 
> > From: Nick Cox <[email protected]>
> > Subject: st: RE: Creating a Non-Self Mean (Score)
> > To: [email protected]
> > Date: Thursday, July 3, 2008, 8:30 AM
> > This is a FAQ. See 
> > 
> > FAQ     . . Creating variables recording prop. of the
> other
> > members of a
> > group
> >         4/05    How do I create variables summarizing
> for
> > each
> >                 individual properties of the other
> members
> > of a
> >                 group?
> >                
> > http://www.stata.com/support/faqs/data/members.html
> > 
> > The key principle for sums is elementary 
> > 
> > Sum of others = Sum of all - This value 
> > 
> > And for means correspondingly 
> > 
> > Mean of others = (Sum of all - This value) / (Number
> in
> > group - 1) 
> > 
> > Other summary measures are more challenging, but the
> FAQ
> > gives advice. 
> > 
> > The only obvious complication is that you want to sum
> > across variables
> > before you summarize across the other members of this
> > group. That will
> > often be easiest through -egen, rowtotal()-. 
> > 
> > Nick
> > [email protected] 
> > 
> > Chao Yawo
> > 
> > 
> > I am examining the effect of stigmatizing attitudes of
> > specific health
> > behaviors, using a demographic health survey (DHS).
> DHS
> > respondents were
> > required to indicate (by a YES, NO, DONT KNOW)
> whether:
> > 
> > (1) whether they would buy a vegetable from a vendor
> who
> > has HIV, (2)
> > whether they would keep their family member's HIV
> > infection a secret
> > (3) whether they would be willing to care for a
> relative
> > who is infected
> > with HIV
> > (4) wheether a female teacher infected with HIV should
> be
> > allowed to
> > continue teaching in school
> > 
> > I want to calculate a summary score that reflects
> community
> > attitude
> > (the attitudes of all members of the community on
> these
> > variables ---
> > that is the score must EXCLUDE those of the
> respondent, and
> > INCLUDE
> > those of all others.  In some literature, this is
> referred
> > to as
> > non-self mean.
> > 
> > Since in the DHS, clusters (V022) are the lowest level
> from
> > which a
> > sample of households is drawn (i.e. these are
> typically the
> > primary
> > sampling unit), I want a score based on the responses
> of
> > all people in
> > the same strata (PSU) as the respondent, but excluding
> the
> > respondent's
> > responses. For example, to compute this score for an
> > individual A who
> > resides in PSU B, we sum the stigma scores (over all
> the 4
> > variables) of
> > all individuals in PSU B, with the exceptoin of
> respondent
> > A.
> > 
> > I would be very grateful if you could give me some
> pointers
> > about how to
> > create this summary score (over all the 4 variables).
> > 
> > regards, C. Y.
> > 
> > 
> > 
> >       
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/support/faqs/res/findit.html
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
> > 
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/support/faqs/res/findit.html
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
> 
> 
>       
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


      
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index