AddHealth Wave IV UnivariateThis assignment asks you to explore the AddHealth (National Longitudinal Study of Adolescent to Adult
Health) data set for the fourth wave (interviews conducted among observational units that were between 24
and 32 years of age).
The Wave IV data explorer can be used to access the data codebook or the pdf from class.
In this assignment you are asked to choose one variable to study.
AddHealth Wave IV Univariate
Paste in a copy of the SAS code used to access the AddHealth data set and clean, rename, and format (cat) the
data for your variable.
AddHealth Wave IV Univariate
Paste in a copy of the SAS code used to produce a frequency table (cat) or means table (quant) for your variable.
AddHealth Wave IV Univariate
Paste in a copy of the SAS code used to produce a bar graph and pie chart (cat) or histogram and boxplot (quant)
for your variable.
AddHealth Wave IV Univariate
Paste in the bar graph and pie chart (cat) or histogram and boxplot (quant) for your variable.
AddHealth Wave IV Univariate
Discuss your results using language from OLI Mod 6.
Introduction to (real) data analysis.
Please open the AddHealth Wave IV codebook ✓.
This is a catalog of the data set produced from a longitudinal social survey of the US population in its fourth phase □
(covering observational units aged 24 – 32). In it you will find a variety of variables including demographics, religious
beliefs, drug and alcohol use, sexual behavior, family relationships, psychological history, and others.
1. Please review the codebook and select one variable to examine. Record the variable name (it should be something
of the form H4xxxx) and note whether it is categorical or quantitative. Note that most variables are categorical in
this set – beware some that look quantitative but are really categorical.
• This video models how to proceed with this assignment if you select a categorical variable .
• This video models how to proceed if you select a quantitative variable.
2. Go to SAS Studio and open a new program.
3. Enter the following lines of code at the top:
LIBNAME mydata “~/my_shared_file_links/freedmanj0” access=readonly;
DATA new; SET mydata.addhealth4wdemographics;
4. Now return to the codebook and note the values associated with responses we don’t want (legitimate skip,
refused, don’t know – usually 6, 7, 8 or 96, 97, 98, or 996, 997, 998) clean your data by using the code below as a
template (replace CODEVARIABLE with the codebook variable you chose):
IF CODEVARIABLE GE 6 THEN CODEVARIABLE = .; /** refused to answer = ignore **/
5. Now rename your variable (in order to avoid confusion and make it more reflective of the original survey question).
Use the example below as a template (replace CODEVARIABLE with the codebook variable you chose and replace
VARIABLE with the name you choose to represent your variable for example:
RENAME H4GH6 = CURRENT_WEIGHT;
note that variable names have to be continuous characters – no spaces :5. Now rename your variable (in order to avoid confusion and make it more reflective of the original survey question).
Use the example below as a template (replace CODEVARIABLE with the codebook variable you chose and replace
VARIABLE with the name you choose to represent your variable for example:
RENAME H4GH6 = CURRENT_WEIGHT;
– note that variable names have to be continuous characters – no spaces:
RENAME CODEVARIABLE = VARIABLE;
6. If your variable is categorical, then you will also want to reformat it – replacing coded responses (0, 1, 2, …) with the
original survey values. (See the program AddHealth4TestDrive1.sas for format samples to copy and paste or use
the example below as a template).
PROC FORMAT;
VALUE SCALE /* name for formatting variable*/
RUN;
1 = “Strongly Agree”
2 = “Agree”
3 = “Neither agree nor disagree”
4 = “Disagree”
5 = “Strongly Disagree”
7. Now produce summary statistics for your renamed variable (where VARIABLE is written replace it with your
renamed variable, where FORMAT_VARIABLE is written, replace it with your format variable – be sure to include
the period at the end).
。 If your variable is categorical you will want a frequency table:
PROC FREQ;
TABLES VARIABLE;
FORMAT VARIABLE FORMAT_VARIABLE.;7. Now produce summary statistics for your renamed variable (where VARIABLE is written replace it with your
renamed variable, where FORMAT_VARIABLE is written, replace it with your format variable – be sure to include
the period at the end).
。 If your variable is categorical you will want a frequency table:
PROC FREQ;
TABLES VARIABLE;
FORMAT VARIABLE FORMAT_VARIABLE.;
RUN;
• If your variable is quantitative you will want a means table:
PROC MEANS data=new N MEAN STD MIN Q1 MEDIAN Q3 MAX maxdec=2;
VAR VARIABLE;
RUN;
8. Produce a graph for your variable.
。 If your variable is categorical, use the code below as a template to produce a pie chart and a bar graph.
goptions reset-pattern;
pattern1 vs c=red;
pattern2 vs c=cyan;
PROC GCHART data=new;
TITLE “Pie: variable description”;
PIE VARIABLE/discrete percent-inside value-inside;
FORMAT VARIABLE FORMAT_VARIABLE. ;
RUN;
PROC SGPLOT data=new;
TITLE “Bar Graph: variable description”;pattern1 vs c=red;
pattern2 vs c=cyan;
PROC GCHART data=new;
TITLE “Pie: variable description”;
PIE VARIABLE/discrete percent=inside value=inside;
FORMAT VARIABLE FORMAT_VARIABLE. ;
RUN;
PROC SGPLOT data=new;
TITLE “Bar Graph: variable description”;
FORMAT VARIABLE FORMAT_VARIABLE. ; /* assigns survey values to VARIABLE output*/
VBAR VARIABLE; /* Produces vertical bar graph of the variable DIST_MOTHER */
RUN;
。 If your variable is quantitative use the code below as a template (note the bin width and x-axis scale) to produce
a histogram and boxplot.
PROC SGPLOT data=new;
TITLE “Histogram for variable description”;
HISTOGRAM VARIABLE / scale=count binwidth=1 binstart=0 datalabel=count ;
XAXIS VALUES=(0 to 10 by 1);
RUN;
PROC SGPLOT data
= new;
TITLE “Box Plot: variable description”;
VBOX VARIABLE;
RUN;
9. Save your program as AddHealth_Univariate to your folder.
10. Now use this slide deck to record and discuss your results using language from OLI Mod 6.
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Achiever Papers is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Dissertation Writing Service Works
First, you will need to complete an order form. It's not difficult but, if anything is unclear, you may always chat with us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order formOnce we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignmentAs soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download