Look-up Values

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

Look-up Values

<R. Abraham>

Hello,
I was wondering if someone can help with this problem. I have a variable 'Age' which has several missing values. I was to fill the missing value with the mean of Age for each category of another variable.

Eg.
Income                Mean of Age
0-25K                25
25K-45K        30
45K-60K        40
60K+                45

So if 'Age' is 'missing', and 'Income' is '25K-45K', fill the missing Age with the mean value of Age i.e. 30.

I know to do this in SAS, but I would like to do the same in spss. Is there anyone who has the syntax to do this, or point me to some solution.

Thanks.
R. Abraham
Reply | Threaded
Open this post in threaded view
|

Re: Look-up Values

Maguin, Eugene
R.
 
Look at the RMV command. I assume you know that the treatment of missing data is a recent reseach topic and that means substitution, in general, is not well regarded.
 
Gene Maguin


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of <R. Abraham>
Sent: Thursday, May 26, 2011 11:47 AM
To: [hidden email]
Subject: Look-up Values


Hello,
I was wondering if someone can help with this problem. I have a variable 'Age' which has several missing values. I was to fill the missing value with the mean of Age for each category of another variable.

Eg.
Income                Mean of Age
0-25K                25
25K-45K        30
45K-60K        40
60K+                45

So if 'Age' is 'missing', and 'Income' is '25K-45K', fill the missing Age with the mean value of Age i.e. 30.

I know to do this in SAS, but I would like to do the same in spss. Is there anyone who has the syntax to do this, or point me to some solution.

Thanks.
R. Abraham
Reply | Threaded
Open this post in threaded view
|

Re: Look-up Values

Jon K Peck
The RMV calculations are based on the entire dataset (except for nearby points), not on statistics for groups.
If you use AGGREGATE to compute the group means matching back to the dataset, then a simple if statement will finish the job.

 AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=incomegroup /themean=mean(age).
IF (MISSING(age)) age = themean.

HTH,

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Gene Maguin <[hidden email]>
To:        [hidden email]
Date:        05/26/2011 09:57 AM
Subject:        Re: [SPSSX-L] Look-up Values
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




R.
 
Look at the RMV command. I assume you know that the treatment of missing data is a recent reseach topic and that means substitution, in general, is not well regarded.
 
Gene Maguin


From: SPSSX(r) Discussion [[hidden email]] On Behalf Of <R. Abraham>
Sent:
Thursday, May 26, 2011 11:47 AM
To:
[hidden email]
Subject:
Look-up Values



Hello,

I was wondering if someone can help with this problem. I have a variable 'Age' which has several missing values. I was to fill the missing value with the mean of Age for each category of another variable.


Eg.
Income                Mean of Age

0-25K                25

25K-45K        30

45K-60K        40

60K+                45


So if 'Age' is 'missing', and 'Income' is '25K-45K', fill the missing Age with the mean value of Age i.e. 30.


I know to do this in SAS, but I would like to do the same in spss. Is there anyone who has the syntax to do this, or point me to some solution.


Thanks.

R. Abraham