当前位置:网站首页>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)
边栏推荐
- 软件测试之网站测试如何进行?测试小攻略走起!
- A series of shortcut keys for jetbrain pychar
- Zhou Yajin, a top safety scholar of Zhejiang University, is a curiosity driven activist
- 什么是Web3
- What work items do programmers hate most in their daily work?
- Lessons and thoughts of the first SQL injection
- [team learning] [34 issues] scratch (Level 2)
- How to conduct website testing of software testing? Test strategy let's go!
- Organize five stages of actual attack and defense drill
- 未婚夫捐5亿美元给女PI,让她不用申请项目,招150位科学家,安心做科研!
猜你喜欢
Chapter 9 Yunji datacanvas company has been ranked top 3 in China's machine learning platform market
树与图的深度优先遍历模版原理
Oracle -- 视图与序列
Introduction to namespace Basics
What if the win11 screenshot key cannot be used? Solution to the failure of win11 screenshot key
Deeply cultivate the developer ecosystem, accelerate the innovation and development of AI industry, and Intel brings many partners together
A line of R code draws the population pyramid
The request request is encapsulated in uni app, which is easy to understand
How to solve the problem of adding RTSP device to easycvr cluster version and prompting server ID error?
The easycvr platform is connected to the RTMP protocol, and the interface call prompts how to solve the error of obtaining video recording?
随机推荐
Zhou Yajin, a top safety scholar of Zhejiang University, is a curiosity driven activist
英特尔与信步科技共同打造机器视觉开发套件,协力推动工业智能化转型
[hand torn STL] list
【实践出真理】import和require的引入方式真的和网上说的一样吗
Two methods of chromosome coordinate sequencing
用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30
《原动力 x 云原生正发声 降本增效大讲堂》第三讲——Kubernetes 集群利用率提升实践
Some understandings about 01 backpacker
MySQL split method usage
The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly
案例大赏:英特尔携众多合作伙伴推动多领域AI产业创新发展
A line of R code draws the population pyramid
Win11截图键无法使用怎么办?Win11截图键无法使用的解决方法
AI landing new question type RPA + AI =?
mpf2_线性规划_CAPM_sharpe_Arbitrage Pricin_Inversion Gauss Jordan_Statsmodel_Pulp_pLU_Cholesky_QR_Jacobi
Advertising attribution: how to measure the value of buying volume?
B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
Vscode 如何使用内置浏览器?
Canteen user dish relationship system (C language course design)
Mathematical analysis_ Notes_ Chapter 10: integral with parameters