1.

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)The question was asked in my homework.My doubt stems from Commands in chapter Commands, Packages, Visualizing Data and Linear Regression of R Programming

Answer»

Correct answer is (d) VAR(x, na.rm=TRUE)

The BEST 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.



Discussion

No Comment Found

Related InterviewSolutions