Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R : How Many is a Sufficiently Large Sample Size? #30

Open
kimpro82 opened this issue Mar 21, 2024 · 1 comment
Open

R : How Many is a Sufficiently Large Sample Size? #30

kimpro82 opened this issue Mar 21, 2024 · 1 comment
Labels

Comments

@kimpro82
Copy link
Owner

My brother-in-law asked, and I happened to be bored

@kimpro82 kimpro82 added the R label Mar 21, 2024
@kimpro82
Copy link
Owner Author

by Bing Copliot

# 필요한 패키지 불러오기
library(ggplot2)

# 자유도 값 정의
df_values <- c(5, 10, 15, 20, 25, 30)

# x 값 범위 설정
x <- seq(-4, 4, length.out = 1000)

# 데이터 프레임 생성
df <- data.frame(x = rep(x, length(df_values)),
                 density = c(sapply(df_values, function(df) dt(x, df))),
                 distribution = rep(c("t-distribution", "Normal distribution"), each = length(x)))

# 체계적인 색상 팔레트
my_palette <- c("#1f78b4", "#33a02c")

# 그림 그리기
ggplot(df, aes(x = x, y = density, color = distribution)) +
  geom_line(size = 1) +
  scale_color_manual(values = my_palette) +
  facet_wrap(~ distribution, ncol = 2, scales = "free_y") +
  labs(title = "Comparison of t-distribution and Normal distribution",
       x = "x", y = "Density") +
  theme_minimal()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant