TITLE "HOMEWORK 7"; OPTIONS nodate PAGENO=1; /*Question 1*/ libname labdata "c:\temp\labdata"; DATA temp; set labdata.afifi; if survive=3 then died = 1; if survive=1 then died = 0; RUN; title "Question 1"; proc freq data=temp; tables survive died ; run; proc means data=temp; class died; run; /*Question 2*/ title "Question 2"; proc freq; tables shoktype * died / chisq; run; /*Question 3*/ proc logistic descending; class shoktype / param=ref ref=first ; model died = shoktype / rsquare; run; /*Question 4*/ proc logistic descending; model died = urine1 / rsquare ; units urine1 = 1 10 50; run; /*Question 5*/ proc logistic descending; class shoktype / param=ref ref=first; model died = shoktype urine1 / rsquare ; run; /*logistic regression using Proc Genmod*/ proc genmod descending; class shoktype / ref=first; model died = shoktype urine1 / dist=bin type3; run; /*Question 6*/ proc logistic descending; class shoktype / param=ref ref=first; model died = shoktype urine1 sbp1 dbp1 map1 cvp1 cardiac1 bsa1 sex age/ rsquare selection=stepwise; run; proc logistic descending; class shoktype / param=ref ref=first; model died = shoktype cvp1 bsa1/ rsquare; units bsa1 = 1 .10 cvp1 = 1 2; run;