[1] 6 3 2 4 2 5
die6
2 3 4 5 6
2 1 1 1 1
die6
2 3 4 5 6
0.3333333 0.1666667 0.1666667 0.1666667 0.1666667
ggplot(data.frame(x = c(-3, 3)), aes(x)) +
stat_function(fun = dt, args = list(df = 10, ncp = 0), geom = "line", color = "blue", linewidth = 0.75) +
stat_function(fun = dnorm, args = list(mean = 0, sd = 1), geom = "line", color = "red", linewidth = 0.75) +
ylim(0,.5) +
scale_x_continuous(breaks = -3:3) +
labs(x = "X", y = "f(x)")
Step 1. Identify a population that you’re interested in
Step 2. Sample from the population
ggplot(data.frame(x = c(-2, 2)), aes(x)) +
#stat_function(fun = dnorm, args = list(mean = 0, sd = 1), geom = "line") +
stat_function(fun = dnorm, args = list(mean = 0, sd = 1/sqrt(10)), geom = "line", color = "red") +
stat_function(fun = dnorm, args = list(mean = 0, sd = 1/sqrt(50)), geom = "line", color = "green") +
stat_function(fun = dnorm, args = list(mean = 0, sd = 1/sqrt(100)), geom = "line", color = "purple") +
#ylim(0,1) +
scale_x_continuous(breaks = -2:2) +
labs(x = "X", y = "f(x)")