(*^
::[ Information =
"This is a Mathematica Notebook file. It contains ASCII text, and can be
transferred by email, ftp, or other text-file transfer utility. It should
be read or edited using a copy of Mathematica or MathReader. If you
received this as email, use your mail application or copy/paste to save
everything from the line containing (*^ down to the line containing ^*)
into a plain text file. On some systems you may have to give the file a
name ending with ".ma" to allow Mathematica to recognize it as a Notebook.
The line below identifies what version of Mathematica created this file,
but it can be opened using any other version as well.";
FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2";
MacintoshStandardFontEncoding;
fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, cellOutline, groupLikeTitle, center, M18, O486, R65535, e8, 24, "Calculus";
fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M18, O486, bold, R21845, G21845, B21845, e6, 12, "Calculus";
fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M18, O486, R21845, G21845, B21845, e6, 12, "Calculus";
fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M18, O486, bold, R21845, G21845, B21845, a10, 12, "Calculus";
fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M18, O486, bold, R21845, G21845, B21845, a10, 12, "Calculus";
fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, O486, bold, R21845, G21845, B21845, a10, 12, "Calculus";
fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Calculus";
fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, B65535, 12, "Calculus";
fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M36, N23, O486, bold, L-5, 12, "Courier";
fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M36, N23, O486, L-5, 12, "Courier";
fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, O486, R65535, L-5, 12, "Courier";
fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, O486, L-5, 12, "Courier";
fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, O486, B65535, L-5, 12, "Courier";
fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M18, O486, l19, o2, w378, h214, 12, "Courier";
fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, italic, 10, "Geneva";
fontset = header, inactive, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Times";
fontset = leftheader, inactive, M18, O486, L2, 12, "Times";
fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M18, O486, 12, "Times";
fontset = leftfooter, inactive, M18, O486, L2, 12, "Times";
fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 10, "Times";
fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Times";
fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Times";
fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, whiteBox, M18, O486, bold, R21845, G21845, B21845, 12, "Calculus";
fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M18, O486, R21845, G21845, B21845, 12, "Calculus";
fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Times";
fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M18, O486, 10, "Courier";
fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M18, O486, 10, "Courier";
currentKernel;
]
:[font = title; inactive; preserveAspect; startGroup]
Data Analysis
using Real HS Data
:[font = smalltext; inactive; Cclosed; preserveAspect; startGroup]
Initialization:
:[font = input; initialization; preserveAspect; endGroup]
*)
<{"1-10","11-20","21-30",
"31-40","41-50","51-60","61-70","71-80","81-90",
"91-100"},BarValues->True,AspectRatio->.5,
PlotRange->{0,17},
PlotLabel->"Frequency of Reading Scores"];
:[font = smalltext; inactive; preserveAspect]
By dropping ID, the independent variables preGPA, Reading, Verbal, Quantitative, and Total can be regressed onto GPA. The regression analysis compares the model to a smaller one of only a constant term.
;[s]
2:0,0;7,1;211,-1;
2:1,16,12,Chicago,0,12,0,0,65535;1,16,12,New York,0,12,0,0,65535;
:[font = input; preserveAspect]
newdata := ColumnDrop[data,1]
Clear[x1,x2,x3,x4,x5,y]
Regress[newdata,{1,x1,x2,x3,x4,x5},{x1,x2,x3,x4,x5},
BasisNames->{"Constant","preGPA","Read","Verbal",
"Quant","Total"}]
:[font = smalltext; inactive; preserveAspect]
Predicted GPA can be compared to actual GPA and these predicted values plotted against the residuals.
:[font = input; preserveAspect]
newdata := ColumnDrop[data,1]
Clear[x1,x2,x3,x4,x5,y]
pred1 = Regress[newdata,{1,x1,x2,x3,x4,x5},{x1,x2,x3,x4,x5},
OutputControl->NoPrint,
OutputList->{PredictedResponse,FitResiduals,CorrelationMatrix}]
:[font = input; preserveAspect]
predict := PredictedResponse /. pred1
errors := FitResiduals /. pred1
ListPlot[Transpose[{predict,errors}],PlotRange->All,
PlotStyle->Blue];
:[font = input; preserveAspect]
pred5 = Regress[newdata,{1,x1,x2,x3,x4,x5},{x1,x2,x3,x4,x5},
OutputControl->NoPrint,
OutputList->{BestFitCoefficients}]
:[font = input; preserveAspect]
Clear[m]
halves = Table[.5 m,{m,4,10}]
:[font = input; preserveAspect]
rc2 = RangeCounts[predict,halves]
:[font = input; preserveAspect]
fpredict = Transpose[RowJoin[{rc2,Append[halves,5.5]}]]
:[font = smalltext; inactive; preserveAspect]
It is apparent that the majority of the students achieved GPA's within 0.5 grade point of their predicted grade. It may be of interest to note that the three students with lowest predicted GPA have either left XXXXXX HS or have been on academic probation at least one semester prior to this analysis.
The next step of this project is to redo the analysis using the entire set of applicant scores. I am interested in the comparison between the predicted GPA of students who were admitted to those who were not.
:[font = input; preserveAspect]
data2 := {
{04, 4.93, 99, 99, 99, 99},
{08, 4.80, 54, 88, 99, 97},
{10, 4.70, 73, 86, 96, 93},
{11, 4.57, 63, 83, 59, 72},
{12, 4.53, 67, 50, 66, 59},
{13, 4.90, 39, 40, 99, 84},
{14, 3.37, 80, 88, 94, 93},
{16, 4.67, 80, 86, 97, 93},
{17, 4.97, 80, 69, 89, 84},
{18, 4.87, 67, 83, 89, 89},
{23, 5.00, 83, 53, 55, 55},
{24, 4.17, 89, 99, 71, 92},
{25, 4.83, 28, 59, 35, 44},
{26, 3.73, 83, 21, 28, 21},
{27, 3.87, 09, 04, 01, 01},
{31, 4.67, 78, 93, 87, 92},
{35, 4.93, 67, 75, 74, 78},
{36, 4.10, 91, 99, 96, 99},
{37, 4.27, 59, 72, 82, 78},
{38, 3.67, 93, 55, 92, 80},
{39, 4.23, 22, 70, 46, 59},
{40, 4.07, 30, 23, 26, 21},
{41, 3.77, 07, 29, 28, 26},
{42, 4.93, 99, 97, 98, 99},
{43, 4.93, 95, 98, 95, 98},
{45, 4.83, 95, 95, 89, 95},
{46, 4.80, 91, 93, 98, 98},
{47, 4.70, 89, 76, 97, 91},
{51, 4.90, 95, 80, 53, 68},
{53, 4.63, 59, 63, 88, 78},
{55, 5.00, 71, 75, 68, 72},
{56, 4.20, 91, 69, 68, 70},
{57, 4.63, 49, 78, 70, 75},
{59, 4.63, 67, 53, 49, 50},
{60, 4.57, 86, 59, 35, 47},
{61, 4.77, 71, 50, 68, 59},
{62, 4.83, 63, 40, 16, 26},
{63, 4.43, 54, 72, 59, 66},
{64, 4.20, 67, 61, 16, 37},
{65, 4.67, 41, 57, 71, 38},
{66, 4.40, 49, 48, 26, 32},
{67, 4.27, 76, 38, 22, 28},
{68, 4.03, 59, 08, 88, 47},
{69, 4.30, 54, 12, 55, 28},
{70, 4.27, 28, 05, 28, 11},
{74, 4.30, 41, 59, 24, 39},
{75, 4.50, 49, 76, 62, 72},
{76, 2.80, 07, 31, 32, 30},
{77, 4.70, 91, 92, 86, 92},
{80, 4.80, 54, 81, 70, 53},
{81, 4.90, 69, 57, 78, 68},
{87, 4.07, 82, 72, 61, 71},
{88, 4.90, 56, 22, 53, 36},
{89, 4.50, 78, 67, 47, 56},
{90, 4.43, 69, 67, 32, 49},
{91, 4.60, 27, 25, 32, 27},
{94, 4.73, 95, 93, 86, 93},
{97, 4.80, 27, 61, 68, 66},
{102, 5.00, 88, 47, 82, 68},
{103, 4.70, 88, 97, 72, 92},
{104, 4.73, 88, 55, 59, 59},
{106, 4.17, 63, 64, 80, 73},
{107, 4.47, 12, 01, 06, 01},
{108, 3.40, 49, 11, 53, 27}}
:[font = input; preserveAspect]
Clear[pred2]
pred2[x1_,x2_,x3_,x4_,x5_] :=
-1.82592 + 0.909263 x1 + 0.00420906 x2 - 0.0159426 x3 + 0.000375868 x4 + 0.0316178 x5
:[font = input; preserveAspect]
newdata2 = ColumnDrop[data2,1];
predict2 = MapThread[pred2,Transpose[newdata2]]
:[font = input; preserveAspect]
rc3 := RangeCounts[predict2,halves]
fpredict3 := Transpose[RowJoin[{rc3,Append[halves,5.5]}]]
:[font = smalltext; inactive; preserveAspect]
This is a bar graph of predicted grades of students who were admitted
:[font = input; preserveAspect]
Bar1 = BarChart[fpredict,BarLabels->{"0-2","2-2.5","2.5-3",
"3-3.5","3.5-4","4-4.5","4.5-5","5"},
BarValues->True,
PlotRange->{0,25},
PlotLabel->"Frequency of Predicted Grades"];
:[font = smalltext; inactive; preserveAspect]
This is a bar graph of predicted grades of students who were not admitted.
:[font = input; preserveAspect]
Bar2 = BarChart[fpredict3,BarLabels->{"0-2","2-2.5","2.5-3",
"3-3.5","3.5-4","4-4.5","4.5-5","5"},
BarValues->True,BarStyle->{Green},
BarSpacing->0.25,
PlotRange->{0,25}];
:[font = smalltext; inactive; preserveAspect]
This is a comparison between the predicted GPA of students who were admitted to those who were not.
:[font = input; preserveAspect; endGroup; endGroup]
Show[Bar1,Bar2];
^*)