Question: There are the steps you should take: 1 . 1 0 Variables - Reduce the number of variables you are working with to include only
There are the steps you should take:
Variables Reduce the number of variables you are working with to include only the following:
a The full dataset has about variables in it Reduce it to variables. I have chosen variables and I want you to choose others. The reduction is done in a data step. See the starter SAS code at the end. Note, your other variables should not be the same as others in the class. Choose your own. You would be working independently on this project.
b Must include these variables.
i Dmage mothers age
ii Dfage fathers age
iii. Dbirwt childs birthweight in grams
iv Meduc mothers education in years, high school
v Gestat Gestational Age in weeks
c Choose others from these:
i Mrace mothers race is white, is black, other
ii Frace fathers race is white, is black, other
iii. Dmar married yes single
iv Dlivord delivered order mothers first child, mothers second child
v Nprevist number of prenatal visits
vi Csex Childs operatornamesex female
vii. Primac Csection yes
viii. Tobacco tobacco use yes
ix Alcohol alcohol use yes
x Wtgain weight gain
xi Fmaps minutes Apgar score
When you are done with this step, you should have all the data for only variables.
Remove missing data.
Once you have reduced the dataset to variables. Remove the missing data for each variable. When doing this step, document each step with comments in the SAS code before the Data Step I want to see how you removed records with missing data from each step. For instance, let's say there were observations before you started reducing records with missing data. Let's take mothers' age and remove all mothers' ages that are missing. Let's say that records had missing mothers' age. Your reduced dataset for this first step would be
observations remaining. Put a comment in your code prior to the data step that describes how records were removed for each variable. Do this for all other variables you have chosen.
When you are done with this step, you should have one total data step which includes the code used to reduce the dataset from variables to variables and each of the step needed to remove all the records with missing data. Note usually means missing data for most of these variables. Ask if you are sure on what values should be considered missing.
Recode section.
a Dmage mothers age create new variable called MotherAG in to different age groups. You choose the age groups breakdown.
b Dfage fathers age same thing for this variable
c Meduc mothers education in years recode something that makes sense to you. I don't care how you picked the agegroup years. Im only interested in how you coded what you chose. Call this new variable MotherEd.
d Dbirwt childs weight in grams create a new variable LBW low birther weight If the dbirwt is under then LBW yes, no
e Gestat gestational age in weeks create new variable called FullTerm yes if or more weeks, code no otherwise
f Look at the other variables you choose and recode any variable with more than levels. Choose something that makes sense.
g Document these changes as comments in your SAS code
When you are done with this section, you should have one data step that includes everything so far. the reduction of variables, removal of missing data and now all recoding of variables.
Add labels of your choice to all variables. Add comments to describe your work.
Add formats of your choice to all variables. Add comments to describe your work.
Removed unnecessary variables.
my variables are;
;dmage mothers age;
dfage fathers age;
dbirwt childs weight;
meduc mothers education;
'gestat gestational age;
Nprevistnumber of prenatal visits;
Csex Childs sex female;
Tobacco tobacco use yes;
Wtgain weight gain;
Fmaps minutes Apgar score;
Step : Reduce dataset to variables
lata project.one;
set project.lbidc;
keep Dmage Dfage Dbirwt Meduc Gestat Nprevist Csex Tobacco Wtgain Fmaps;
run;
Step : Remove records with missing Dmage indicates missing
records removed
lata project.one;
set project.lbidc;
where Dmage ne ;
run;
Step : Remove records with missing Dfage
records removed
lata project.one;
set project.lbidc;
where Dfage ne ;
un;
Step : Remove records with missing Dbirwt
records removed
lata project.one;
set project.lbidc ;
where Dbirwt ne ;
un;
This sas code is the code I have started but I am having a rough time keeping it going
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
