当前位置:网站首页>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)
边栏推荐
- [practice leads to truth] is the introduction of import and require really the same as what is said on the Internet
- Is there any way to bookmark the code in the visual studio project- Is there a way to bookmark code in a Visual Studio project?
- What work items do programmers hate most in their daily work?
- 浙江大学周亚金:“又破又立”的顶尖安全学者,好奇心驱动的行动派
- C # use Siemens S7 protocol to read and write PLC DB block
- 广告归因:买量如何做价值衡量?
- Comment les tests de logiciels sont - ils effectués sur le site Web? Testez la stratégie!
- offer如何选择该考虑哪些因素
- acwing 843. N-queen problem
- System framework of PureMVC
猜你喜欢
Fix the problem that the highlight effect of the main menu disappears when the easycvr Video Square is clicked and played
Video fusion cloud platform easycvr video Plaza left column list style optimization
Oracle - views and sequences
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
Have you got the same "artifact" of cross architecture development praised by various industry leaders?
【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ
NTU notes 6422quiz review (1-3 sections)
深入解析Kubebuilder
Intel David tuhy: the reason for the success of Intel aoten Technology
Easycvr cannot be played using webrtc. How to solve it?
随机推荐
acwing 843. N-queen problem
mpf2_线性规划_CAPM_sharpe_Arbitrage Pricin_Inversion Gauss Jordan_Statsmodel_Pulp_pLU_Cholesky_QR_Jacobi
Zhou Yajin, a top safety scholar of Zhejiang University, is a curiosity driven activist
Case reward: Intel brings many partners to promote the innovation and development of multi domain AI industry
namespace基础介绍
leetcode 53. Maximum subarray maximum subarray sum (medium)
MySQL null value processing and value replacement
Network Security Learning - Information Collection
Have you got the same "artifact" of cross architecture development praised by various industry leaders?
【736. Lisp 语法解析】
Common methods of list and map
Easycvr cannot be played using webrtc. How to solve it?
leetcode 53. Maximum subarray maximum subarray sum (medium)
Win11图片打不开怎么办?Win11无法打开图片的修复方法
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
You can't sell the used lithography machine to China! The United States unreasonably pressured the Dutch ASML, and domestic chips were suppressed again
Two divs are on the same line, and the two divs do not wrap "recommended collection"
Fix the problem that the highlight effect of the main menu disappears when the easycvr Video Square is clicked and played
What if win11 pictures cannot be opened? Repair method of win11 unable to open pictures
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务