当前位置:网站首页>R descriptive statistics and hypothesis testing
R descriptive statistics and hypothesis testing
2022-07-07 04:50:00 【Mrrunsen】
Descriptive statistics and hypothesis testing , First, let's introduce the factors , Then it introduces how to calculate common descriptive statistics 、 skewness 、 kurtosis 、 Correlation coefficient and contingency table , The hypothesis test part introduces the normality distribution test in turn 、 Homogeneity test of variance 、t test 、 Analysis of variance and commonly used nonparametric tests .
######################################################
# factor
set.seed(42)
l3 <-sample(letters[1:3], 10, replace = T)
l3
as.factor(l3)
factor(l3)
# factor()
# Descriptive statistics
set.seed(432)
d3 <- data.frame(
ind = 1:1000,
rn = rnorm(1000),
rn2 = rnorm(1000, mean = 2, sd = 3),
rt = rt(1000, df=5),
rs1 = as.factor(sample(letters[1:3], 1000, replace = T)),
rs2 = as.factor(sample(LETTERS[21:22], 1000, replace = T))
)
# Descriptive statistics
summary(d3)
library(skimr)
skim(d3)
# skewness
e1071::skewness(d3$rn)
# kurtosis
e1071::kurtosis(d3$rn2)
# The correlation coefficient
cor(d3$rn, d3$rt)
cor(d3[,2:4])
# Correlation test
cor.test(d3$rn, d3$rt)
library(psych)
corr.test(d3[,1:3])
# Contingency table
table(d3$rs1)
prop.table(table(d3$rs1))
######################################################
# Hypothesis testing
# Normal distribution test
# shapiro.test()
library(rstatix)
head(ToothGrowth)
边栏推荐
- Mathematical analysis_ Notes_ Chapter 10: integral with parameters
- Lecture 3 of "prime mover x cloud native positive sounding, cost reduction and efficiency enhancement lecture" - kubernetes cluster utilization improvement practice
- 什么是Web3
- Two divs are on the same line, and the two divs do not wrap "recommended collection"
- JetBrain Pycharm的一系列快捷键
- Meaning of 'n:m' and '1:n' in database design
- Advertising attribution: how to measure the value of buying volume?
- 英特尔与信步科技共同打造机器视觉开发套件,协力推动工业智能化转型
- Read of shell internal value command
- Camera calibration (I): robot hand eye calibration
猜你喜欢
Local tool [Navicat] connects to remote [MySQL] operation
Have you got the same "artifact" of cross architecture development praised by various industry leaders?
【736. Lisp 语法解析】
What if win11 pictures cannot be opened? Repair method of win11 unable to open pictures
用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30
A line of R code draws the population pyramid
英特尔与信步科技共同打造机器视觉开发套件,协力推动工业智能化转型
Flex layout and usage
Break the memory wall with CPU scheme? Learn from PayPal to expand the capacity of aoteng, and the volume of missed fraud transactions can be reduced to 1/30
JS also exports Excel
随机推荐
R language principal component PCA, factor analysis, clustering analysis of regional economy analysis of Chongqing Economic Indicators
Thesis landing strategy | how to get started quickly in academic thesis writing
Code source de la fonction [analogique numérique] MATLAB allcycles () (non disponible avant 2021a)
What is JVM? What are the purposes of JVM tuning?
Acl2022 | decomposed meta learning small sample named entity recognition
Two divs are on the same line, and the two divs do not wrap "recommended collection"
各路行业大佬称赞的跨架构开发“神器”,你get同款了吗?
namespace基础介绍
[team learning] [phase 34] Baidu PaddlePaddle AI talent Creation Camp
acwing 843. n-皇后问题
In depth analysis of kubebuilder
九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
Kivy tutorial of setting the size and background of the form (tutorial includes source code)
Jetson nano configures pytorch deep learning environment / / to be improved
Leetcode notes
How to conduct website testing of software testing? Test strategy let's go!
食堂用户菜品关系系统(C语言课设)
B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
Meow, come, come: do you really know if, if else
Lecture 3 of "prime mover x cloud native positive sounding, cost reduction and efficiency enhancement lecture" - kubernetes cluster utilization improvement practice