lab2_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
8
Uploaded by MegaElkPerson49
hLab #2 Exercises
Use the subjdata.sas7bdat dataset located in the Lab Datasets folder in Canvas. Please provide all relevant code and output to receive full credit for the lab.
libname
subject "Z:\OneDrive\Documents\sas\"
;
data
subject.subjdata;
set
subject.subjdata;
run
;
proc
contents
data
= subject.subjdata;
run
;
proc
format
;
value
sexf 1
=
"male"
2
=
"female"
; value
yesnof 0
=
"no"
1
=
"yes"
;
value
racef 1
=
"asian"
2
=
"african"
3
=
"hispanic"
4
=
"nonhispanic white" 5
=
"other"
;
run
;
libname
subject "Z:\OneDrive\Documents\sas\"
;
data
subject.subjdata;
set
subject.subjdata;
format
sex sexf.
race racef.
birthdat mmddyy8.
testdat mmddyy8.
yesno yesnof.
;
run
;
Graphics
1.
Write an SGPLOT program to overlay both a histogram and density plot of FEV on one graph. (Label the X- and Y- axis descriptively, as if ready for journal publication).
proc
sgplot
data
= subject.subjdata;
title
"Histogram and Density Plot of Forced Expiratory Volume(FEV)"
;
histogram
fev;
xaxis
label
=
"FEV"
;
yaxis
label
= "Percentage observed"
;
density
fev;
keylegend
/ location
=inside position
=topright across
=
1
noborder
;
run
;
2.
Regress MMEF on htinches and output residuals and predicted values
proc
reg
data
= subject.subjdata;
model
MMEF=htinches;
output
out
= subject r
=resid p
=pred;
run
;
1.
Write a SGPLOT program to overlay both a histogram and density plot of the residuals on one graph.
proc
sgplot
data
= subject.subjdata;
title
"Histogram and Density Plot of Maximal Mid-Expiratory Flow (MMEF) on Height in Inches(htinches)"
;
histogram
MMEF;
xaxis
label
=
"Residuals"
;
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
yaxis
label
= "Percentage observed"
;
density
MMEF;
keylegend
/ location
=inside position
=topright across
=
1
noborder
;
run
;
2.
Write another SGPLOT program to determine your linearity assumption (use the loess instead of the scatter option). Add a reference line at y = 0.
proc
sgplot
data
= subject.subjdata;
title
"Loess of Maximal Mid-Expiratory Flow (MMEF) on Height in Inches(htinches)"
;
loess
x
=htinches y
=mmef;
refline
0
;
keylegend
/ location
=inside position
=topright across
=
1
noborder
;
run
;
3.
Write a SGPLOT program to graph a horizontal bar chart of asthma, stacked by categories of gender proc
sgplot
data
=subject.subjdata;
hbar
asthma/ group
=sex groupdisplay
=stack;
title
'Asthma stacked by Gender'
;
run
;
4.
Augment this program to show panels of doctor diagnosed asthma by city, also stacked by gender (
hint
: use SGPANEL – see section 8.11 in The Little SAS Book, 6
th
edition) proc
sgpanel
data
=subject.subjdata;
panelby
townname;
hbar
asthma / group
=sex groupdisplay
=stack;
title
"Asthma by Gender/City"
;
run
;
5.
Write an SGPLOT program to graph both a scatter and regression line of MMEF on HTINCHES. Change the labels of the X- and Y-Axis to be descriptive. Also plot the confidence limits of the prediction and of the mean values (HINT: Use the
cli/clm options similar to proc reg)
proc
sgplot
data
= subject.subjdata;
title
"Density Plot of Maximal Mid-Expiratory Flow (MMEF)on Height in Inches (Htinches)ScatterPlot"
;
scatter
x
=htinches y
=mmef;
reg
x
=htinches y
=mmef /cli clm;
xaxis
label
=
"Height in Inches"
;
yaxis
label
= "MMEF(maximal mid-expiratory flow)"
;
keylegend
/ location
=inside position
=topright across
=
1
noborder
;
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
6.
Write an SGPANEL program to graph box plots of FEV by those who have pets vs. those who do not
proc
sgpanel
data
= subject.subjdata;
title
"Forced Expiratory Volume(FEV) by Pets"
;
panelby
pets;
vbox
fev;
run
;
7.
Write an SGPLOT program to graph bar charts of the mean values of FEV and FVC on one plot by asthma status (HINT: try changing the transparency and bar width of one variable to display both on one graph).
proc
sgplot
data
= subject.subjdata;
title
"FEV and FVC Bar Graph by Asthma Mean"
;
vbar
asthma/
response
=fev stat
=mean group
=asthma;
vbar
asthma/
response
=fev stat
=mean group
=asthma
transparency
=
0.6
barwidth
=
0.6
;
keylegend
/ location
=outside position
=topmright across
=
1
noborder
;
run
;
Related Documents
Related Questions
Install RStudio: Begin by installing RStudio on your computer. If you haven't done so, please refer to the official RStudio website for download and installation instructions.
Watch the Tutorial Video: Watch the provided video tutorial that explains how to run RStudio. Pay close attention to the steps for opening and managing data files. https://www.youtube.com/watch?v=RhJp6vSZ7z0
Open RStudio: Once RStudio is installed, open the application.
Load the Dataset: In RStudio, open a data file named "mtcars". To do this, type the command mtcars in the script editor and run the command.
Attach the Data: Next, attach the dataset using the command attach(mtcars).
Examine the Variables: Carefully review and note the names of all variables in the dataset. Examples of these variables include:
Mileage (mpg)
Number of Cylinders (cyl)
Displacement (disp)
Horsepower (hp)
Research: Google to understand these variables.
Statistical Analysis: Select mpg variable, and perform the following…
arrow_forward
Please share an excel screen on how to input the data for #2 only.
Thank you
arrow_forward
IQR for data set
41, 49, 55, 82, 84, 85, 93, 103, 113, 121, 126, 127, 136, 136, 155, 166, 169, 178, 193, 204, 445
arrow_forward
can you please share the excel file here or can u make Gantt chart for me
arrow_forward
An insurance company hires an actuary to determine whether the number of hours of safety drivingclasses can be used to predict the number of driving accidents for each driver. Identify theexplanatory variable, if any.
arrow_forward
Aplicaciones
M Gmail
YouTube
Maps
Noticias G Traducir
T&content_id%3D
* Question Completion Status:
The following set of data represents the number of orders filled by a national-chain restaurant during a two week period. Construct a five number summary
for the the data.
66, 75, 68, 89, 86, 73, 67, 75, 75, 82, 85, 74, 67, 61
(Round to the nearest hundredth, if needed).
Min
Lower Quartile
Median
Upper Quartile
Maximum
What is the range and the interquartile range (IQR)?
Range
Interquartile Range (1QR)
local, family-owned restaurant also gathered data for two weeks of orders. The following set of data represents the number of orders filled by this
Save All Ans
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
Relative
Reading - Mapp.pdf
ANY
Worksheet - Py....docx
W
Worksheet - W....docx
* MLK Letter -2.pdf
ACIC
四国07A|
útv
DIC.
11
arrow_forward
Define interset.
arrow_forward
Give an example of an actual or potential application of big data or data mining in a organization. Describe how the application meets the criteria of being big data or data mining.
arrow_forward
Could you please take a screenshot or list the procedure when you do all the graphical parts by using Minitab.
The monthly rainfall (in mm) in a small country for last 41 years is given in the data set Rain_Fall. Copy the given data to a MINITAB worksheet. Answer the following. (Copy and paste the MINITAB output. Resize and wrap to fit into the given area) .
a. Draw a histogram for the variable rainfall. (Copy and Paste the MINITAB graph. Resize and remove excess white space)
b. Draw box plots for the rainfall for each month. (Copy and Paste the MINITAB graph. Resize and remove excess white space. There should be 12 box-plots, 1 for each month.)
c. Find the mean and median, variance, and standard deviation of the rainfall by each month. (Copy and Paste the MINITAB output)
d. Find the total rainfall by each month. (Copy and Paste the MINITAB output)
Rain_fall
Month
6.7
1
8.9
1
6.7
1
7.3
1
4.9
1
3.2
1
4.9
1
9.2
1
7.6
1
2.8
1
15.1
1
12.2
1
11.2
1…
arrow_forward
Draw a histogram for the data. Use a class width of 15. Be sure to include the screenshot of Excel of your answers and formulas/command that you use.
arrow_forward
Name the image of overline DE
arrow_forward
KINDLY PLEASE ANSWER THIS IN PRECISE AND ACCURATE MANNER AND PLEASE WRITE OR TYPE LEGIBLY THANK YOU SO MUCH FOR FOLLOWING THE INSTRUCTIONS.
Write a paragraph or two that interprets and analyzes each data set represented in tabular/graphical forms. Aside from data interpretation, explain whether the data presentation effectively communicates the information.
arrow_forward
PLEASE HELP
arrow_forward
Please share an excel screen on how to input and calculate the data for #1 only.
Thank you
arrow_forward
You've heard of "Florida Man;" now meet "Florida Bear." This problem involves data from a
subspecies of black bear found in Florida, Ursus americanus floridanus. The data were collected by T. D.
Bartareau as part of a study published in the Journal of Fish and Wildlife Management (2017, vol 8, pp 234-
239). Before you begin consult the info sheet included at the end
(a) Do you predict an allometric or isometric scaling relationship between body weight and body length?
Explain.
(b) Based on your answer to part a, what would a plot of log body weight (vertical axis) versus log body length
(horizontal axis) look like?
(c) Using the data provided, create a plot of log body weight versus log body length. Make sure to label the
axes. Why might someone think your plot fails to provide clear support for your claim in part b?
(d) Using the tools described on the info sheet to isolate portions of the dataset, refine your use of data in part
c to strengthen support for your claim in b. Why does…
arrow_forward
Can you create a five number summary of the data set?
arrow_forward
alculate d for each patient by subtracting the number of hours of sleep with the drug from the number without the drug.
arrow_forward
Find the five-number summary of the data. Be sure to include the screenshot of excel of your answers and formulas/command that you use.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you

Glencoe Algebra 1, Student Edition, 9780079039897...
Algebra
ISBN:9780079039897
Author:Carter
Publisher:McGraw Hill
Related Questions
- Install RStudio: Begin by installing RStudio on your computer. If you haven't done so, please refer to the official RStudio website for download and installation instructions. Watch the Tutorial Video: Watch the provided video tutorial that explains how to run RStudio. Pay close attention to the steps for opening and managing data files. https://www.youtube.com/watch?v=RhJp6vSZ7z0 Open RStudio: Once RStudio is installed, open the application. Load the Dataset: In RStudio, open a data file named "mtcars". To do this, type the command mtcars in the script editor and run the command. Attach the Data: Next, attach the dataset using the command attach(mtcars). Examine the Variables: Carefully review and note the names of all variables in the dataset. Examples of these variables include: Mileage (mpg) Number of Cylinders (cyl) Displacement (disp) Horsepower (hp) Research: Google to understand these variables. Statistical Analysis: Select mpg variable, and perform the following…arrow_forwardPlease share an excel screen on how to input the data for #2 only. Thank youarrow_forwardIQR for data set 41, 49, 55, 82, 84, 85, 93, 103, 113, 121, 126, 127, 136, 136, 155, 166, 169, 178, 193, 204, 445arrow_forward
- can you please share the excel file here or can u make Gantt chart for mearrow_forwardAn insurance company hires an actuary to determine whether the number of hours of safety drivingclasses can be used to predict the number of driving accidents for each driver. Identify theexplanatory variable, if any.arrow_forwardAplicaciones M Gmail YouTube Maps Noticias G Traducir T&content_id%3D * Question Completion Status: The following set of data represents the number of orders filled by a national-chain restaurant during a two week period. Construct a five number summary for the the data. 66, 75, 68, 89, 86, 73, 67, 75, 75, 82, 85, 74, 67, 61 (Round to the nearest hundredth, if needed). Min Lower Quartile Median Upper Quartile Maximum What is the range and the interquartile range (IQR)? Range Interquartile Range (1QR) local, family-owned restaurant also gathered data for two weeks of orders. The following set of data represents the number of orders filled by this Save All Ans Click Save and Submit to save and submit. Click Save All Answers to save all answers. Relative Reading - Mapp.pdf ANY Worksheet - Py....docx W Worksheet - W....docx * MLK Letter -2.pdf ACIC 四国07A| útv DIC. 11arrow_forward
- Define interset.arrow_forwardGive an example of an actual or potential application of big data or data mining in a organization. Describe how the application meets the criteria of being big data or data mining.arrow_forwardCould you please take a screenshot or list the procedure when you do all the graphical parts by using Minitab. The monthly rainfall (in mm) in a small country for last 41 years is given in the data set Rain_Fall. Copy the given data to a MINITAB worksheet. Answer the following. (Copy and paste the MINITAB output. Resize and wrap to fit into the given area) . a. Draw a histogram for the variable rainfall. (Copy and Paste the MINITAB graph. Resize and remove excess white space) b. Draw box plots for the rainfall for each month. (Copy and Paste the MINITAB graph. Resize and remove excess white space. There should be 12 box-plots, 1 for each month.) c. Find the mean and median, variance, and standard deviation of the rainfall by each month. (Copy and Paste the MINITAB output) d. Find the total rainfall by each month. (Copy and Paste the MINITAB output) Rain_fall Month 6.7 1 8.9 1 6.7 1 7.3 1 4.9 1 3.2 1 4.9 1 9.2 1 7.6 1 2.8 1 15.1 1 12.2 1 11.2 1…arrow_forward
- Draw a histogram for the data. Use a class width of 15. Be sure to include the screenshot of Excel of your answers and formulas/command that you use.arrow_forwardName the image of overline DEarrow_forwardKINDLY PLEASE ANSWER THIS IN PRECISE AND ACCURATE MANNER AND PLEASE WRITE OR TYPE LEGIBLY THANK YOU SO MUCH FOR FOLLOWING THE INSTRUCTIONS. Write a paragraph or two that interprets and analyzes each data set represented in tabular/graphical forms. Aside from data interpretation, explain whether the data presentation effectively communicates the information.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Glencoe Algebra 1, Student Edition, 9780079039897...AlgebraISBN:9780079039897Author:CarterPublisher:McGraw Hill

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