/* describemath.sas */ title 'Gender, Ethnicity and Math performance'; title2 'Basic descriptive statistics on the exploratory sample'; proc format; value ynfmt 0 = 'No' 1 = 'Yes'; value crsfmt 4 = 'No Resp'; value nfmt 1 = 'Asian' 2 = 'Eastern European' 3 = 'European not Eastern' 4 = 'Middle-Eastern and Pakistani' 5 = 'East Indian' 6 = 'Other and DK' ; data math; infile '/home/brunner0/441s20/exploremath.data.txt'; input id course precalc calc gpa calculus english mark lang $ sex $ nation1 nation2 sample; /* Computed Variables: totscore, passed, grade, hsgpa, hscalc, hsengl, tongue, ethnic */ totscore = precalc+calc; if (50<=mark<=100) then passed=1; else passed=0; /* Some missing final marks were zero, and 998=SDF and 999=WDR */ if mark=0 then grade=.; else if mark > 100 then grade=.; else grade=mark; /* Missing HS marks were zeros */ if 65 le gpa le 100 then hsgpa = gpa; /* Else missing is automatic */ if 0 < calculus < 101 then hscalc = calculus; if 0 < english < 101 then hsengl = english; /* There were just a few French speakers */ if lang='French' then tongue='Other '; else tongue=lang; label tongue = 'Mother Tongue (Eng or Other)'; /* Rater 1 knows Middle Eastern names -- otherwise believe Rater 2 */ if nation1=4 then ethnic=nation1; else ethnic=nation2; /********************************************************************/ label precalc = 'Number precalculus correct' calc = 'Number calculus correct' totscore = 'Total # right on diagnostic test' passed = 'Passed the course' grade = 'Final mark' hsgpa = 'High School GPA' hscalc = 'HS Calculus' hsengl = 'HS English' lang = 'Mother Tongue' nation1 = 'Nationality of name acc to rater1' nation2 = 'Nationality of name acc to rater2' tongue = 'Mother Tongue (Eng or Other)' ethnic = 'Judged Nationality of name' ; format course crsfmt.; format passed ynfmt.; format nation1 nation2 ethnic nfmt.; /*********************************************************************/ proc means; title3 'Quantitative Variables'; var precalc calc totscore hsgpa hscalc hsengl grade; proc freq; title3 'Categorical variables'; tables course sex ethnic tongue passed; proc sgplot; title3 'Bar chart of ethnic background'; vbar ethnic; proc univariate normal plot; /* The normal option gives tests of H0: Data are normal. Plot produces graphics, some of which are informative. */ title3 'Detailed look at grade'; var grade; proc freq; title3 'Frequency Distribution of Final Grade'; tables grade; /* The following suggests that profs in Courses 1 and 3 bumped the marks discontinuously, while the prof in Course 2 did something more sophisticated. */ proc freq; title3 'Grade separately by course'; where course < 4; /* Exclude no response */ tables grade*course / norow nopercent nopercent; quit;