【无标题】

 102.5
10 10   M  14   69.0  112.5
11 11   M  14   63.5  102.5
12 12   M  15   67.0  133.0
13 13   M  12   57.3   83.0
14 14   M  13   62.5   84.0
15 15   M  12   59.0   99.5
16 16   M  16   72.0  150.0
17 17   M  12   64.8  128.0
18 18   M  11   57.5   85.0
19 19   M  15   66.5  112.0
> # 计算身高的均值,标准差,中位数,最值,偏度,峰度
> height <- student$height
> mean(height)
[1] 62.33684
> sd(height)
[1] 5.127075
> median(height)
[1] 62.8
> max(height)
[1] 72
> min(height)
[1] 51.3

> install.packages("e1071")
> library(e1071)
> skewness(height)
> kurtosis(height)


> # 绘制体重直方图,将密度估计曲线与正态密度曲线比较
> weight <- student$weight
> hist(weight)
> hist(weight,col="lightblue",freq=F)

> lines(weight,dnorm(weight,mean(weight),sd(weight)))#正态密度曲线
Error in plot.xy(xy.coords(x, y), type = type, ...) : 
  plot.new has not been called yet
> lines(density(weight),col="green",lwd=3)
Error in plot.xy(xy.coords(x, y), type = type, ...) : 
  plot.new has not been called yet

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值