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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started