啊啊啊啊啊吖

2018-10-25   阅读量: 855

数据分析师 R语言 数据可视化

直方图让如何显著性标记

扫码加入数据分析学习群
# loading needed libraries
library(ggstatsplot)
library(psych)
library(dplyr)

# looking at the structure of the data using glimpse
dplyr::glimpse(x = psych::sat.act)
#> Observations: 700
#> Variables: 6
#> $ gender    <int> 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2...
#> $ education <int> 3, 3, 3, 4, 2, 5, 5, 3, 4, 5, 3, 4, 4, 4, 3, 4, 3, 4...
#> $ age       <int> 19, 23, 20, 27, 33, 26, 30, 19, 23, 40, 23, 34, 32, ...
#> $ ACT       <int> 24, 35, 21, 26, 31, 28, 36, 22, 22, 35, 32, 29, 21, ...
#> $ SATV      <int> 500, 600, 480, 550, 600, 640, 610, 520, 400, 730, 76...
#> $ SATQ      <int> 500, 500, 470, 520, 550, 640, 500, 560, 600, 800, 71...
ggstatsplot::gghistostats(
    data = psych::sat.act,                              # data from which variable is to be taken
    x = ACT,                                            # numeric variable
    results.subtitle = FALSE,                           # don't run statistical tests
    messages = FALSE,                                   # turn off messages
    xlab = "ACT Score",                                 # x-axis label
    title = "Distribution of ACT Scores",               # title for the plot
    subtitle = "N = 700",                               # subtitle for the plot
    caption = "Data courtesy of: SAPA project (https://sapa-project.org)", # caption for the plot
    centrality.k = 1                                    # show 1 decimal places for centrality label
  )

添加CDA认证专家【维克多阿涛】,微信号:【cdashijiazhuang】,提供数据分析指导及CDA考试秘籍。已助千人通过CDA数字化人才认证。欢迎交流,共同成长!
0.0000 0 4 关注作者 收藏

评论(0)


暂无数据

推荐课程

推荐帖子