Creating a Non-Self Mean/Proportion

  • Follow


Hello,

I have created a summed scale of 2 dichotomous items coded originally 0 1.
 The new variable now has values ranging from 0 to 2.

Since I am using a survey that I want to create summary measures
like non-self mean or non-self proportions that represent other members
of the respondents strata but excluding the respondent.

Eg. I would want to know the proportion of the respondents strata:
-- who hold no negative attitudes - ie 0 in the summed scale;
-- who hold only one of the negative attitudes, ie, 1 in the summed scale as
well as
-- those members of the strata who hold both negative values or 2 in the
summed scale.

Below are 20 cases, covering 3 different strata, as well as their respective
values on the index variable of interest (i.e., score),  for your
examination. What I want
is the count or proportion of each value of the index variable (i.e., score)
in each strata.

Cluster Hhold#  Line#   Strata  score
46      7       1       1       0
122     20      4       1       0
122     6       2       1       1
46      1       1       1       2
122     11      2       1       1
122     6       1       1       0
122     16      6       2       0
46      13      1       2       1
46      12      1       2       2
122     17      1       2       0
122     8       2       2       1
46      13      3       2       1
122     5       2       2       0
46      6       3       3       1
122     16      2       3       0
122     15      1       3       2
46      4       2       3       0
46      19      3       3       1
122     4       2       3       0
46      20      4       3       2

So from this scratch data we can have the following distribution of the 3
score values by strata:

ScoreValues     Strata1    Strata2    Strata3   Total

0                         3            3              3           9
1                         2            3              2           7
2                         1            1              2           4

N                                                                 20

Thus, we can state that across all strata 9 individuals had a score of 0, 7
had a score of 1 and 4 had a score of 2 -- that is we aggregate or count
each of the values of the index variable (Score) across or over all strata.
 In this way I can describe the distribution of the scores over the strata.

I will be very grateful for any help in getting this programmed.


thanks - Cy
0
Reply Yawo1964 (17) 11/20/2009 11:25:25 AM

is this what you want?
data have;
input
Cluster Hhold  Line   Strata  score;
cards;
46      7       1       1       0
122     20      4       1       0
122     6       2       1       1
46      1       1       1       2
122     11      2       1       1
122     6       1       1       0
122     16      6       2       0
46      13      1       2       1
46      12      1       2       2
122     17      1       2       0
122     8       2       2       1
46      13      3       2       1
122     5       2       2       0
46      6       3       3       1
122     16      2       3       0
122     15      1       3       2
46      4       2       3       0
46      19      3       3       1
122     4       2       3       0
46      20      4       3       2
;
run;

proc report data=have nowd;
column score    Strata,N=N2 N=N1;
define score /group;
define strata/across;
define N2/'';

define N1/'total';
rbreak after /summarize;
run;

HTH

Yu

On Fri, Nov 20, 2009 at 5:25 AM, Chao Yawo <Yawo1964@yahoo.com> wrote:

> Hello,
>
> I have created a summed scale of 2 dichotomous items coded originally 0 1.
>  The new variable now has values ranging from 0 to 2.
>
> Since I am using a survey that I want to create summary measures
> like non-self mean or non-self proportions that represent other members
> of the respondents strata but excluding the respondent.
>
> Eg. I would want to know the proportion of the respondents strata:
> -- who hold no negative attitudes - ie 0 in the summed scale;
> -- who hold only one of the negative attitudes, ie, 1 in the summed scale
> as
> well as
> -- those members of the strata who hold both negative values or 2 in the
> summed scale.
>
> Below are 20 cases, covering 3 different strata, as well as their
> respective
> values on the index variable of interest (i.e., score),  for your
> examination. What I want
> is the count or proportion of each value of the index variable (i.e.,
> score)
> in each strata.
>
> Cluster Hhold#  Line#   Strata  score
> 46      7       1       1       0
> 122     20      4       1       0
> 122     6       2       1       1
> 46      1       1       1       2
> 122     11      2       1       1
> 122     6       1       1       0
> 122     16      6       2       0
> 46      13      1       2       1
> 46      12      1       2       2
> 122     17      1       2       0
> 122     8       2       2       1
> 46      13      3       2       1
> 122     5       2       2       0
> 46      6       3       3       1
> 122     16      2       3       0
> 122     15      1       3       2
> 46      4       2       3       0
> 46      19      3       3       1
> 122     4       2       3       0
> 46      20      4       3       2
>
> So from this scratch data we can have the following distribution of the 3
> score values by strata:
>
> ScoreValues     Strata1    Strata2    Strata3   Total
>
> 0                         3            3              3           9
> 1                         2            3              2           7
> 2                         1            1              2           4
>
> N                                                                 20
>
> Thus, we can state that across all strata 9 individuals had a score of 0, 7
> had a score of 1 and 4 had a score of 2 -- that is we aggregate or count
> each of the values of the index variable (Score) across or over all strata.
>  In this way I can describe the distribution of the scores over the strata.
>
> I will be very grateful for any help in getting this programmed.
>
>
> thanks - Cy
>
0
Reply zhangyu05 (659) 11/20/2009 3:45:02 PM


A proc tabulate seems to work fine:

data xx;
input Strata  score;
cards;
1       0
1       0
1       1
1       2
1       1
1       0
2       0
2       1
2       2
2       0
2       1
2       1
2       0
3       1
3       0
3       2
3       0
3       1
3       0
3       2
;

proc tabulate;
class strata score;
table score, strata*n=''*f=2. all*f=2. /rts=10;
run;

  „ƒƒƒƒƒƒƒƒ…ƒƒƒƒƒƒƒƒ…ƒƒ�
  ‚        ‚        ‚A-‚
  ‚        ‚ Strata ‚ll‚
  ‚        ‡ƒƒ…ƒƒ…ƒƒˆƒƒ‰
  ‚        ‚1 ‚2 ‚3 ‚N ‚
  ‡ƒƒƒƒƒƒƒƒˆƒƒˆƒƒˆƒƒˆƒƒ‰
  ‚score   ‚  ‚  ‚  ‚  ‚
  ‡ƒƒƒƒƒƒƒƒ‰  ‚  ‚  ‚  ‚
  ‚0       ‚ 3‚ 3‚ 3‚ 9‚
  ‡ƒƒƒƒƒƒƒƒˆƒƒˆƒƒˆƒƒˆƒƒ‰
  ‚1       ‚ 2‚ 3‚ 2‚ 7‚
  ‡ƒƒƒƒƒƒƒƒˆƒƒˆƒƒˆƒƒˆƒƒ‰
  ‚2       ‚ 1‚ 1‚ 2‚ 4‚
  � ƒƒƒƒƒƒƒƒ‹ƒƒ‹ƒƒ‹ƒƒ‹ƒƒŒ


On Fri, 20 Nov 2009 06:25:25 -0500, Chao Yawo <Yawo1964@YAHOO.COM> wrote:

>Hello,
>
>I have created a summed scale of 2 dichotomous items coded originally 0 1.
> The new variable now has values ranging from 0 to 2.
>
>Since I am using a survey that I want to create summary measures
>like non-self mean or non-self proportions that represent other members
>of the respondents strata but excluding the respondent.
>
>Eg. I would want to know the proportion of the respondents strata:
>-- who hold no negative attitudes - ie 0 in the summed scale;
>-- who hold only one of the negative attitudes, ie, 1 in the summed scale
as
>well as
>-- those members of the strata who hold both negative values or 2 in the
>summed scale.
>
>Below are 20 cases, covering 3 different strata, as well as their
respective
>values on the index variable of interest (i.e., score),  for your
>examination. What I want
>is the count or proportion of each value of the index variable (i.e.,
score)
>in each strata.
>
>Cluster Hhold#  Line#   Strata  score
>46      7       1       1       0
>122     20      4       1       0
>122     6       2       1       1
>46      1       1       1       2
>122     11      2       1       1
>122     6       1       1       0
>122     16      6       2       0
>46      13      1       2       1
>46      12      1       2       2
>122     17      1       2       0
>122     8       2       2       1
>46      13      3       2       1
>122     5       2       2       0
>46      6       3       3       1
>122     16      2       3       0
>122     15      1       3       2
>46      4       2       3       0
>46      19      3       3       1
>122     4       2       3       0
>46      20      4       3       2
>
>So from this scratch data we can have the following distribution of the 3
>score values by strata:
>
>ScoreValues     Strata1    Strata2    Strata3   Total
>
>0                         3            3              3           9
>1                         2            3              2           7
>2                         1            1              2           4
>
>N                                                                 20
>
>Thus, we can state that across all strata 9 individuals had a score of 0, 7
>had a score of 1 and 4 had a score of 2 -- that is we aggregate or count
>each of the values of the index variable (Score) across or over all strata.
> In this way I can describe the distribution of the scores over the strata.
>
>I will be very grateful for any help in getting this programmed.
>
>
>thanks - Cy
0
Reply ya.huang (1962) 11/20/2009 3:51:30 PM

2 Replies
137 Views

(page loaded in 0.114 seconds)

Similiar Articles:













7/17/2012 4:54:38 AM


Reply: