BookmarkSubscribeRSS Feed
graingerad12
Calcite | Level 5

Hello. I need help with an assignment that I am working on. The instructions are as follows:

 

Instructions:

Extract and download CPS data from IPUMS site onto your computer

https://cps.ipums.org/cps-action/variables/group

save the data file as SAS data set.

You will need to choose the following variables to include in your extract:

 

Person Record

 

Core Demographic Variables

AGE Age

SEX Gender

RACE Race

MARST Marital status

Ethnicity/Nativity Variables

NATIVITY Foreign birthplace or parentage

HISPAN Hispanic origin

Education Variables

EDUC99 Educational attainment, 1990 categories

Work Variables

WKSWORK1 Weeks worked last year

UHRSWORK Usual hours worked per week last year
UNION Union status
PTWEEKS Weeks working part time last year

Income Variables
INCWAGE Wage and salary income

 Process the CPS raw data using SAS to get it ready to analyze statistically. The following data processing steps are necessary before going on to step 3:

Drop observations for all non-wage earners.

Generate a new variable for the natural log of earnings from INCWAGE variable.

Generate a new variable for years of education using EDUC99 variable.

Generate a new variable for experience using AGE and EDUC99 variables.

Generate dummy variables for each of the following categories:

1) Gender

2) Race/Ethnicity

3) Nativity

4) Marital Status

5) Union Status

 

I need help with the question that says "generate a new variable for experience using AGE and EDUC99 variables. 

I have attached in a word document that SAS code that I have so far (which also defines all the variables).

2 REPLIES 2
ballardw
Super User

The techniques are exactly the same a mentioned in reponses to your other post. The "difference" is the assignment involves an "AND" condition:

In a datastep something like:

 

If age le 12 and EDUC99 = <somevalue> then Experience = <what ever you want to assign>;

 

Ranges considered and assigned should be part of the coursework involved.

 

Reeza
Super User

 

Please simplify your your code to only the relevant sections. 

 

This is your third question in the assignment so your basically asking each one at a time. Please attempt them first otherwise you won't learn anything.  Many people are more than happy to help but to get the most out of your course you should try and learn it. 

 

If you need learning resources - Google SAS UCLA Intro or see SAS Analytics U community forum for free training from SAS including ecourses and YouTube tutorials. 

 

Most of your assignment require if then statements. 

 

See this page on how they work. 

http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/SAS/SAS-Basics1/SAS-Basics16.html

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 945 views
  • 0 likes
  • 3 in conversation