dm 'log;clear;output;clear'; ods html close; ods html ;* style=minimal; ods graphics on; options nodate nocenter pageno=1 ls=90 ps=56 FORMCHAR="|----|+|---+=|-/\<>*"; ODS listing; ************************************; *** James P Geaghan ***; *** Assignment 8 Example ***; ***********************************************************************; *** DASL Project (Data and Story Library), Cornell University ***; *** 358 Ives Hall, Ithaca, New York 14850-3901 ***; *** Data source: United States Department of Labor Statistics ***; ***********************************************************************; *** The dataset contains the labor force participation rate (LFPR) ***; *** of women in 19 cities in the United States in each of two years ***; *** (1968 and 1972). The data help to measure the growing presence ***; *** of women in the labor force over this period. ***; ***********************************************************************; title1 "More on the data step and t-tests"; title2 "The paired t-test - Labor Force example"; data LaborForce (keep = City diff Year1972 Year1968) Univariate (keep = City year proportion); Label City = 'City in the United States' Year1972 = 'Labor Force Participation rate of women in 1972' Year1968 = 'Labor Force Participation rate of women in 1968'; input City $ 1-15 @16 Year1972 Year1968; diff = Year1972 - Year1968; output laborforce; year = 1972; proportion = year1972; output Univariate; year = 1968; proportion = year1968; output Univariate; *---+----1----+----2----+----3----+----4----+----5; datalines; N.Y. .45 .42 L.A. .50 .50 Chicago .52 .52 Philadelphia .45 .45 Detroit .46 .43 San Francisco .55 .55 Boston .60 .45 Pitt. .49 .34 St. Louis .35 .45 Connecticut .55 .54 Wash., D.C. .52 .42 Cinn. .53 .51 Baltimore .57 .49 Newark .53 .54 Minn/St. Paul .59 .50 Buffalo .64 .58 Houston .50 .49 Patterson .57 .56 Dallas .64 .63 ; run; *proc print data=LaborForce; run; *proc print data=Univariate; run; proc sort data=Univariate; by year; run; proc boxplot data=Univariate; plot proportion*year; run; proc univariate data=Univariate plot; by year; Title2 'proc univariate examination BY year'; var proportion; ods exclude ExtremeObs ExtremeValues Modes Moments MissingValues Quantiles TestsForLocation; options ls=64 ps=55; run; options ls=90 ps=56; proc univariate data=LaborForce plot normal CIBasic; Title2 'Paired t-test with proc univariate'; Title3 'Two-tailed hypothesis'; var diff; ods exclude BasicMeasures MissingValues Quantiles ExtremeValues; histogram diff / normal; run; PROC ttest data=LaborForce sides=u; VAR diff; Title2 'Paired t-test of DIFF with Proc TTEST'; Title3 'One-tailed hypothesis'; RUN; PROC ttest data=LaborForce sides=u; paired Year1972 * Year1968; Title2 'Paired t-test with Proc TTEST'; Title3 'One-tailed hypothesis'; RUN; ods html close;