###################################################################### # Probabilities and quantiles with the t-distribution # # # ###################################################################### alpha <- 0.05 #Quantiles qt(p = 1 - alpha/2, df = 10) qt(p = 1 - alpha/2, df = c(10, 20, 30, 40, 50)) qnorm(p = 1 - alpha/2, mean = 0, sd = 1) #Probabilities pt(q = 1.96, df = 5) pt(q = 1.96, df = 10) pt(q = 1.96, df = c(10, 20, 30, 40, 50)) pnorm(q = 1.96, mean = 0, sd = 1) #Plot curve(expr = dt(x = x, df = 5), from = -5, to = 5, col = "red", lwd = 2, main = "t distribution with DF = 5", ylab = "f(t)", xlab = "t", n = 1000) abline(h = 0)