Question

Write a SAS macro called descripstat that will calculate a descriptive statistic for a variable, in...

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.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Following code will give a macro to get the specified statistic from PROC MEANS.

If we need to calculate mean for the variable age from the data set class1 then the above macro is called as below

%descripstat(statistic=mean,varname=age,dataname=class1);

Add a comment
Know the answer?
Add Answer to:
Write a SAS macro called descripstat that will calculate a descriptive statistic for a variable, in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • SAS BASE PROGRAMMING Q proc contents data-data1.admit; run; Select one: a. Creates a report containing summary...

    SAS BASE PROGRAMMING Q proc contents data-data1.admit; run; Select one: a. Creates a report containing summary statistics b. Creates a report containing status messages regarding execution c. Creates a report containing the variable attributes O d. Creates a report containing the observations data NULL; Select one: a. Instructs SAS to write output to the NULL data set in the work library. b. None of the other choices C. Instructs SAS to write output without creating a data set. d. Is...

  • 14. Write a SAS program to do the following tasks in order. You must label each...

    14. Write a SAS program to do the following tasks in order. You must label each question in the program by using comment statement like /* Q14a */ on the line where your answers to Q14a begin. a.   Define the Library Q14A using LIBNAME statement to connect to the SASData folder inside STA575 folder on the U-drive. b.   Define the Library Q14B using LIBNAME statement to connect to a new folder Q14DATA inside STA575 folder on the U-drive. Create a...

  • Statistics Macro Assignment Write a macro to find the number of observations, max, min, sum, aver...

    Statistics Macro Assignment Write a macro to find the number of observations, max, min, sum, average and standard deviation for a column of numbers with any number of observations starting in cell A1 and proceeding downward. The number set will be of any length and include negative, zero, and positive integers. Display the results as shown below. Use the numbers below as an example. You may use the key board code “Selection.End(xlDown).Select” if you wish. Otherwise, use only VBA code...

  • Copy/paste this data on online orders into SAS. Write a program that will read it including...

    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...

  • USING MATLAB...Write a function that creates a structure variable called createSpacecraft. The function should take four...

    USING MATLAB...Write a function that creates a structure variable called createSpacecraft. The function should take four inputs, a number called mass (in kg), a number called fuel (in joules of energy), a number called orbit (in meters), and a number called engine (in newtons). It should return an output structure called spacecraft containing each of those values. Please ensure that both the function name, AND the names of variables within the spacecraft structure are exactly as instructed

  • C++ Assignment: Create a class called FitnessMember that has only one variable, called name. The FitnessMember...

    C++ Assignment: Create a class called FitnessMember that has only one variable, called name. The FitnessMember class should have a constructor with no parameters, a constructor with a parameter, a mutator function and an accessor function. Also, include a function to display the name. Define a class called Athlete which is derived from FitnessMember. An Athlete record has the Athlete's name (defined in the FitnessMember class), ID number of type String and integer number of training days. Define a class...

  • C++, entry level no pointers or vectors. Write a class called Person that has two data...

    C++, entry level no pointers or vectors. Write a class called Person that has two data members - a string variable called name and a double variable called age. It should have a constructor that takes two values and uses them to initialize the data members. It should have get methods for both data members (getName and getAge), but doesn't need any set methods. Write a separate function (not part of the Person class) called stdDev that takes two parameters...

  • SAS code for problem: title 'grocery questions'; data a; /* This data set will be a temporary sas...

    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...

  • Write an entire class called Movie that stores an instance variable named title for the title...

    Write an entire class called Movie that stores an instance variable named title for the title of the movie as a string. Write the corresponding getter and setter methods (getTitle, setTitle), and a constructor that takes one parameter (string for the title). Include both the class definition and method definitions! Be sure to use appropriate visibility modifiers. Assume all includes and using namespace std are already in the file. Do not try to make header files.

  • MUST BE DONE IN MATLAB! Test inputs Write a function called CheckInputs which checks if three...

    MUST BE DONE IN MATLAB! Test inputs Write a function called CheckInputs which checks if three inputs parameters are the correct data types. The first second, and third input variables must be a string, numeric, and logical data type, respectively. The output of Checkinputs should be a logical row array, errorCode with 4 values If all the tests pass, then errorCode should consist of only false values. If the 1st input parameter is not a string, the 1st array element...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT