*Thyne, Clayton *Intro to Stats, Chapter 9 examples clear set mem 80m cd [your directory] * NOTE: the above command asks you to change the directory. The directory will depend on how you've set up * the folders on your computer. For example, my command is... * cd F:\teaching\Fall_2008\PS572-401-baby_stats\do_file_directories\chapter9 * This is necessary so you know where stata is saving things. ****Part 1: review of difference of means use "http://www.uky.edu/~clthyn2/intro_stats/CH9_example.dta" ttest UK=IA *We see that the C.I. includes zero, so we cannot reject the null. *Now, let's make our sample 1000 with the same mean. expand(100) ttest UK=IA *With this larger sample, we can indeed conclude that IA GPAs are *significantly lower than UK GPAs. ****Part 2: examining statistical and substantive significance clear *We draw 2 normal samples of undergrads with mean=3.1 for UK students... *and mean=3.14 for IA students drawnorm UKgpa IAgpa, n(10000) means(3.1, 3.14) sds(1, 1) *Now, is there a statistically significant difference? ttest IA=UK *Yes, the two samples are statistically different, ... *but is the difference meaningful? hist UKgpa, xline(3.080696) frequency saving(UKgpa.gph, replace) hist IAgpa, xline(3.130526) frequency saving(IAgpa.gph, replace) graph combine UKgpa.gph IAgpa.gph ****Part 3: data for the in-class example clear *First, we generate some fictitious population of the world... drawnorm age, n(100000) sds(8) replace age=age+35 sum ****Part 4: using the t table **Part 4a clear use "http://www.uky.edu/~clthyn2/intro_stats/data_set_1.dta" gen lttrade=log10(ttrade) sum lttrade if western~=1 *So, using the formula on page 295... *t = the value from Table V that we decide (our alpha) *Xbar = the threshold we'll calculate *mu = 3.649 (the full-sample mean trade) *sigma = .725 (SD from below) *sqrt(n) = 10.25 (sqrt(105)) *Let's choose alpha=.05, so t= 1.64 (one tailed) *look at the formula in notes with these values... **Part 4b: looking for significance sum lttrade if western==1