Please use Rcodeto figure out the question, the dataset is below. y1 y2 y3 y4 47
ID: 3048356 • Letter: P
Question
Please use Rcodeto figure out the question, the dataset is below.
y1 y2 y3 y4 47.8 48.8 49 49.7 46.4 47.3 47.7 48.4 46.3 46.8 47.8 48.5 45.1 45.3 46.1 47.2 47.6 48.5 48.9 49.3 52.5 53.2 53.3 53.7 51.2 53 54.3 54.4 49.8 50 50.3 52.7 48.1 50.8 52.3 54.4 45 47 47.3 48.3 51.2 51.4 51.6 51.9 48.5 49.2 53 55.5 52.1 52.8 53.7 55 48.2 48.9 49.3 49.8 49.6 50.4 51.2 51.8 50.7 51.7 52.7 53.3 47.2 47.7 48.4 49.5 53.3 54.6 55.1 55.3 46.2 47.5 48.1 48.4 46.3 47.6 51.3 51.8 Q1. The data (Elston and Grizzle 1962 in T3_6_BONE on CANVAS) given below consist of measurements yy2,y3, and y4 of the ramus bone at four different ages on each of 20 boys. (a) Find y, S, and R. (b) Find ISI and tr(S). 02. For the same dataset in question 1, define (a) Find z, w and variances of z and w. (b) Find Cov(z,w).Explanation / Answer
y=matrix(c(47.8, 48.8, 49, 49.7,
46.4, 47.3, 47.7, 48.4,
46.3, 46.8, 47.8, 48.5,
45.1, 45.3, 46.1, 47.2,
47.6, 48.5, 48.9, 49.3,
52.5, 53.2, 53.3, 53.7,
51.2, 53, 54.3, 54.4,
49.8, 50, 50.3, 52.7,
48.1, 50.8, 52.3, 54.4,
45, 47, 47.3, 48.3,
51.2, 51.4, 51.6, 51.9,
48.5, 49.2, 53, 55.5,
52.1, 52.8, 53.7, 55,
48.2, 48.9, 49.3, 49.8,
49.6, 50.4, 51.2, 51.8,
50.7, 51.7, 52.7, 53.3,
47.2, 47.7, 48.4, 49.5,
53.3, 54.6, 55.1, 55.3,
46.2, 47.5, 48.1, 48.4,
46.3, 47.6, 51.3, 51.8),ncol=4)
#Q1
#a)
ybar=colMeans(y); ybar
S=var(y); S
R=cor(y); R
#b)
det_S=det(S); det_S
tr_S=sum(diag(S)); tr_S
#Q2
z=y[,1]+2*y[,2]+y[,3]-3*y[,4]
w=-2*y[,1]+3*y[,2]-y[,3]+2*y[,4]
#a)
mean_z=mean(z);mean_z
var_z=var(z);var_z
mean_w=mean(w);mean_w
var_w=var(w);var_w
#b)
corr_zw=cor(z,w)