# This program demonstrates the power of t.test command # t.test can do almost all important tasks related to normal # distribution for standard statistics courses. # Created by C. Andy Tsao, 060516 # Just a selected list of what t.test can do # 1. One population hypothesis tests for population mean # confidence intervals # 2. For two normal populations, it can be used to perform # two-sample t-test with or without equal variances # and paired t-test. # 3. Since t_df --> z as df -> \infty, t.test can also servered as a tool # for calculating p-value for asympotic test and asymptotic CI. x<-rnorm(10) y<-rnorm(12)+2 t.test(x,y) t.test(x,y,var.equal=TRUE) t.test(x,conf.level = 0.9,alternative = "less")