Follow up to highest education IHIS question

Hi,

I greatly appreciate your help in answering my questions on IHIS. I have a follow-up question to your answer on my “IHIS: Highest family educ variable and Family number variable” question.

You mentioned that it was quite easy to obtain the max education number from EDUC, and I would really appreciate if you could elaborate on this. I have been having difficulty with creating a data table from the IHIS data set where each SERIAL number would only have the max education number under the education column.

I have tried to use a proc SQL code, as shown below - however, the table that is produced from the code contains strange SERIAL numbers (for example, in the original dataset it appeared that the smallest SERIAL was 8 - but in the new dataset the smallest SERIAL was 1) and the proper SERIAL numbers did not contain the max education value based on the previous data set.

Thank you very much!

proc SQL ;

createtable IPUMS.B asselect SERIAL, EDUC

from IPUMS.ihis_00020

where 0 <EDUC< 90

grouped by SERIAL

having EDUC=max(EDUC);

There are likely multiple ways to retrieve the maximum EDUC value by SERIAL. I used the following code:

proc means data=YOUR.data noprint max nway missing;
class serial;
var educ;
output out=educ_max (drop=_type_ _freq_) max=;
run;

I hope this helps.