For the data from the 1977 Stat. and Biom 200 class for eye color, construct the following FOUR graphs:
A) Pie Chart
B) Horizontal Bar Chart
C) Vertical Bar Graph
b) Horizontal Bar chart
D) A Frequency Table with the relative frequency of each eye color
c
Stat 302
Statistical Software and Its Applications
The
knitr
Package and RStudio
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
January 8, 2015
1
The
knitr
Package
The knitr package integrates code, output, and narrati
Stat 302
Statistical Software and Its Applications
Regression
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
January 8, 2015
1
Simple Linear Regression: The Spirit of St. Louis
Here we examine data from the ight prepar
Stat 302
Statistical Software and Its Applications
Data Objects (Vectors)
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
January 8, 2015
1
Vectors
A vector is a sequence of entities of the same type, i.e.,
numerical, i
patient.txt
patient.csv
patient_names.csv
ice.txt
data
U:\data
infile "U:\data\patient.txt" firstobs=2;
patient.txt
data patient1; * data set name;
infile "U:\data\patient.txt";
input ID Age Sex $;
run;
title "Patient DATA 1";
proc print data= patient1;
r
Stat 302
Statistical Software and Its Applications
Introduction to R
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
January 8, 2015
1
Statistical Software
There are many, many statistical packages, see
http:/en.wikiped
Stat 302
Statistical Software and Its Applications
Other Data Objects
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
January 8, 2015
1
Matrices
A matrix object is a rectangular n m array
of elements of same type: numer
Stat 302
Statistical Software and Its Applications
Functions and Programming
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
January 8, 2015
1
Functions
Functions can execute any number of commands within cfw_ and
myfu
Stat 302
Statistical Software and Its Applications
Data Import and Export
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
January 8, 2015
1
General Remarks on I/O (Import/Export)
We generally don't type data manually in
Stat 302
Statistical Software and Its Applications
SAS: Interactive Matrix Language (IML)
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
SAS IML: Links to Useful Materials
Introduction to SAS/IML by
Stat 302
Statistical Software and Its Applications
SAS: A Start into Macros
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
Built In Macro Variables
SAS has some special built-in macro variables, suc
Stat 302
Statistical Software and Its Applications
SAS: Simple Linear Regression
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
The Spirit of St. Louis
data spirit;
infile "U:\data\SpiritStLouis.csv
Stat 302
Statistical Software and Its Applications
SAS: Distributions
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
Distributions in R and SAS
Distribution
Beta
binomial
Cauchy
chi-square
exponenti
Stat 302
Statistical Software and Its Applications
SAS: Working with Data
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
Outline
Chapter 7 in Learning SAS by Example,
A Programmer's Guide by Ron Cod
Stat 302
Statistical Software and Its Applications
SAS: Data I/O & Descriptive Statistics
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
Getting Data Files
Get the following data sets from the cours
Stat 302
Statistical Software and Its Applications
SAS Functions
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
Creating New Variables
Here we create new variables using functions applied to
existin
Stat 302
Statistical Software and Its Applications
SAS Basics
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
Getting Started
Access the virtual lab on the terminal server
ts.stat.washington.edu,
as
Stat 302
Statistical Software and Its Applications
Introduction to SAS
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
December 18, 2014
1
Why SAS?
Many prospective employers require familiarity with SAS when
looking fo
Summary of Making a plot in R
Types of plot
(1) scatter plot: plot(x, y), where x, y are vectors
- type: types of a scatter plot
- xlim, ylim, xlab, ylab, main, sub
(2) histogram: hist(x), where x is a vector
Stat 302
Statistical Software and Its Applications
Graphics
Fritz Scholz
Department of Statistics, University of Washington
Winter Quarter 2015
January 8, 2015
1
General Remarks on R Graphics
A well constructed graph is worth a thousand words.
Many people
First Name
Last Name
Student ID
Final Stat 302, March 17, 2014
Fritz Scholz
Questions 1-15 count as 4 points each, the rest as 6 points each (180 total).
1. Could Y and y refer to dierent objects within the same R work space?
2. If xx <- c(1:7,5,5:2) what
student.txt
student2.txt
U:\data
=
= =
<
<=
>
>=
student.txt
AgeGroup
data student;
infile "U:\data\student.txt";
input Age Major $ GPA;
if Age le 22 then AgeGroup = 1;
if Age gt 22 then AgeGroup = 2;
try it with <= and > in place of le and gt;
run; Also
data spirit;
infile "U:\data\SpiritStLouis.csv" dsd
firstobs=2;
input gas weight headwind TO_distance; run;
title "Spirit of St. Louis Takeoff Distance";
proc print data = spirit; run;
title "Scatter Plot with Regression Line";
proc sgplot data=spirit;
re
)
&VAR
&SYSDATE9 &SYSTIME
&
%
&
libname learn "U:\learn";
title "The Date is &sysdate9 the Time is &systime";
proc print data=learn.test_scores noobs;
run;
" "
title The Date is &sysdate9;
returns: The Date is &sysdate9
The Date is 16FEB2015 - the Time is
Valuation - preferred stock
What is the value of a share of preferred stock that pays a $9.50 dividend, assume k is 12%.
Solution
Value of preferred Stock = Dividend/Cost of preferred Stock
Dividend
=
$9.50
Cost of Preferred Stock = 12%
Value of preferred
Analysis of the current design/approach (Contract with TeachBest Consulting)
No of Students Number of instructors
813
65
1000 or more
75 or more
Cost Paid
$ 2,500.00
$ 5,000.00
Probability ( students 1000) =
0.75
Probability (students < 1000)
0.25
=
The n
Magazines
Age
ALIVE!
Business World
Chinese Cooking
Computer Technician
Country Cookin'
Crafters
Creative Projects
Cycle Time
Electronics Today
Entrepreneur's Day
Family Living
Fashion Flair
Fisherman's Line
Gourmet's Kitchen
Outdoor Fun
Naturalists
Paren
TheValues for mean, mode, median, range cannot show which instructor is popular.
The mean and median are equal for both instructors therefore it is difficult to identify the most popular instructor.
However, the standard deviations can identify which tuto