#11.32
hemdata<-read.table("C:/Users/AmrutaC/Desktop/Wichern_data/T11-8.dat",
header = F,col.names = c("Group","Activity","Antigen")
#Taking first 30 values from each group
j<-1
k<-1
grp1<-hemdata[0,]
grp2<-hemdata[0,]
for(i in 1:nrow(hemdata)
cfw_
if(hem
twopop<-function (x1, x2, level)
cfw_
p <- ncol(x1)
n1 <- nrow(x1)
n2 <- nrow(x2)
x1bar <- apply(x1, 2, mean)
x2bar <- apply(x2, 2, mean)
cat("\n mean vector of population one \n", x1bar)
cat("\n\n mean vector of population two \n", x2bar)
s1 <- cov(x1)
s
4.23]
a)
Sample Size: n = 10
QQ plot for Annual Rates of Return:
> rates<-c(-0.6,3.1,25.3,-16.8,-7.1,-6.2,25.2,22.6,26.0,16.1)
> qqnorm(rates)
> qqline(rates)
From the QQ-Normal Plot it seems that the data is approximately normal with few outliers. Howeve
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Homework 7
EXERCISE# Q-11.2
x1<matrix(c(90,115.5,94.8,91.5,117,140.1,138,112.8,
Canon <function(cov, x, y=-x, p=ncol(cov)
# Canonical Correlation Analysis of Covariance/Correlation Matrix
#
# cov - covariance matrix or correlation matrix
# x
- numeric vector of subscripts for first set of variables
# y
- numeric vector of subscripts
# MANIFESTO #
# Main Functions:
# * gSummary
- create object of class NormDA (Normal theory Discriminant
#
Analysis object)
#
@ supporting functions:
#
+ bcov - between group covariance matrix and degrees of freedom
#
+ pcov - pooled covariance matrix and