Question

1. Write a SAS program to create a SAS dataset BIG which has 100 observations of...

1. Write a SAS program to create a SAS dataset BIG which has 100 observations of X=INT(RANUNI(0)*100+1). Print X values only from the dataset BIG.

2. Use the dataset BIG to create a 5% random samlple called SMALL. Solve this problem with an approximate solution using a teset with IF statement for the value of a random variable.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

DATA BIG;
   DO SUBJ = 0 TO 100 ;
      X=INT(RANUNI(0)*100+1);
      OUTPUT;
   END;
RUN;

%LET X = 4; DATA EVERY_X;
   SET BIG;
   IF MOD(_X_ ,&X) = 1;

RUN;

PROC PRINT DATA=EVERY_X NOOBS;
   TITLE "Listing of Data Set EVERY_X";

RUN;

Add a comment
Know the answer?
Add Answer to:
1. Write a SAS program to create a SAS dataset BIG which has 100 observations of...
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
  • solve it by SAS plz, thanks 1. Create the follow dataset, named work.xy, using a datalines...

    solve it by SAS plz, thanks 1. Create the follow dataset, named work.xy, using a datalines statement x y 5 11.1 5 0.1 8 114.4 6 12.2 6 2.2 7 13.3 8 14.4 (a) Create a new dataset, named work.xyz, which contains a calculated variable z which multiplies x times y. (b) Print the rows of the dataset where z is at least 50. Include a title 'Elevated z values' 1. Create the follow dataset, named work.xy, using a datalines...

  • use SAS to solve it plz 2. Create the following dataset, named work.xw, using a datalines...

    use SAS to solve it plz 2. Create the following dataset, named work.xw, using a datalines statement 5 a 6 b 7 b 9 z 8 a 9 e 2 f Prepare a printed report which (a) displays the rows of the dataset where w is a or b (b) displays the title 'Listing Report (c) uses column headings 'Explanatory variable' for x and 'Category' for w 2. Create the following dataset, named work.xw, using a datalines statement 5 a...

  • 1. The following problem uses the SAS sashelp.baseball data set. Create a SAS code to... (a) Writ...

    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.

  • Write a simple Java program with the following naming structure: Open Eclipse Create a workspace called...

    Write a simple Java program with the following naming structure: Open Eclipse Create a workspace called hw1 Create a project called hw1 (make sure you select the “Use project folder as root for sources and class files”) Create a class called Hw1 in the hw1 package (make sure you check the box that auto creates the main method). Add a comment to the main that includes your name Write code that demonstrates the use of each of the following basic...

  • Write a program in C that creates an array of 100 random numbers from 0-99. The...

    Write a program in C that creates an array of 100 random numbers from 0-99. The program sums the random numbers and prints the sum.  It then writes the numbers to a new file using open, close and write. Then looks in the current directory for files that match the pattern “numbers.XXXX”. For each file, open the file and read the file. You can assume that the file will contain 100 integers. Sum the integers. Print the filename and the sum...

  • 1. The following problem uses the SAS sashelp.baseball data set. Create a SAS code to... (a) Calc...

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

  • Run this program to create a permanent SAS data set called Survey2007. Close your SAS session,...

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

  • C++ 2) Create a program that does all of the following: Create 100 random int numbers...

    C++ 2) Create a program that does all of the following: Create 100 random int numbers from 48-84 Puts them in an array called height Counts how many of each there were Sorts the numbers from high to low If short 48-60, average- 61-70, tall- 71-74 and big is any them above 84, count how many is each group Print the results from the last part as a bar graph short average tall big

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

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

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