开始使用免费开始使用

Calculating the variance-covariance matrix

Along with the mean, an equally important statistic for a multivariate observation is its variance-covariance matrix. The variance-covariance matrix generalizes the concept of variance to multiple dimensions.

本练习是课程的一部分

Multivariate Probability Distributions in R

查看课程

练习说明

  • Calculate the variance-covariance matrix of the first four numeric variables in columns 2 through 5.
  • Round the values of the variance-covariance matrix to two decimal places.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Calculate the variance-covariance matrix of the variables Alcohol, Malic, Ash, Alcalinity
var.wine <- var(___)

# Round the matrix values to two decimal places 
round(___, ___)
编辑并运行代码