Math 3772 Exercises 4
This question is to be done in R
项目类别:数学

Math 3772 Exercises 4

This question is to be done in R.

(a)Read in the cork data from the module web site (see Section 3.11 in the Lecture Notes)and represent the data in R as a matrix X (28×4).There are 4 variables, north,east,south and west.Using matrix operations (see Section 4.11),construct  a new data matrix Y (28×3)with new variables,

north+south  -east  -west,

north -south

east -west.

(b)Compute the mean vectors and the variance and correlation matrices of X and Y. Using suitable plots,comment explicitly on each of the following issues:

(i)the difference in mean bark thickness in the four directions

(ii)the randomness of the data,

(iii)the univariate normality of each variable,and

(iv)the bivariate normality of each pair of variables.

Hint:Some useful commands in R:

cork=read.table("cork.txt",

header=TRUE)#so  cork is  a  data  frame.

attach(cork)#vectors    north,east,south,and    west     are    now     defined

stem(north)#stem   and   leaf  plot   of   a   vector

hist(north)#histogram    of    a     vector

boxplot(north,south,east,west)#boxplots    of    one    or     more    vectors

pairs(cork)#bivariate    plot     of    the     data

corkm=as.matrix(cork)#corkm  is  a  28  by  4  data  matrix

matplot(corkm,col=1)#plot   of   each   variable   vs    1:n

留学ICU™️ 留学生辅助指导品牌
在线客服 7*24 全天为您提供咨询服务
咨询电话(全球): +86 17530857517
客服QQ:2405269519
微信咨询:zz-x2580
关于我们
微信订阅号
© 2012-2021 ABC网站 站点地图:Google Sitemap | 服务条款 | 隐私政策
提示:ABC网站所开展服务及提供的文稿基于客户所提供资料,客户可用于研究目的等方面,本机构不鼓励、不提倡任何学术欺诈行为。