lab1_exercises
docx
keyboard_arrow_up
School
University of Southern California *
*We aren’t endorsed by this school
Course
MISC
Subject
Statistics
Date
Apr 3, 2024
Type
docx
Pages
7
Uploaded by MegaElkPerson49
Lab #1 Exercises
All ASCII datasets referenced below are located in the Lab Datasets folder in the Course Resources section of Canvas. Please provide all relevant code and output to receive full credit for the lab.
1)
Answer the following problems from Exercises and Project for The Little SAS Book: Chapter 6: Questions Q2. B. BY
Q4. C. 4
Q6. C, A Note
Q14. C. IN=
Q20. DATA class1;
MERGE one class2;
BY stuname stuid finalscore;
PROC PRINT data= classwhole; RUN;
Proc Means Data = classwhole;
Var;
Run;
Q22. If one data set contains data for different months. It would be better to stack the data set on each other because the data is in the order of months
Q26. The FIRST.Gender command will display a value of 1 the first time that SAS reads the value of either gender and will display a value of 0 every other time. While the FIRST.Height command will tell SAS to display a value of 1 for each unique value of height unique means the first time SAS reads a new value for the variable height. Such as seen below:
Name
JoAnn F 64 1 1
Jane F 66 0 1
Joyce F 68 0 1
David M 69 1 1
Stan M 70 0 1
Jim M 71 0 1
Bob M 71 0 0
2)
You have a file containing gymnastics scores for boys and girls as follows: ID
Gender
Age
Vault
Floor
P_BAR
3
M
8
7.5
7.2
6.5
5
F
14
7.9
8.2
6.8
2
F
10
5.6
5.7
5.8
7
M
9
5.4
5.9
6.1
6
F
15
8.2
8.2
7.9
The data are stored in a file called ‘gym.dat’. Read the data from this source (
not
using datalines). (a) Create a SAS data set called GYM from these data.
data
gym;
infile
"Z:\OneDrive\Documents\sas\GYM.DAT"
;
input
id @
4
gender$ age vault floor P_BAR;
Run
;
(b) Use PROC CONTENTS and PRINT to view the database.
data
gym;
infile
"Z:\OneDrive\Documents\sas\GYM.DAT"
;
input
id @
4
gender$ age vault floor P_BAR;
Run
;
proc
contents
data
= gym;
run
;
proc print data=
gym
;
run;
(c) Create a subset of these data from males only. Call it MALE_GYM.
data
male_gym;
infile
"Z:\OneDrive\Documents\sas\GYM.DAT"
;
input
id @
4
gender$ age vault floor P_BAR;
if
gender= 'm'
;
run
;
(d) Create another subset of GYM for all females greater than or equal to 10 years of age. Call it OLDER_F.
data
older_f;
infile
"Z:\OneDrive\Documents\sas\GYM.DAT"
;
input
id @
4
gender $ age vault floor P_Bar;
if
_5_ <= 10
;
run
;
3)
You have two data files, one from the year 1996 and the other from the year 1997, as follows:
File for 1996
File for 1997
ID
Height
Weight
ID
Height
Weight
2
68
155
7
72
202
1
63
102
5
78
220
4
61
111
3
66
105
The data are stored in files called ‘data96.dat’ and ‘data97.dat’. Create a SAS data set from each file (call them YEAR1996 and YEAR1997, respectively.) Use PROC CONTENTS and PRINT to view the database. Combine the data from each data set
into a single file (call it BOTH).
data
year1996;
infile
"Z:\OneDrive\Documents\sas\DATA96.DAT"
;
input
id height weight;
run
;
data
year1997;
infile
"Z:\OneDrive\Documents\sas\DATA97.DAT"
;
input
id height weight;
run
;
proc
contents
data
= year1996;
run
;
proc
print
data
= year1996;
run
;
proc
contents
data
= year1997;
run
;
proc
print
data
= year1997;
run
;
proc
sort
data
= year1996;
by
id;
run
;
proc
sort
data
= year1997;
by
id;
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
run
;
data
year1996year1997;
merge
year1996 year1997;
by
id;
run
;
4)
You have a separate file on the children in problem 2). This file contains ID numbers, income ranges, and the parents’ last names as follows:
ID
Income
L_Name
3
A
Klein
7
B
Cesar
8
A
Solanchick
1
B
Warlock
5
A
Cassidy
2
B
Volick
The data are stored in the file ‘income.dat’. Note that there are ID’s for which there is no GYM data and vice versa. First, create a SAS data set called MONEY from the
data above. Use PROC CONTENTS and PRINT to view the database. Next, merge
the two data sets (call the merged data set GYMMONEY). Make the database GYMMONEY a permanent SAS database stored in your directory. Make sure to include everyone in the database, and note who has missing values. Next, print out a list showing ID, last name, gender, and age. Have this list in ID order.
data
money;
infile
"Z:\OneDrive\Documents\sas\INCOME.DAT"
;
input
id income L_Name;
run
;
proc
contents
data
= money;
run
;
proc
print
data
= money;
run;
;
data
gymmoney;
merge
money gym;
run
;
libname
gymmoney "Z\OneDrive"
;
data
gymmoneyy;
set
gymmoney;
run
;
5)
Combine the GYMMONEY data set from problem 4) with the data set BOTH from problem 3). Put the resulting data in your permanent SAS database GYMMONEY. Use PROC CONTENTS and PRINT to view the database.
6)
You have a financial plan based on income range and gender. Using the GYMMONEY data set from problem 5), create a new data set, which contains all the
data from GYMMONEY along with the correct final plan based on the table below:
Income Range
Gender
Financial Plan
A
M
W
A
F
X
B
M
Y
B
F
Z
The data are stored in the file ‘finance.dat’. Read the data into a temporary SAS database called FINANCE, and then store the final combined data set in your permanent SAS database GYMMONEY.
data
gymmoney;
merge
gymoney finance;
by
income gender;
run
;
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Documents
Related Questions
Part 2. Refer to the Excel file Cereal data set to complete the following tasks. All results and explanations need to be reported within this Word document after each question. Make sure to use complete sentences when explaining your results. Your results should be formatted and edited.
Data Set: Cereals
The data set shows the name of different brands of cereals, the manufacturers, the total calories, proteins, sugar, fat, potassium, sodium, location of the shelf in the supermarket, etc. The amount of sugar, protein, etc., is measured in grams (g).
Exercise 1:
A. Construct a frequency distribution and a bar graph for the cereal manufactures (mfr). Include the relative frequencies. Edit and format the graph and include appropriate labels for the horizontal and vertical axes. Describe your findings in the context of the problem (Include which manufacturer produces the most cereals and least number of cereals in the cereal market).
N = Nabisco, K = Kellog’s, Q = Quaker Oats…
arrow_forward
Please take a screenshot of all the steps
********************************
Q 1 (a) Enter the following data into PSPP :
STUDENT NAME
DEPARTMENT
COURSE
MARKS
Tommy
1
Computer Networks
75
John
2
Software Engineering
87
Anabell
1
Programming
94
Rose
2
Information Technology
50
Sarah
2
Software Engineering
72
Value=1 represents “CS” Value=2 represents “IT”
Perform the following on the above data:
Using the Descriptive analysis calculate the Sum, Mean, Mode and Standard deviation for Marks
Do a Frequency analysis on the variable “Department” and create a Pie chart for
arrow_forward
Continue monitoring the process. A second ten days of data have been collected, see table labeled “2nd 10 Days of Monitoring Reservation Processing Time” in the Data File.
Develop Xbar and R charts for the 2nd 10 days of monitoring. Plot the data for the 2nd 10 days on the Xbar and R charts.
Is the reservation process for the 2nd 10 days of monitoring in control? If the control chart indicates an out-of-control process, note which days, the pattern, and whether it is the Xbar or R chart.
Based on the X-bar and R Charts that you developed for the 2nd 10 days of data, is the process in control?
Group of answer choices
No. The X-bar and R Charts are both out of control.
No. The X-bar Chart is in control, but the R Chart is out of control.
No. The R Chart is in control, but the X-bar Chart is out of control.
Yes. The X-bar and R Charts are both in control.
arrow_forward
(Use SAS) Given the raw data lines below, write a program to read these data and create
a SAS data set called COLLEGE. The values are separated by one or more spaces, and
they represent NAME, TITLE, TENURE (Y or N), and NUMBER (number of classes
taught). Notice that some of the names are more than eight characters long.
Stevenson Ph.D. Y 2
Smith Ph.D. N 3
Goldstein M.D. Y 1
arrow_forward
Which of the following data would best be represented by a pie chart?
The number of students who have taken MA321 in the last 10 semesters
The percentage of QCC students in each major
The percentage of QCC students currently taking MA321
The number of courses each QCC student is taking
arrow_forward
Make a two-way table from the accompanying table, for gender and eye color. Put the labels Male and Female on the top and the labels Brown, Blue, and Hazel on the side, and then tally the data. Complete parts (a) through (f) below.
LOADING...
Click the icon to view the data table.
Question content area bottom
Part 1
a. Arrange the data as a two-way table and report how many students are in each cell. For each cell, make a tally mark using the capital letter I for each person who has both of the characteristics belonging to that cell. Type a 0 if there are no students with the given characteristics.
Male
Female
Total
Brown
enter your response here
enter your response here
Blue
enter your response here
enter your response here
Hazel
enter your response here
enter your response here
Total
Part 2
b. Sum the numbers of students in each row and each column, and put these sums…
arrow_forward
Show calculation.
arrow_forward
Only part B solutions needed
arrow_forward
Alert for not submit AI generated answer. I need unique and correct answer. Don't try to copy from anywhere. Do not give answer in image formet and hand writing
arrow_forward
I need help with this question
arrow_forward
The shipping department for a warehouse has noted that if 40 packages are shipped during a month, the total expenses for the department are $1635. If 60 packages are shipped during a month, the total expenses for the shipping department are $1685. Let x represent the number of packages and y represent the total expenses for the shipping department. Answer the following questions.
Question content area bottom
Part 1
(a) Interpret the meaning of the point (40,1635) in the context of this problem.
A. When 40 packages are shipped, the expenses are $1635.
B. When 1635 packages are shipped, the expenses are $40.
C. When 40 packages are shipped, each package cost $1635.
arrow_forward
Q2 needed to be solved correctly in 30 minutes and get the thumbs up please show neat and clean work
arrow_forward
The shipping department for a warehouse has noted that if 120packages are shipped during a month, the total expenses for the department are $1635. If 180 packages are shipped during a month, the total expenses for the shipping department are $1725. Let x represent the number of packages and y represent the total expenses for the shipping department. Answer the following questions.
Question content area bottom
Part 1
(a) Interpret the meaning of the point (120,1635) in the context of this problem.
A. When 120 packages are shipped, each package cost $1635.
B. When 1635 packages are shipped, the expenses are $120. C. When 120 packages are shipped, the expenses are $1635.
arrow_forward
What is an Algebrafying elementary school math problem/task/activity.
arrow_forward
I need help to do the exercises of the chart given for doing Excel and provide the steps as that need to follow the instructions.
arrow_forward
School Distr X C Clever | Portal
Classes
ixl.com/math/grade-7/scale-drawings-word-problems
Parents at Freehold...
Search topics and skills
ming Assessment
Math
X
Language arts
inches
Submit
Analytics
Ch grade Z.2 Scale drawings: word problems 84H
DIXL | Scale drawings: word prol
Parents at Freehold...
Science
Social studies
Sebastian measured a hotel and made a scale drawing. The scale of the drawing was
1 inch 2 feet. A room in the hotel is 12 feet wide in real life. How wide is the room in the
drawing?
Work it out
New Tab
DELL
Recommendations
arrow_forward
Describe the two shapes of the two data sets from histograms.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you

Glencoe Algebra 1, Student Edition, 9780079039897...
Algebra
ISBN:9780079039897
Author:Carter
Publisher:McGraw Hill

Elementary Geometry for College Students
Geometry
ISBN:9781285195698
Author:Daniel C. Alexander, Geralyn M. Koeberlein
Publisher:Cengage Learning

Functions and Change: A Modeling Approach to Coll...
Algebra
ISBN:9781337111348
Author:Bruce Crauder, Benny Evans, Alan Noell
Publisher:Cengage Learning

Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,
Related Questions
- Part 2. Refer to the Excel file Cereal data set to complete the following tasks. All results and explanations need to be reported within this Word document after each question. Make sure to use complete sentences when explaining your results. Your results should be formatted and edited. Data Set: Cereals The data set shows the name of different brands of cereals, the manufacturers, the total calories, proteins, sugar, fat, potassium, sodium, location of the shelf in the supermarket, etc. The amount of sugar, protein, etc., is measured in grams (g). Exercise 1: A. Construct a frequency distribution and a bar graph for the cereal manufactures (mfr). Include the relative frequencies. Edit and format the graph and include appropriate labels for the horizontal and vertical axes. Describe your findings in the context of the problem (Include which manufacturer produces the most cereals and least number of cereals in the cereal market). N = Nabisco, K = Kellog’s, Q = Quaker Oats…arrow_forwardPlease take a screenshot of all the steps ******************************** Q 1 (a) Enter the following data into PSPP : STUDENT NAME DEPARTMENT COURSE MARKS Tommy 1 Computer Networks 75 John 2 Software Engineering 87 Anabell 1 Programming 94 Rose 2 Information Technology 50 Sarah 2 Software Engineering 72 Value=1 represents “CS” Value=2 represents “IT” Perform the following on the above data: Using the Descriptive analysis calculate the Sum, Mean, Mode and Standard deviation for Marks Do a Frequency analysis on the variable “Department” and create a Pie chart forarrow_forwardContinue monitoring the process. A second ten days of data have been collected, see table labeled “2nd 10 Days of Monitoring Reservation Processing Time” in the Data File. Develop Xbar and R charts for the 2nd 10 days of monitoring. Plot the data for the 2nd 10 days on the Xbar and R charts. Is the reservation process for the 2nd 10 days of monitoring in control? If the control chart indicates an out-of-control process, note which days, the pattern, and whether it is the Xbar or R chart. Based on the X-bar and R Charts that you developed for the 2nd 10 days of data, is the process in control? Group of answer choices No. The X-bar and R Charts are both out of control. No. The X-bar Chart is in control, but the R Chart is out of control. No. The R Chart is in control, but the X-bar Chart is out of control. Yes. The X-bar and R Charts are both in control.arrow_forward
- (Use SAS) Given the raw data lines below, write a program to read these data and create a SAS data set called COLLEGE. The values are separated by one or more spaces, and they represent NAME, TITLE, TENURE (Y or N), and NUMBER (number of classes taught). Notice that some of the names are more than eight characters long. Stevenson Ph.D. Y 2 Smith Ph.D. N 3 Goldstein M.D. Y 1arrow_forwardWhich of the following data would best be represented by a pie chart? The number of students who have taken MA321 in the last 10 semesters The percentage of QCC students in each major The percentage of QCC students currently taking MA321 The number of courses each QCC student is takingarrow_forwardMake a two-way table from the accompanying table, for gender and eye color. Put the labels Male and Female on the top and the labels Brown, Blue, and Hazel on the side, and then tally the data. Complete parts (a) through (f) below. LOADING... Click the icon to view the data table. Question content area bottom Part 1 a. Arrange the data as a two-way table and report how many students are in each cell. For each cell, make a tally mark using the capital letter I for each person who has both of the characteristics belonging to that cell. Type a 0 if there are no students with the given characteristics. Male Female Total Brown enter your response here enter your response here Blue enter your response here enter your response here Hazel enter your response here enter your response here Total Part 2 b. Sum the numbers of students in each row and each column, and put these sums…arrow_forward
- I need help with this questionarrow_forwardThe shipping department for a warehouse has noted that if 40 packages are shipped during a month, the total expenses for the department are $1635. If 60 packages are shipped during a month, the total expenses for the shipping department are $1685. Let x represent the number of packages and y represent the total expenses for the shipping department. Answer the following questions. Question content area bottom Part 1 (a) Interpret the meaning of the point (40,1635) in the context of this problem. A. When 40 packages are shipped, the expenses are $1635. B. When 1635 packages are shipped, the expenses are $40. C. When 40 packages are shipped, each package cost $1635.arrow_forwardQ2 needed to be solved correctly in 30 minutes and get the thumbs up please show neat and clean workarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Glencoe Algebra 1, Student Edition, 9780079039897...AlgebraISBN:9780079039897Author:CarterPublisher:McGraw HillElementary Geometry for College StudentsGeometryISBN:9781285195698Author:Daniel C. Alexander, Geralyn M. KoeberleinPublisher:Cengage LearningFunctions and Change: A Modeling Approach to Coll...AlgebraISBN:9781337111348Author:Bruce Crauder, Benny Evans, Alan NoellPublisher:Cengage Learning
- Mathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,

Glencoe Algebra 1, Student Edition, 9780079039897...
Algebra
ISBN:9780079039897
Author:Carter
Publisher:McGraw Hill

Elementary Geometry for College Students
Geometry
ISBN:9781285195698
Author:Daniel C. Alexander, Geralyn M. Koeberlein
Publisher:Cengage Learning

Functions and Change: A Modeling Approach to Coll...
Algebra
ISBN:9781337111348
Author:Bruce Crauder, Benny Evans, Alan Noell
Publisher:Cengage Learning

Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,