The following problem will use the sashelp.baseball data set that is already in SAS
Write a SAS macro called descripstat that will calculate a descriptive statistic for a variable, in an arbitrary SAS data set. The statistic, the variable, and the name of the data set should be macro parameters. The descriptive statistic should be one that can be calculated by PROC MEANS. Have the macro include a title on the output that describes exactly what is being calculated. [Hint: You may want to look at the PROC MEANS help files in the online SAS help documentation.]
SAS PROGRAM
/* to create a macro */
%macro analysis(ds=,vars=,stats=);
proc means data=&ds &stats ;
var &vars;
run;
%mend;
/*to call a macro *?
%analysis(ds=sashelp.baseball,vars= nHits nHome,stats=N NMiss mean std min Max Q1 Median Q3 )
The following problem will use the sashelp.baseball data set that is already in SAS Write a...
Write a SAS macro called descripstat that will calculate a descriptive statistic for a variable, in an arbitrary SAS data set. The statistic, the variable, and the name of the data set should be macro parameters. The descriptive statistic should be one that can be calculated by PROC MEANS. Have the macro include a title on the output that describes exactly what is being calculated.
Which of the following SAS programs would NOT create a SAS data set consisting only of observations with the variable color equal to red? (The answer is not C I am getting the question wrong. Please help a. DATA favorites (WHERE=(color='red')); SET class; RUN; b. DATA favorites; SET class; IF color = 'red'; RUN; c. All of these programs create a SAS data set consisting only of observations where color is equal to red. d. PROC PRINT DATA=class; WHERE color='red';...
Run this program to create a permanent SAS data set called Survey2007. Close your SAS session, open up a new session, and write the statements necessary to compute the mean age. * Write your LIBNAME statement here; data –fill in your data set name here- ; input Age Gender $ (Ques1-Ques5)($1.); /* See Chapter 21, Section 14 for a discussion of variable lists and format lists used above */ datalines; M 15243 30 F 111 42 M 23555 48 F...
HELP WITH SAS Run the following DATA step to create a SAS data set called ABC_CORP. Create a new sas data set called AGES that contains all the variables in ABC_CORP plus three new variables. One is AGE_ACTUAL, which is the exact age from DOB to January 15, 2005. The second is AGE_TODAY, which is the age as of the date the program is run, rounded to the nearest tenth of the year. The third is AGE, with the fractional...
Copy/paste this data on online orders into SAS. Write a program that will read it including date informats; create a variable, called WaitTime, that is the number of days between Order and Delivery. Use an IF statement to give a value of 0 if the Delivery date is missing; recode the categories of method of payment, changing C to Credit and P to Paypal; print the data set using a different date format than the informat; and do proc means...
SAS code for problem:
title 'grocery questions';
data a; /* This data set will be a temporary sas file with
name
'a' . In this example we don't need to refer to this
name as if there is only one temporary sas file in use,
any procedure will automatically use it. */
input y x1 x2 x3 ; /* names input variables */
cards;
4264 305657 7.17 0
4496 328476 6.2 0
4317 317164 4.61 0
4292 366745 7.02 0...
Hi! I know I don't include the data set I am working with in SAS 9.4, but I was wondering if someone could show me an example as to how this would look. I know from the directions that I am supposed to have an output statement, but I'm honestly not sure how to find the min, median, mean, and max using proc univariate. Any help would be appreciated. 4. Use a procedure to create summary statistics for the working...
Learn how to use the advanced data structures (such as: list, tuple, string, dictionary, and set) · Learn and practice how to use functions. · Learn and practice how to use file I/Os. · Appreciate the importance of data validations. · Provide appropriate documentation and good programming style. Python Programming Description of the problem: Write a “censor” program that first reads a file with “bad words” such as “sex”, “drug”, “rape”, “kill”, and so on, places them in a set, and then reads an...
(8 points) Read the data contained in the
question01.dat file
directly from the data file into a
temporary SAS data set called question01.
The data in each record are in order: golf course (name),
number of holes (holes), par (par), total yardage
(yardage), and greens fees (fees). Print the
resulting SAS data set ensuring that the output is centered, your
page size is no larger than 58 lines, and the linesize no longer
than 80 characters. When you print the...