dat3a.csv is below dat3b.csv is below V1 V2 V3 1 0.478043 -3.90659 -0.74456 2 0.
ID: 3730267 • Letter: D
Question
dat3a.csv is below
dat3b.csv is below
V1 V2 V3 1 0.478043 -3.90659 -0.74456 2 0.056888 -0.1962 -0.78265 3 -0.62874 0.403353 0.139561 4 1.417582 -1.32498 0.246712 5 -0.65778 0.762419 3.585097 6 -0.92779 -2.57498 1.344378 7 -2.0414 1.314728 1.748377 8 -1.65235 0.039106 2.55767 9 1.49461 1.453692 1.266913 10 0.847276 -0.83898 -2.33153 11 -1.01433 0.228478 -1.32143 12 1.79601 -1.06009 1.570906 13 0.354292 -0.23773 -0.8133 14 -0.84942 -2.38923 -1.74559 15 0.882241 -1.50914 1.127118 16 -0.83436 -1.43568 -0.02552 17 -2.48318 0.700372 -1.75841 18 -0.40919 1.572716 1.409846 19 -1.06532 -0.56305 1.656352 20 -0.88874 0.789625 0.113232 Q5. Take homel Suppose T1 Tlp T21 2p y21 .-. y2p mp niUnp are n paired samples. Here each z. (zil, ,zip), 1-1, , n is normally distributed with mean | and each yi = (Vi1, . . . , yip), 1, , n is normally distributed with mean 2-write a generic function in R for a T2 test on a paired multivariate data to test the hypothesis with input arguments as X Y, 0 and the significance level a. Implement your function for any three choices of 0 on the attached data, where X is given in dat3a.csv and Y is given in dat3b.csv.Explanation / Answer
Answer:
R program for the above question:
Please check for delta value and also what to be returned in output is not mentioned, so I have used random.
d0 =
alpha = 0.05
xtemp = read.csv("dat3a.csv", sep=",", row.names=1)[,c('V1','V2','V3')]
x <- as.matrix(xtemp)
print(x)
ytemp = read.csv("dat3b.csv", sep=",", row.names=1)[,c('V1','V2','V3')]
y <- as.matrix(ytemp)
myfunction <- function(x,y,d0,alpha)
{
u1 <- colMeans(x) ## column wise mean of X
u2 <- colMeans(y) ## column wise mean of Y
print(u1)
print(u2)
H0 <- u1-u2
Ha <- u1-u2
c='a'
return(c)
}
d <- myfunction(x,y,d0,alpha)
print(d)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.