0% found this document useful (0 votes)
47 views7 pages

Task 1

This document uses SAS procedures like PROC UNIVARIATE and PROC REG to analyze a dataset on body mass index (BMI). The PROC UNIVARIATE procedure shows the BMI data is normally distributed. PROC REG then examines the linear relationship between BMI and other variables, finding the model is significant and there is no multicollinearity. Finally, PROC SQL is used to summarize the BMI data by classifying each observation as obese, overweight, normal or underweight based on BMI thresholds, and sorting the results by gender.

Uploaded by

Ikhram Johari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views7 pages

Task 1

This document uses SAS procedures like PROC UNIVARIATE and PROC REG to analyze a dataset on body mass index (BMI). The PROC UNIVARIATE procedure shows the BMI data is normally distributed. PROC REG then examines the linear relationship between BMI and other variables, finding the model is significant and there is no multicollinearity. Finally, PROC SQL is used to summarize the BMI data by classifying each observation as obese, overweight, normal or underweight based on BMI thresholds, and sorting the results by gender.

Uploaded by

Ikhram Johari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

TASK 1

QUESTION Using the dataset from group assignment: a) Based on your creativity by using appropriate procedure, produce short Report. (Hint: You can choose Proc TTEST, Proc ANOVA, Proc GLM, Proc REG, Proc CORR etc)

In task 1, the PROC UNIVARIATE procedure with PROBPLOT statement is used in order to test for normality of the body mass index (BMI).
proc univariate data=hayatul.bmi plots; probplot BMI; run;

The figure above shows that the BMI data are normally distributed. This is due to the points on plot that form a linear pattern. Therefore we can conclude that the normality assumption is satisfied. Since the data is normally distributed, we have proceeded with PROC REG procedure. In this procedure we wish to study the linear relationship, the significance of the model and also the existence of multicollinearity .
proc reg data=hayatul.bmi; var BMI; model BMI=REG_ID AGE HT WT PULSE SYS DIAS CHOL /r vif tol; run;

The table below shows that the model is significant since it give the p-value ( <0.0001 ) which is less than alpha 0.05. Besides, we also can concluded that the total variation of the model is 99.35% which explained by the variables.

In order to investigate the multicollinearity, from the table below,we have found that theres no multicollinearity exist in this model. This is due to the value of VIF for each variable is less than 10 and the value of Tolerence that more 0.2.

b) Produce the short Report using SAS macro based on your creativity. ( Hint: You can refer the notes - SAS Macro Programming)

c) From question 1, produce Report using SAS Macro Programming as follows :

i.

SUBSTITUTING TEXT WITH %LET


%let genclass1=Female; proc print data=hayatul.bmi noobs; where GENDER="&genclass1"; title ' The Body Mass Index(BMI) For Female Patients'; run;

%let genclass1=Female; proc print data=hayatul.bmi noobs; where GENDER="&genclass1"; title ' The Body Mass Index(BMI) For Female Patients'; run;

ii. iii.

CREATING MODULAR CODE WITH MACROS ADDING PARAMETERS TO MACROS

d) Based on your creativity, summarize the report using proc SQL.

Note: You can refer from SAS macro programming notes. We wish to summarize the in term ..
proc sql; create table BMI as select NAME,GENDER,AGE,BMI, case when BMI gt 30 then 'Obese' when 30 ge BMI ge 25 then 'Overweight' when 25 ge BMI ge 18.5 then 'Normal' else 'Underweight' end as RESULT from hayatul.bmi order by GENDER; quit; proc sql; select NAME,GENDER,AGE,BMI,RESULT from BMI order by GENDER; quit;

You might also like