SAS code example for Quantile Regression by Sheryl Magzamen http://www.cvmbs.colostate.edu/DirectorySearch/Search/MemberProfile/CVMBS/34735 This goes with SRCD poster, 2015, Moore, C.F. et al. Also: Magzamen, Amato, et al., 2015, Environmental Research, 117, 108-119. /*wald test - basically shows same info as on graph*/ /*just lets you know if the parameter is different than the null*/ ods graphics on; /*try the QR model*/ /*reading*/ proc quantreg data=two order=formatted; model WKCE_Reading_Score = exposed child_sex black excelhealth lths ell DPIpov/ QUANTILE = 0.05 to 0.95 by 0.05 plot=quantplot; test_exposed: test exposed /QINTERACT; test_child_sex: test child_sex/QINTERACT; test_black: test black/QINTERACT; test_excelhealth: test excelhealth/QINTERACT; test_lths: test lths/QINTERACT; test_ell: test ell/QINTERACT; test_DPI_pov: test DPIpov/QINTERACT; run; ods graphics off; /*try the QR model comparing the 0.10 and the 0.50 quantiles*/ /*reading*/ ods graphics on; proc quantreg data=two order=formatted; model rdg_kce_scale_score = exposed child_sex black excelhealth lths ell DPIpov/ QUANTILE = 0.10 0.50; test_exposed: test exposed /QINTERACT; test_child_sex: test child_sex/QINTERACT; test_black: test black/QINTERACT; test_excelhealth: test excelhealth/QINTERACT; test_lths: test lths/QINTERACT; test_ell: test ell/QINTERACT; test_DPI_pov: test DPIpov/QINTERACT; run; ods graphics off; /*try the QR model comparing the 0.50 and the 0.90 quantiles*/ /*reading*/ ods graphics on; proc quantreg data=two order=formatted; model rdg_kce_scale_score = exposed child_sex black excelhealth lths ell DPIpov/ QUANTILE = 0.50 0.90; test_exposed: test exposed /QINTERACT; test_child_sex: test child_sex/QINTERACT; test_black: test black/QINTERACT; test_excelhealth: test excelhealth/QINTERACT; test_lths: test lths/QINTERACT; test_ell: test ell/QINTERACT; test_DPI_pov: test DPIpov/QINTERACT; run; ods graphics off; /*try the QR model comparing the 0.10 and the 0.90 quantiles*/ /*reading*/ ods graphics on; proc quantreg data=two order=formatted; model rdg_kce_scale_score = exposed child_sex black excelhealth lths ell DPIpov/ QUANTILE = 0.10 0.90; test_exposed: test exposed /QINTERACT; test_child_sex: test child_sex/QINTERACT; test_black: test black/QINTERACT; test_excelhealth: test excelhealth/QINTERACT; test_lths: test lths/QINTERACT; test_ell: test ell/QINTERACT; test_DPI_pov: test DPIpov/QINTERACT; run; ods graphics off; ods graphics on; /*try the QR model with interaction terms*/ /*reading - black*exp*/ proc quantreg data=two order=formatted; model rdg_kce_scale_score = exposed child_sex black excelhealth lths ell DPIpov blackintx/ QUANTILE = 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 plot=quantplot; test_blackintx: test blackintx/QINTERACT; run; ods graphics off; ods graphics on; /*try with other intx terms*/ /*reading - sex*exp*/ proc quantreg data=two order=formatted; model rdg_kce_scale_score = exposed child_sex black excelhealth lths DPIpov sexexp/ QUANTILE = 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 plot=quantplot; test_sexexp: test sexexp/QINTERACT; run; ods graphics off; ods graphics on; /*try with other intx terms*/ /*reading - lths*exp*/ proc quantreg data=two order=formatted; model WKCE_Reading_Score = exposed lths lthsexp child_sex black excelhealth DPIpov/ QUANTILE = 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 plot=quantplot; test_lthsexp: test lthsexp/QINTERACT; run; ods graphics off; ods graphics on; /*try with other intx terms*/ /*reading - FRPL*exp*/ proc quantreg data=two order=formatted; model WKCE_Reading_Score = exposed DPIpov FRPLexp child_sex black excelhealth lths/ QUANTILE = 0.05 to 0.95 by 0.05 plot=quantplot; test_FRPLexp: test FRPLexp/QINTERACT; run; ods graphics off; ods graphics on; /*try with other intx terms*/ /*reading - black*lths*/ proc quantreg data=two order=formatted; model WKCE_Reading_Score = lths black blacklths exposed child_sex excelhealth DPIpov ell/ QUANTILE = 0.05 to 0.95 by 0.05 plot=quantplot; test_blacklths: test blacklths/QINTERACT; run; ods graphics off; ods graphics on; /*try with other intx terms*/ /*reading - excelhealth*exposure*/ proc quantreg data=two order=formatted; model WKCE_Reading_Score = exposed excelhealth excelexp lths black child_sex DPIpov ell / QUANTILE = 0.05 to 0.95 by 0.05 plot=quantplot; test_excelexp: test excelexp/QINTERACT; run; ods graphics off;