1
a)
Cumulative
Cumulative
survived
Frequency
Percent
Frequency
Percent
0
1490
67.70
1490
67.70
1
711
32.30
2201
100.00
The above table indicates 32.30% of the passengers survived.
b)
Table of class by survived
class
survived
Frequency
Percent
Row Pct
C
Assignment #6
(Due: April 15, 2011)
1. ThenumberofOringfailuresforthefirst23fightsoftheUSspaceshuttleChallengerwere
010NA0000011100300000201
(NAmeansnotavailable,theequipmentwaslost).Make atableofthepossiblecategories.Find
the mean. (You might need to try
Basics of R Exercises
Read the instructions closely!
Lines starting with > contain R codes, and they should be written without the > sign. Codes and
R outputs are typesetted with Courier font to separate them from normal text.
This exercise has been writt
SAS
In Class Exercise 7
1. You have a text file called grades.txt containing information on gender (M or F) and four test
scores (English, History, Math and Science). Each data value is separated from the others by
one or more blanks. Here is a listing of
R
In Class Exercise 8
1. Try to guess the results of these R commands. Remember, the way to access entries in a
vector is with [].
Suppose we assume
> x = c(1,3,5,7,9)
> y = c(2,3,5,7,11,13)
1. x+1
2. y*2
3. length(x) and length(y)
4. x + y
5. sum(x>5) an
SAS
In Class Exercise 1
1. You have a text file called grades.txt containing information on gender (M or F) and four
test scores (English, History, Math and Science). Each data value is separated from the
others by one or more blanks. Here is a listing of
Introduction to R
R is a general-purpose computer language. It is similar to S language, and much code written for S run unalterd
under R. Its particular strength is in statistical, graphical capabilities. You can also do simple simulation with R. R
is fr
Introduction to R
R is a high level language especially designed for statistical calculations. R is free.
You can get it at:
http:/www.cran.r-project.org/
There are versions for Unix, Linux, Windows and Mac. There is a similar program
called Splus. The co
An Introduction to R
Notes on R: A Programming Environment for Data Analysis and Graphics Version 2.10.1 (2009-12-14)
W. N. Venables, D. M. Smith and the R Development Core Team
Copyright Copyright Copyright Copyright Copyright
c c c c c
1990 W. N. Venabl
Date
Stadium Surface
9/3/1995
O
G
9/3/1995
O
G
9/10/1995
D
T
9/10/1995
O
G
9/10/1995
O
G
9/10/1995
O
T
9/10/1995
O
T
9/17/1995
O
T
9/17/1995
D
T
9/17/1995
O
G
9/17/1995
D
T
9/17/1995
O
G
9/17/1995
O
G
9/17/1995
D
T
9/17/1995
D
T
9/17/1995
D
T
9/24/1995
O
SAS
In Class Exercise 6
1. A medical researcher wishes to determine if a pill has the undesirable side effect of reducing the
blood pressure of the user. The study involves recording the initial blood pressures of 15 collegeage women. After they use the
SAS
In Class Exercise 5
1. Given the following data:
XYZ
1 3 15
7 13 7
8 12 5
3 4 14
4 7 10
.
(a) Compute the Pearson correlation coefficient between X and Y; X and Z. What is the
significance of each?
(b) Generate a plot of Y versus X.
2. For the data s
SAS
In Class Exercise 3
1. Let us once again consider the Adjcereal data set.
a. Draw the following histogram to show the distribution of sugar with a normal
curve.
25
20
Percent
15
10
5
0
0
0.05
0.10
0.15
0.20
0.25
0.30
0.35
0.40
0.45
0.50
sugar
b. Make
SAS
In Class Exercise 2
1. You have a SAS data set called college.sas7bdat (copy it to your SASdata folder).
a. Compute the mean, median, minimum, maximum and the number of both missing
and nonmissing values for the variables ClassRank and GPA.
b. Repeat
Chapter 7
R
Chapter 7 Statistics in R
7.1 One-sample t test
Example: daily energy intake in kJ for 11 women.
> daily.intake <- c(5260,5470,5640,6180,6390,
+ 6515,6805,7515,7515,8230,8770)
> t.test(daily.intake,mu=7725)
> wilcox.test(daily.intake,mu=7725)
Introduction to R
Marlene Mller
November 18, 2008
Contents
1 What is this R?
2
2 How do I start?
3
3 How to get help?
6
4 Some calculations to start with
10
5 Data & les
20
6 Wonderful world of graphics
27
7 Some statistics
41
8 Advanced mathematics
53
9
Chapter 4
STAT 4360 (PART II)
Chapter 4
4.1
Fall 2016
Export/Import Data
Data Export
a. The function cat is useful for producing output in user-defined functions.
> cat("Good morning!","\n") #\n: newline
Good morning!
> cat(file="K:\4360\Rdata\test.txt",
Chapter 2
Chapter 2
2.1
SAS
Data Summary and Other Related
Procedures
PROC MEANS
The MEANS procedure provides data summarization tools to compute descriptive
statistics for variables across all observations and within groups of observations. For
example,
Step 1: Install Oracle VirtualBox and download the SAS University Edition vApp.
a. Download Oracle VirtualBox version 4.3.12 from the link below. Important: make sure you
download version 4.3.12. Also, make sure you download the appropriate version for yo
GEORGIA ASSET CERTIFICATION
Complete only one form per household; include assets of children.
Household Name: Chang
Development Name: Sugarloaf Trails Apartments
City: Duluth
1. Choose only ONE response:
a
I(we) do not have any family assets (as defined i
STAT 4360
Assignment 4
(Due 5:00pm, Monday, October 10, 2016)
Instruction:
Type your answers in a word .doc file and convert it into PDF file. You also need to
provide relevant SAS codes for each question in one .SAS file. Make sure your files
named as ST
Schedule for Lab 307, Statistics Building
Fall 2016
Sun. Time
Period
M,W,F Time
T,Th Time
Sunday
Monday
Tuesday
8/5/2016
Wednesday
Thursday
Friday
1
8:00-8:50 AM
8:00-9:15 AM
Closed
Open
Open
Open
Open
Open
2
9:05-9:55 AM 9:30-10:45 AM
Closed
4/6240 (Wern
Chapter 5
STAT 4360 (PART II)
Chapter 5
5.1
Fall 2016
R Graphics
Bar Chart
A bar chart draws a bar with a height proportional to the count in the table. The height
could be given by the frequency, or the proportion. The graph will look the same, but the
s
Chapter 3
STAT 4360 (PART II)
Chapter 3
3.1
Fall 2016
TS
R Objects
Introduction of R Objects
The entities R operates on are technically known as objects. Examples are vectors of numeric
(real) or complex values, vectors of logical values and vectors of ch
Chapter 1
Chapter 1
1.1
STAT 4360 (PART II)
Fall 2016
R Introduction and Preliminaries
The R Environment and Language
R is an integrated suite of software facilities for data manipulation, calculation and
graphical display.
The benefits of R for an introd
Chapter 2
STAT 4360 (PART II)
Chapter 2
Fall 2016
Simple Manipulations
- Numbers and Vectors
2.1
Vectors and Assignment
R operates on named data structures. The simplest such structure is the numeric vector,
which is a single entity consisting of an order
Chapter 6
STAT 4360 (PART II)
Fall 2016
Chapter 6 Advanced Programming in R
Now that you have learned the elementary commands in R and many ways of applying
them, it is time to discover its advanced functionalities. This chapter introduces grouped
express