Docsity

Homework 1 in STAT 530/J530: Multivariate Data Analysis with R - Prof. B. Habing, Assignments of Statistics

Toggle sidebar
bg1
1
STAT 530/J530 B.Habing Univ. of S.C. 1
STAT 530/J530
August 30
th
, 2005
Instructor: Brian Habing
Department of Statistics
LeConte 203
Telephone: 803-777-3578
STAT 530/J530 B.Habing Univ. of S.C. 2
Today
• Homework 1
• Multivariate Data
* Data Matrix
* Summary Parameters and Statistics
* A Hint of Matrices
* What if Some Data is Missing?
STAT 530/J530 B.Habing Univ. of S.C. 3
Homework 1
Using R, make two variables containing the
ratings of “Low Energy Use”, one for
males and one for females.
mdata<-
fdata<-
pf3
pf4
pf5

Partial preview of the text

Download Homework 1 in STAT 530/J530: Multivariate Data Analysis with R - Prof. B. Habing and more Assignments Statistics in PDF only on Docsity!

STAT 530/J530 B.Habing Univ. of S.C. (^1)

STAT 530/J

August 30 th^ , 2005

Instructor: Brian Habing

Department of Statistics

LeConte 203

Telephone: 803-777-

E-mail: [email protected]

STAT 530/J530 B.Habing Univ. of S.C. (^2)

Today

  • Homework 1
  • Multivariate Data
  • Data Matrix

  • Summary Parameters and Statistics

  • A Hint of Matrices

  • What if Some Data is Missing?

STAT 530/J530 B.Habing Univ. of S.C. (^3)

Homework 1

Using R, make two variables containing the

ratings of “Low Energy Use”, one for males and one for females.

mdata<-

fdata<-

STAT 530/J530 B.Habing Univ. of S.C. (^4)

Homework 1 Continued

Conduct a two sample t-test to see whether there is a difference between the genders…

Welch Two Sample t-test

data: mdata and fdata

t = -1.7918,df = 308.021,p-value = 0.

alternative hypothesis: true difference in

means is not equal to 0

STAT 530/J530 B.Habing Univ. of S.C. (^5)

Homework 1 Continued

…and check the assumptions using a q-q plot. Summarize your results.

STAT 530/J530 B.Habing Univ. of S.C. (^6)

Data!

Multivariate Data is typically presented in

a matrix, with each of then rows being a different observation, and each of theq columns being a different variable.

n n nj nq

i ij iq

q

j q

x x x x

x x x

x x x

x x x x

X
L L
M O M
M O M
L L

1 2

1

21 22 2

11 12 1 1

STAT 530/J530 B.Habing Univ. of S.C. (^10)

Covariance Matrix

The covariance is thus a matrix:

q qq

q

L L

M O M

M

L

1

21 11

11 12 1

STAT 530/J530 B.Habing Univ. of S.C. (^11)

Sample Covariance Matrix

And is estimated by the sample

covariance matrix:

Where is thei th^ observation.

(x x)(x x) S 1

1

21 11

11 12 1

∑

n s s

s s

s s s n i

T i i

q qq

q

L L
M O M
M
L

in

i i x

x M

1 x

STAT 530/J530 B.Habing Univ. of S.C. (^12)

Correlation Matrix

The Covariance Matrix is commonly

rescaled to be the correlation matrix:

Where

q qq

q

ρ ρ

ρ ρ

ρ ρ ρ

L L
M O M
M
L

1

21 22

11 12 1

ii jj

ij ij σ σ

σ ρ =

STAT 530/J530 B.Habing Univ. of S.C. (^13)

Regression in Terms of Matrices

yi = β 0 + β 1 xi + ε i

STAT 530/J530 B.Habing Univ. of S.C. (^14)

Sample Correlation Matrix

The Sample Correlation Matrix can be

written as:

Where D -1/2^ is the matrix with 1/s i on the

diagonals.

R D SD

STAT 530/J530 B.Habing Univ. of S.C. (^15)

What if Data is Missing?

• Missing Completely at Random?

• Imputation

• Multiple Imputation