Michael833/EGRA---Intern-work — Issue #28: outtable: Create t and p-values between -by- subgroups
Author: Michael833
Created: 2011-10-25 13:39:14+00:00
State: open
Labels: -Mod-, General Work

I'm happy to do this one, but I'll need some help with understanding how you input the information into the matrix in lines 88-120 in the outtable.ado file.

use "E:\Task 3 EGRA\Final Databases\Malawi\4. National Baseline EGMA Malawi 2010 Weighted Standardized Teachers.dta", clear
drop if grade !=2
svy: mean num_id_score_pcnt, over(female)
lincom [num_id_score_pcnt]Male - [num_id_score_pcnt]Female
gen t=abs(r(estimate)/r(se))
gen pvalue=2*ttail(r(df),t) if grade==2
tab pvalue
svy: reg num_id_score_pcnt female
svy: mean num_id_score_pcnt, over(female)

As you can see here, there are a couple of different ways to create t-statistics and p-values for the difference between to subgroups. In this example, we are checking the difference between boys' and girls' reading scores in second graders. -lincom- uses the info from the last -regress- or -svy:regress- function to calculate and show those values. Basically, I'm looking for a table like:
Z:\Task 3 EGRA\Final Databases\Malawi\5. Emily SE Data Summary.xlsx
Not the first sheet, but the second, third, where there are subpopulations.