USYD悉尼大学DATA 2002 【Module 1】: Categorical data 学习笔记(week1-week3)


前言

系列博客是主要讲lecture里的重要知识点,这里面包括了data visualisation、data collection、 Chi-square test、 goodness of fit tests、 measure of performance 、 measure of risk 、 testing for homogeneity 、 testing for independent 和 testing in small sample。都是比较基础的知识点,掌握好,了解它。有的知识点讲的不够详细,后期会补上,现在把重点放在final内容。


Week 1

1.1 Data visualisation 数据可视化

我们要了解Palmer penguins数据集,并且要可视化。
这里不做过多讲解,基础代码部分自己对照lecture在Rstudio里运行

# install.packages("palmerpenguins")
library(palmerpenguins)

了解Palmer penguins数据集的更多信息。

help(penguins, package = "palmerpenguins")
# or more simply
?penguins

快速查看数据集的基本信息。

library(dplyr)
dplyr::glimpse(penguins) # glimpse the structure of the penguins data frame

使用ggplot2包将数据集可视化。

ggplot(data = penguins) + aes(x = species, fill = sex) + 
  geom_bar(position = "fill") + 
  labs(x = "", y = "Proportion of penguins", fill = "Sex") + 
  scale_y_continuous(labels = scales::percent_format()) + 
  facet_grid(cols = vars(island), scales = "free_x", space = "free_x") +
  theme_linedraw(base_size = 22)

这个part更多知识点参考其他博客里讲述ggplot绘图部分。

1.2 Data collection 数据收集

Sample and Population 样本和人口

  • A sample is part of a population(sample是population的一部分)
  • A statistic can be computed from a sample, and used to estimate a parameter.(可以从样本计算统计量,并用于估计参数)
  • A statistic summarises what the researcher knows. A parameter is what the researcher wants to know.(统计数据总结了研究人员所知道的。 参数是研究人员想知道的)

为什么要用sample的方法,而不收集完整的Population来观察数据。

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值