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; |
Question:------- -Which of the following SAS programs would NOT create a SAS data set consisting only of observations with the variable color equal to red?
Answer:---------
b.
DATA favorites;
SET class;
IF color = 'red';
RUN;
Which of the following SAS programs would NOT create a SAS data set consisting only of...
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...
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:...
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...
1. The following problem uses the SAS sashelp.baseball data set. Create a SAS code to... (a) Write a program that will automatically select the first 50 even-numbered observations in the data set (i.e., the 2nd, 4th, 6th, ..., 100th observations). Calculate and report the sample mean Home Runs (nHome) for this selected systematic sample. (b) Write a program that will randomly select 50 observations (WITH replacement) in the data set.
1. The following problem uses the SAS sashelp.baseball data set. Create a SAS code to... (a) Calculate and report the mean number of Home Runs (nHome) for all the observations in the entire data set. Call this number the "population mean" Home Runs. (b) Write a program that will automatically select the first 50 odd-numbered observations in the data set (i.e., the 1st, 3rd, 5th, ..., 99th observations). Calculate and report the sample mean Home Runs (nHome) for this selected...
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...
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...
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...
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...
(use TUKEY for the multiple
comparisons)
Create a SAS data set by reading these data. As an interesting exercise, try reading three lines like this: 7.2 Two cholesterol-lowering medications (statins) and a placebo were given to each of 10 volunteers with total cholesterol readings of 240 or higher. After 6 weeks, the following total cholesterol values were recorded: Statin A: 220 190 180 185 210 170 178 200 177 189 Statin B: 160 168 178 200 172 155 159 167...