Patrick | Caterina
Assignments 8 and 9 combined
7.1
4.
a. True, this is because the data follow a positive trend line.
b. False, because below average values of one variable are associated with above
Getting Data into R
Usually you will want to import data from a text file corresponding to data. Such a file
will usually end with the extensions .txt or .dat. Each data file for this course will
cons
Data Summaries and Plotting in R
Lets assume that you have a numerical vector named X and another numerical vector named Y. The
following R commands produce the given data summaries:
sum(X)
the sum of
Arithmetic Functions and Operators in R
The basic R installation includes a base package that opens when you open R. This package includes
many useful statistical functions. There is a long and growin
Probability Distributions in R
The R stats package (which is loaded into the R workspace when you open R) contains functions
corresponding to most common discrete and continuous probability distributi
Writing Programs in R
You can write your own, specialized programs in R to perform tasks, including simulations. To write a
program, you should first design an algorithm that lists step-by-step what t
Installing R
Go to the Comprehensive R Archive Network home page:
http:/cran.r-project.org/
Under Download and Install R, choose Linux, MacOS X or Windows. If you
choose Windows, on the next page choo
xp( x )
2= (x )2 p( x)
xR ( X )
x 2 p ( x) 2
n
sample mean:
=
1
X = X i
n i=1
x R ( X )
n
population mean:
Pi X i
i=1
X i X
sample variance:
n
1
2
sx =
n1 i=1
xR (X )
continuous r.v.:
= xf ( x ) d
The Pearson sample correlation coefficient
n
n
x ix
1
r=
n1 i=1 s x
y i y
=
sy
( )(
)
x i y i n xy
i=1
(
n
x i2n x 2
i=1
n
)(
i=1
The value of r can be strongly influenced by a single
outlier among