unweighted counts

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

unweighted counts

mils
Hi everyone,

I've used the option "unweighted counts" in producing my ctables, but is not working properly, the numbers don't adapt. I've done a bit of research and it seems to be an SPSS bug.

http://www-01.ibm.com/support/docview.wss?uid=swg21478225

Anyone has experienced the same issue?

The link mentions two solutions:

1. This problem has been reported to SPSS Development and fixed in 5.5 patch 3.
2. For previous versions a workaround is to produce a separate unweighted table rather than including the unweighted counts in the same table

I already use two tables to show unweighted counts and weighted proportions.

However, I will like to install the 5.5 patch 3 but I can find it. Any guidance will be really appreciate it. I'm using SPSS v21.

Thanks in advance,



mils
Reply | Threaded
Open this post in threaded view
|

Re: unweighted counts

Art Kendall
That page is about the SPSS Data Collection product not about about Statistics.
Take a glimpse at the code in the note. Does it look much like SPSS syntax?

Try posting the syntax you are using and describing what you are trying to do.
Art Kendall
Social Research Consultants
On 4/3/2013 8:14 AM, mils [via SPSSX Discussion] wrote:
Hi everyone,

I've used the option "unweighted counts" in producing my ctables, but is not working properly, the numbers don't adapt. I've done a bit of research and it seems to be an SPSS bug.

http://www-01.ibm.com/support/docview.wss?uid=swg21478225

Anyone has experienced the same issue?

The link mentions two solutions:

1. This problem has been reported to SPSS Development and fixed in 5.5 patch 3.
2. For previous versions a workaround is to produce a separate unweighted table rather than including the unweighted counts in the same table

I already use two tables to show unweighted counts and weighted proportions.

However, I will like to install the 5.5 patch 3 but I can find it. Any guidance will be really appreciate it. I'm using SPSS v21.

Thanks in advance,



mils



If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/unweighted-counts-tp5719247.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: unweighted counts

mils
Hi Art,

I am going to use the syntax below to explain what I'm doing. Hope it helps.

I created a mock data set

set seed = 10.
input program.
loop #j = 1 to 100.
    loop #i = 1 to 100.
    compute V1 = RV.UNIFORM(0,1).
    compute V2 = RV.UNIFORM(0,1).
    compute V3 = RV.POISSON(3).
    compute V4 = RV.BERNOULLI(.5).
    compute V5 = RV.BINOM(5,.8).
    compute mycat = TRUNC(RV.UNIFORM(0,5)).
    compute group = #j.
    end case.
    end loop.
end loop.
end file.
end input program.
dataset name sim.
execute.


Below you can find two different tables (with the same variables). The first one is unweighted data and it is used to check out bases.

DATASET ACTIVATE sim.

* Custom Tables.
CTABLES
  /VLABELS VARIABLES=V5 mycat DISPLAY=LABEL
  /TABLE V5 BY mycat [COUNT F40.0, COLPCT.COUNT PCT40.1]
  /CATEGORIES VARIABLES=V5 ORDER=A KEY=VALUE EMPTY=EXCLUDE TOTAL=YES POSITION=AFTER
  /CATEGORIES VARIABLES=mycat ORDER=A KEY=VALUE EMPTY=EXCLUDE.


The second one is weighted data (in this case by V3) and it is used to check out the proportions.

WEIGHT by V3.

* Custom Tables.
CTABLES
  /VLABELS VARIABLES=V5 mycat DISPLAY=LABEL
  /TABLE V5 [C] BY mycat [C][UCOUNT F40.0, COLPCT.COUNT PCT40.1]
  /CATEGORIES VARIABLES=V5 ORDER=A KEY=VALUE EMPTY=EXCLUDE TOTAL=YES POSITION=AFTER
  /CATEGORIES VARIABLES=mycat ORDER=A KEY=VALUE EMPTY=EXCLUDE.

WEIGHT   OFF.


What I want is to combine unweighted counts and weighted proportions and I thought I could do it by using  "UCOUNT".


Thanks in advance,

mils
Reply | Threaded
Open this post in threaded view
|

Re: unweighted counts

mils
Hi everyone,

Probably I need to rephrase my question:

I would like to create a table with unweighted counts and weighted percentages.

Is that possible?

Thanks in advance.
mils
Reply | Threaded
Open this post in threaded view
|

Re: unweighted counts

mils
In reply to this post by Art Kendall
Hi,

Has anyone had any problem when using the "unweigthed counts" options from cTables? I'm trying to show "unweighted counts" and weighted percentages in the same table.

I've used the optiong below but the counts that I get are slightly different from the "real" unweighted data.

I've copied an example of what I'm trying to do so someone can tell me if I doing something wrong.


set seed = 10.
input program.
loop #j = 1 to 100.
    loop #i = 1 to 100.
    compute V1 = RV.UNIFORM(0,1).
    compute V2 = RV.UNIFORM(0,1).
    compute V3 = RV.POISSON(3).
    compute V4 = RV.BERNOULLI(.5).
    compute V5 = RV.BINOM(5,.8).
    compute mycat = TRUNC(RV.UNIFORM(0,5)).
    compute group = #j.
    end case.
    end loop.
end loop.
end file.
end input program.
dataset name sim.
execute.


Below you can find two different tables (analysing the same variables).

If run the first table without weighting the data so I can see the unweighted counts and percentages.

CTABLES
  /VLABELS VARIABLES=V5 mycat DISPLAY=LABEL
  /TABLE V5 BY mycat [COUNT F40.0, COLPCT.COUNT PCT40.1]
  /CATEGORIES VARIABLES=V5 ORDER=A KEY=VALUE EMPTY=EXCLUDE TOTAL=YES POSITION=AFTER
  /CATEGORIES VARIABLES=mycat ORDER=A KEY=VALUE EMPTY=EXCLUDE.


I've run the second table weighting the data by V3, but this time using the unweighting counts options.

WEIGHT by V3.

CTABLES
  /VLABELS VARIABLES=V5 mycat DISPLAY=LABEL
  /TABLE V5 [C] BY mycat [C][UCOUNT F40.0, COLPCT.COUNT PCT40.1]
  /CATEGORIES VARIABLES=V5 ORDER=A KEY=VALUE EMPTY=EXCLUDE TOTAL=YES POSITION=AFTER
  /CATEGORIES VARIABLES=mycat ORDER=A KEY=VALUE EMPTY=EXCLUDE.

WEIGHT   OFF.


I was expecting to see the same counts as the unweighted table before but with weighted percentages.


Could someone tell me why the counts are different from table 1 and table 2 although I'm using unweighting counts?

Thanks in advance,

Joan.


mils
Reply | Threaded
Open this post in threaded view
|

Re: unweighted counts

mils
Hi,

I would like to thank Jon. He wisely pointed out that some weights were 0 and were messing up with the "unweighted counts" option.

When I weighted by V3 I got the following error message:

>Warning # 3211
>On at least one case, the value of the weight variable was zero, negative, or
>missing.  Such cases are invisible to statistical procedures and graphs which
>need positively weighted cases, but remain on the file and are processed by
>non-statistical facilities such as LIST and SAVE.

So, following Jon suggestion, I recoded 0 values and missing values into a 0.00001 value.

Now it's working perfectly.

Thanks
mils