<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt'>You want a Wilconxon test.  Here is an example for R.<br><br># Load necessary libraries<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>library(ggplot2)  # For plotting<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>library(stats)   # For statistical tests (base R)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># Example data (replace with your actual data)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># admitted_ids <- c(1, 3, 5, 7, 10, 12)  # Example admitted student IDs<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># waitlisted_ids <- c(15, 18, 20, 22, 25, 30)  # Example waitlisted student IDs<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># Combine data into a data frame for plotting<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>data <- data.frame(<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>  ID = c(admitted_ids, waitlisted_ids),<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>  Status = factor(c(rep("Admitted", length(admitted_ids)), <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>                    rep("Waitlisted", length(waitlisted_ids))))<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># 1. Plot histograms with density<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>ggplot(data, aes(x = ID, fill = Status)) +<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>  geom_histogram(aes(y = ..density..), alpha = 0.5, position = "identity") +<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>  labs(title = "Distribution of Student IDs", x = "Student ID", y = "Density") +<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>  theme_minimal()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># 2. Box plot to compare medians and spread<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>ggplot(data, aes(x = Status, y = ID, fill = Status)) +<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>  geom_boxplot() +<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>  labs(title = "Box Plot of Student IDs by Status", y = "Student ID") +<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>  theme_minimal()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># 3. Mann-Whitney U Test (non-parametric, good for skewed data)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>mw_test <- wilcox.test(admitted_ids, waitlisted_ids, alternative = "two.sided")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>print("Mann-Whitney U Test:")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>print(mw_test)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># 4. Kolmogorov-Smirnov Test (compare distributions)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>ks_test <- ks.test(admitted_ids, waitlisted_ids)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>print("Kolmogorov-Smirnov Test:")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>print(ks_test)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># 5. Compare means<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>mean_admitted <- mean(admitted_ids)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>mean_waitlisted <- mean(waitlisted_ids)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>cat("Mean ID (Admitted):", mean_admitted, "\n")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>cat("Mean ID (Waitlisted):", mean_waitlisted, "\n")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># 6. Optional: T-Test (if data is roughly normal)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>t_test <- t.test(admitted_ids, waitlisted_ids)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>print("Two-Sample T-Test:")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>print(t_test)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># 7. Quantify skewness (requires 'moments' package)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># Install if needed: install.packages("moments")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>library(moments)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>skew_admitted <- skewness(admitted_ids)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>skew_waitlisted <- skewness(waitlisted_ids)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>cat("Skewness (Admitted):", skew_admitted, "\n")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>cat("Skewness (Waitlisted):", skew_waitlisted, "\n")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'># 8. Logistic regression (modeling probability of admission)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>model <- glm(Status ~ ID, data = data, family = "binomial")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>summary(model)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-bottom:12.0pt'><b><span style='font-size:12.0pt;color:black'>From: </span></b><span style='font-size:12.0pt;color:black'>Friam <friam-bounces@redfish.com> on behalf of cody dooderson <d00d3rs0n@gmail.com><br><b>Date: </b>Thursday, March 13, 2025 at 1:28 PM<br><b>To: </b>The Friday Morning Applied Complexity Coffee Group <friam@redfish.com><br><b>Subject: </b>[FRIAM] statistics question<o:p></o:p></span></p></div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt'>I have a question concerning preschool admissions. The kindergarten that my daughter went to for preschool has a "random lottery" for admissions. They published a list of all of the student ids of the students who got in and the ones who did not and were put on a waitlist. <o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt'>She did not get in, so I decided that it was unfair and plotted the data. What statistical tricks should I use to figure out if the lottery was random or not? <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt'>I have attached a plot of the data in question. To me, the plot looks slightly skewed towards the low numbers. The lower numbers are kids that signed up for the lottery earlier and I hypothesise have  favorable connections in the school.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt'><img width=534 height=413 style='width:5.5625in;height:4.302in' id="_x0000_i1025" src="cid:ii_m87sueok1"><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt'><br clear=all><o:p></o:p></span></p></div><div><div><div><p class=MsoNormal><span style='font-size:11.0pt'>_ Cody Smith _<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:11.0pt'><a href="mailto:d00d3rs0n@gmail.com">d00d3rs0n@gmail.com</a><o:p></o:p></span></p></div></div></div></div></div></div></body></html>