Issue with weighting (SPSS 17 x Mac)

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

Issue with weighting (SPSS 17 x Mac)

Luca Meyer-3
Something weird is happening with my SPSS 17.0.2 x Mac (*) output when I use weighting.

I have run this sample syntax:

NEW FILE. 
INPUT PROGRAM. 
- STRING gender (A6). 
- LOOP #I =1 TO 100. 
- DO IF #I <= 52. 
- COMPUTE gender='Male'. 
- ELSE. 
- COMPUTE Gender='Female'. 
- END IF. 
- COMPUTE AgeCategory = trunc(uniform(3)+1). 
- END CASE. 
- END LOOP. 
- END FILE. 
END INPUT PROGRAM. 
FREQUENCIES VARIABLES=gender AgeCategory. 
***create and apply weightvar***. 
***to simulate 49 males, 51 females***. 
DO IF gender = 'Male'. 
- COMPUTE weightvar=49/52. 
ELSE IF gender = 'Female'. 
- COMPUTE weightvar=51/48. 
END IF. 
WEIGHT BY weightvar. 
FREQUENCIES VARIABLES=gender AgeCategory. 

(font: Programming and Data Management for SPSS ®  Statistics 17.0 - page 90)

and I get the following output:

<--- before weighting --->

gender

 

Frequency
Percent
Valid Percent
Cumulative Percent
Valid
Female
48
48,0
48,0
48,0

Male
52
52,0
52,0
100,0

Total
100
100,0
100,0







AgeCategory

 

Frequency
Percent
Valid Percent
Cumulative Percent
Valid
1,00
40
40,0
40,0
40,0

2,00
31
31,0
31,0
71,0

3,00
29
29,0
29,0
100,0

Total
100
100,0
100,0


<--- after weighting --->

gender

 

Frequency
Percent
Valid Percent
Cumulative Percent
Valid
Female
51
51,0
51,0
51,0

Male
49
49,0
49,0
100,0

Total
100
100,0
100,0







AgeCategory

 

Frequency
Percent
Valid Percent
Cumulative Percent
Valid
1,00
40
39,7
39,7
39,7

2,00
31
31,3
31,3
71,0

3,00
29
29,0
29,0
100,0

Total
100
100,0
100,0


Look at the second AgeCategory Frequency: it is unchanged. But now look at the corresponding Percent column: it does not correspond.

Can someone help me to understand what's going on here?

Thanks,
Luca

(*) For the time being I am using the trial version I have downloaded from the SPSS support site



Mr. Luca Meyer



Reply | Threaded
Open this post in threaded view
|

Re: Issue with weighting (SPSS 17 x Mac)

ViAnn Beadle

Sure looks to me like you have 39.7 cases for agecat = 1 and 31.3 cases for agecat=2.  Frequencies are displayed with no decimal digits

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Luca Meyer
Sent: Saturday, April 25, 2009 10:30 AM
To: [hidden email]
Subject: Issue with weighting (SPSS 17 x Mac)

 

Something weird is happening with my SPSS 17.0.2 x Mac (*) output when I use weighting.

 

I have run this sample syntax:

 

NEW FILE. 

INPUT PROGRAM. 

- STRING gender (A6). 

- LOOP #I =1 TO 100. 

- DO IF #I <= 52. 

- COMPUTE gender='Male'. 

- ELSE. 

- COMPUTE Gender='Female'. 

- END IF. 

- COMPUTE AgeCategory = trunc(uniform(3)+1). 

- END CASE. 

- END LOOP. 

- END FILE. 

END INPUT PROGRAM. 

FREQUENCIES VARIABLES=gender AgeCategory. 

***create and apply weightvar***. 

***to simulate 49 males, 51 females***. 

DO IF gender = 'Male'. 

- COMPUTE weightvar=49/52. 

ELSE IF gender = 'Female'. 

- COMPUTE weightvar=51/48. 

END IF. 

WEIGHT BY weightvar. 

FREQUENCIES VARIABLES=gender AgeCategory. 

 

(font: Programming and Data Management for SPSS ®  Statistics 17.0 - page 90)

 

and I get the following output:

 

<--- before weighting --->

 

gender

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Female

48

48,0

48,0

48,0

Male

52

52,0

52,0

100,0

Total

100

100,0

100,0

AgeCategory

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

1,00

40

40,0

40,0

40,0

2,00

31

31,0

31,0

71,0

3,00

29

29,0

29,0

100,0

Total

100

100,0

100,0

 

<--- after weighting --->

 

gender

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Female

51

51,0

51,0

51,0

Male

49

49,0

49,0

100,0

Total

100

100,0

100,0

AgeCategory

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

1,00

40

39,7

39,7

39,7

2,00

31

31,3

31,3

71,0

3,00

29

29,0

29,0

100,0

Total

100

100,0

100,0

 

Look at the second AgeCategory Frequency: it is unchanged. But now look at the corresponding Percent column: it does not correspond.

 

Can someone help me to understand what's going on here?

 

Thanks,

Luca

 

(*) For the time being I am using the trial version I have downloaded from the SPSS support site

 

 

Mr. Luca Meyer

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Issue with weighting (SPSS 17 x Mac)

Hector Maletta
In reply to this post by Luca Meyer-3

SPSS rounds weighted frequencies. Your weights are fractional, and need rounding before getting displayed. So a small difference arises. Percentages are computed on the unrounded weighted frequencies.

 

Hector

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Luca Meyer
Sent: 25 April 2009 13:30
To: [hidden email]
Subject: Issue with weighting (SPSS 17 x Mac)

 

Something weird is happening with my SPSS 17.0.2 x Mac (*) output when I use weighting.

 

I have run this sample syntax:

 

NEW FILE. 

INPUT PROGRAM. 

- STRING gender (A6). 

- LOOP #I =1 TO 100. 

- DO IF #I <= 52. 

- COMPUTE gender='Male'. 

- ELSE. 

- COMPUTE Gender='Female'. 

- END IF. 

- COMPUTE AgeCategory = trunc(uniform(3)+1). 

- END CASE. 

- END LOOP

- END FILE. 

END INPUT PROGRAM. 

FREQUENCIES VARIABLES=gender AgeCategory. 

***create and apply weightvar***. 

***to simulate 49 males, 51 females***. 

DO IF gender = 'Male'. 

- COMPUTE weightvar=49/52. 

ELSE IF gender = 'Female'. 

- COMPUTE weightvar=51/48. 

END IF. 

WEIGHT BY weightvar. 

FREQUENCIES VARIABLES=gender AgeCategory. 

 

(font: Programming and Data Management for SPSS ®  Statistics 17.0 - page 90)

 

and I get the following output:

 

<--- before weighting --->

 

gender

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Female

48

48,0

48,0

48,0

 

Male

52

52,0

52,0

100,0

 

Total

100

100,0

100,0

 

 

 

 

 

 

 

AgeCategory

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

1,00

40

40,0

40,0

40,0

 

2,00

31

31,0

31,0

71,0

 

3,00

29

29,0

29,0

100,0

 

Total

100

100,0

100,0

 

 

<--- after weighting --->

 

gender

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Female

51

51,0

51,0

51,0

 

Male

49

49,0

49,0

100,0

 

Total

100

100,0

100,0

 

 

 

 

 

 

 

AgeCategory

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

1,00

40

39,7

39,7

39,7

 

2,00

31

31,3

31,3

71,0

 

3,00

29

29,0

29,0

100,0

 

Total

100

100,0

100,0

 

 

Look at the second AgeCategory Frequency: it is unchanged. But now look at the corresponding Percent column: it does not correspond.

 

Can someone help me to understand what's going on here?

 

Thanks,

Luca

 

(*) For the time being I am using the trial version I have downloaded from the SPSS support site

 

 

Mr. Luca Meyer

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Issue with weighting (SPSS 17 x Mac)

Luca Meyer-3
In reply to this post by ViAnn Beadle
Yes, that was it. 
Thank you,
Luca

Il giorno 25/apr/09, alle ore 18:37, ViAnn Beadle ha scritto:

Sure looks to me like you have 39.7 cases for agecat = 1 and 31.3 cases for agecat=2.  Frequencies are displayed with no decimal digits
 
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Luca Meyer
Sent: Saturday, April 25, 2009 10:30 AM
To: [hidden email]
Subject: Issue with weighting (SPSS 17 x Mac)
 
Something weird is happening with my SPSS 17.0.2 x Mac (*) output when I use weighting.
 
I have run this sample syntax:
 
NEW FILE. 
INPUT PROGRAM. 
- STRING gender (A6). 
- LOOP #I =1 TO 100. 
- DO IF #I <= 52. 
- COMPUTE gender='Male'. 
- ELSE. 
- COMPUTE Gender='Female'. 
- END IF. 
- COMPUTE AgeCategory = trunc(uniform(3)+1). 
- END CASE. 
- END LOOP. 
- END FILE. 
END INPUT PROGRAM. 
FREQUENCIES VARIABLES=gender AgeCategory. 
***create and apply weightvar***. 
***to simulate 49 males, 51 females***. 
DO IF gender = 'Male'. 
- COMPUTE weightvar=49/52. 
ELSE IF gender = 'Female'. 
- COMPUTE weightvar=51/48. 
END IF. 
WEIGHT BY weightvar. 
FREQUENCIES VARIABLES=gender AgeCategory. 
 
(font: Programming and Data Management for SPSS ®  Statistics 17.0 - page 90)
 
and I get the following output:
 
<--- before weighting --->
 
gender
 
Frequency
Percent
Valid Percent
Cumulative Percent
Valid
Female
48
48,0
48,0
48,0
Male
52
52,0
52,0
100,0
Total
100
100,0
100,0
AgeCategory
 
Frequency
Percent
Valid Percent
Cumulative Percent
Valid
1,00
40
40,0
40,0
40,0
2,00
31
31,0
31,0
71,0
3,00
29
29,0
29,0
100,0
Total
100
100,0
100,0
 
<--- after weighting --->
 
gender
 
Frequency
Percent
Valid Percent
Cumulative Percent
Valid
Female
51
51,0
51,0
51,0
Male
49
49,0
49,0
100,0
Total
100
100,0
100,0
AgeCategory
 
Frequency
Percent
Valid Percent
Cumulative Percent
Valid
1,00
40
39,7
39,7
39,7
2,00
31
31,3
31,3
71,0
3,00
29
29,0
29,0
100,0
Total
100
100,0
100,0
 
Look at the second AgeCategory Frequency: it is unchanged. But now look at the corresponding Percent column: it does not correspond.
 
Can someone help me to understand what's going on here?
 
Thanks,
Luca
 
(*) For the time being I am using the trial version I have downloaded from the SPSS support site
 
 
Mr. Luca Meyer