Question: PLEASE HELP ME WRITE IT ON SAS DEMAND PLEASE SAS Program. Please write the full code! Assignment: -Generate box plots of mortality and water hardness

PLEASE HELP ME WRITE IT ON SAS DEMAND PLEASE

SAS Program. Please write the full code!

Assignment:

-Generate box plots of mortality and water hardness by location (use proc boxplot).

-Use proc univariate to compare the distribution of water hardness to the log normal and exponential distributions.

-Produce histograms of both mortality and water hardness with, in each case, a kernel density estimate of the variables' distribution superimposed.

-Produce separate surface plots of the estimated bivariate densities of northern and southern towns.

-Reproduce the scatterplot in display 2.10 with added linear regression fits of mortality and hardness for both northern and southern towns.

I wrote these 2 codes and it didn't work:

1st

proc boxplot data=sashelp.heart; plot mortality*hardness; run; proc univariate data=sashelp.heart; var hardness; histogram hardness / normal(mu=mean(hardness),sigma=std(hardness)); fit lognormal hardness / distribution(Lognormal); fit exponential hardness / distribution(Exponential); run; proc univariate data=sashelp.heart; histogram mortality / kernel; histogram hardness / kernel; run;

2nd:

proc format;

value $location

'N' = 'Northern'

'S' = 'Southern';

run;

data Mortality;

set 'path/to/mortality.dat';

format Location $location.;

run;

proc boxplot data=Mortality;

plot Mortality*Location / boxstyle=schematic nooutliers;

run;

proc univariate data=Mortality;

var Hardness;

histogram Hardness / normal(mu=mean(Hardness)) exponential(scale=1/mean(Hardness));

run;

proc kde data=Mortality;

bivar Mortality Hardness / plots=surface;

run;

proc sgplot data=Mortality;

scatter x=Hardness y=Mortality;

fit y=Hardness / group=Location;

run;

PLEASE HELP ME WRITE IT ON SAS DEMAND PLEASE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!