Question: Write a SAS program to do the following: Create a temporary dataset named Smoking_Data that uses SASHELP.HEART to get the data Do not bring the
Write a SAS program to do the following:
Create a temporary dataset named Smoking_Data that uses SASHELP.HEART to get the data
Do not bring the following variables from the SASHELP.HEART dataset
Smoking_Status Diastolic Systolic MRW Cholesterol Chol_Status BP_Status Height Weight Weight_Status Smoking_Data dataset should not contain the AgeAtDeath, DeathCause and Status variables.
Include only the observations where Status=Alive in the Smoking_Data
If the AgeCHDdiag variable has a missing value, then do not include the value in Smoking_Data Create a new variable Smoking_Status, set its length to 17 characters, and use the following criteria:
If the value of Smoking is between 0 and less than 6, then Smoking_Status is "None". If the value of Smoking is between 6 and 15 inclusively, then Smoking_Status is "Moderate" If the value of Smoking is between 16 and 25 inclusively, then Smoking_Status is "Heavy" If the value of Smoking is greater than 25, then Smoking_Status is "Very Heavy" If there are any other values for the variable Smoking, set Smoking_Status to "Error" Create a two-way frequency table using variables Sex and Smoking_Status and answer the following questions:
What is the percentage of Heavy Male Smokers? What is the percentage of Moderate Female Smokers?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
