The following SAS Code has errors. Correct the code: Data=HW.Names; input Name Age amounts; Datalines; John 67.66 100 Susan 24.60 200 Danny 34.50 100 Joe 32.32 120 Mary 82.25 50 Carol 30.24 100; run; title "Listing of Variables in the data set"; proc print data=HW.Names; run; title "Proc Means for the variable Age"; proc means data=HW.Names; by Age; run;
- The following SAS Code has errors. Correct the code:
Data=HW.Names;
input Name Age amounts;
Datalines;
John 67.66 100
Susan 24.60 200
Danny 34.50 100
Joe 32.32 120
Mary 82.25 50
Carol 30.24 100;
run;
title "Listing of Variables in the data set";
proc print data=HW.Names;
run;
title "Proc Means for the variable Age";
proc means data=HW.Names;
by Age;
run;
- Start.
Create a dataset named "HW.Names."
Define three variables within the dataset: "Name" (character), "Age" (numeric), and "Amounts" (numeric).
Use the
datalines
statement to specify the data values for the dataset. The data values are entered row by row.Define a title for the output displaying the variables in the dataset.
Use the
proc print
procedure to display a listing of all variables in the "HW.Names" dataset.Define a new title for the output displaying summary statistics for the "Age" variable.
Use the
proc means
procedure to calculate the mean of the "Age" variable.End the
run
statement to execute each procedure.- End.
Step by step
Solved in 4 steps with 1 images