Question: The following SAS program inputs information about hospitals in cities in different states, such as the size of the state and the cities (i.e., population),

The following SAS program inputs information about hospitals in cities in different states, such as the size of the state and the cities (i.e., population), median income and median housing costs, the number of admissions, and the number of beds, using three different data types 1, 2, and 3. Answer the questions below:

data hospital;

retain Form_Id State Stpop CitySize Income Housing Admit Beds;

input Form_Id $3. @5 Type $1. @ ;

if Type =‘1’ then input @8 State $2. Stpop 10.;

if Type =‘2’ then do;

input @8 CityPop 8. Income 5. Housing 6.;

if CityPop<60000 then CitySize=’Small’;

else CitySize=’Large’;

end;

if Type =‘3’ then do;

input @8 Admit 6. Beds 4.;

output;

end;

drop Type CityPop;

datalines;

v12 1 IA 1708232 v12 2 53620 5240 14236 v12 3 5126 178 v12 3 3364 134 v12 3 4857 184 v12 1 KS 1575899 v12 2 86610 4879 18154 v12 3 3916 156 v12 3 5527 182 v12 3 12139 351 v12 3 8257 238 v12 2 36574 3754 12739 v12 3 3465 112 v12 3 4576 142

;

proc print;

run;

proc means data=hospital noprint;

class State CitySize;

var Admit Beds;

output out=stats mean= Av_Adms Av_Beds std=S_Adms S_Beds ;

run;

proc print data=stats;

run;

a. Show the contents of the PDV immediately after processing the first line of data.

b. Show the contents of the PDV immediately after processing the second line of data.

c. Show the contents of the PDV immediately after processing the third line of data.

d. Show the contents of the PDV immediately after processing the fifth line of data (before the observation is output to the SAS data set).

e. Display the first observation written to the SAS data set.

f. Run this program and turn-in the output only.

g. Examine the output produced by the second proc print step. Describe the statistics printed in each line of this output, i.e., explain what the computed numbers are in each line. Make sure that, for each value of the TYPE variable, you identify the group of observations used to compute the statistics that appear in that line.

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 Categorical Data Analysis Questions!