/* basicmath.sas */ %include '/folders/myfolders/441s18/Lecture/mathread1.sas'; proc freq; title3 'Frequency distributions of categorical variables'; tables sex gender ethnic tongue course passed gsplit; proc means; title3 'Basic Descriptive Statistics on Quantitative Variables'; var hsgpa hscalc hsengl calc precalc totscore diff grade; proc univariate normal plot; var grade; /* Explore with elementary tests */ proc means n mean stddev t probt; title3 'Calculus vs. Pre-calculus scale'; var diff; proc freq; title3 'Some Relationships between categorical variables'; tables tongue*sex / chisq; tables ethnic*sex / nocol nopercent chisq; tables sex*course / nocol nopercent chisq; tables ethnic * tongue / nocol nopercent chisq; /* Follow up ethnic * tongue to seek directional conclusions */ proc freq; title3 'Ethnic by Tongue: Asians vs. Eastern Europeans'; where ethnic = 1 or ethnic = 2; tables ethnic * tongue / nocol nopercent chisq; proc freq; title3 'Ethnic by Tongue: Asians vs. Other Europeans'; where ethnic = 1 or ethnic = 3; tables ethnic * tongue / nocol nopercent chisq; proc freq; title3 'Ethnic by Tongue: Asians vs. Middle East'; where ethnic = 1 or ethnic = 4; tables ethnic * tongue / nocol nopercent chisq; proc freq; title3 'Ethnic by Tongue: Asians vs. East Indian'; where ethnic = 1 or ethnic = 5; tables ethnic * tongue / nocol nopercent chisq; proc freq; title3 'Ethnic by Tongue: Asians vs. Other / DK'; where ethnic = 1 or ethnic = 6; tables ethnic * tongue / nocol nopercent chisq; proc freq; title3 'Eastern European vs. Other European'; where ethnic = 2 or ethnic = 3; tables ethnic * tongue / nocol nopercent chisq; proc freq; title3 'Eastern European vs. Middle Eastern'; where ethnic = 2 or ethnic = 4; tables ethnic * tongue / nocol nopercent chisq; /* And so on. There are 6 choose 2 = 15 pairwise comparisons */ /* Passing the course is an important response variable*/ proc freq; title3 'Passing the course'; tables (sex ethnic tongue course) * passed / nocol nopercent chisq; /* Categorical Predictors of Grade, one at a time */ proc glm; title3 'Sex and Grade'; class gender; /* Could have used sex instead */ model grade=gender; proc glm; title3 'Ethnic and Grade'; class ethnic; model grade=ethnic; proc glm; title3 'Mother tongue and Grade'; class tongue; model grade=tongue; means tongue; /* Means broken down by tongue */ proc glm; title3 'Course and Grade'; class course; model grade=course; /* Relationships between quantitative variables*/ proc corr; title3 'Correlations between quantitative variables'; var hsgpa hscalc hsengl calc precalc totscore diff grade passed; proc reg plots = none; title3 'Preliminary regression on grade try 1: Initial sample size is n=579'; model grade = gender mtongue e1-e4 e6 c1 c3 hsgpa hscalc hsengl calc precalc totscore;