Which of the following produces the variance covariance matrix?

Which of the following produces the variance covariance matrix?
A. sd(x, na.rm=TRUE)
B. mad(x, na.rm=TRUE)
C. fivenum(x, na.rm=TRUE)
D. var(x, na.rm=TRUE)
 
Answer: d
Explanation: mad(x, na.rm=TRUE) gives median absolute deviation.var(y) instructs R to calculate the sample variance of Y. In other words it uses n-1 ‘degrees of freedom’, where n is the number of observations in Y.sd(y) instructs R to return the sample standard deviation of y, using n-1 degrees of freedom.
 

Tìm kiếm

Back
Top