<div dir="ltr"><div>Marcus;</div><div><br></div><div>Thank you for that. I blindly applied a few of those tests using scipy and it looks like my null hypothesis failed, though the kolmogorov test was very close. <br></div><div><br></div><div>

<span style="color:rgb(51,51,51);font-family:Consolas,"Courier New",monospace;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre;text-decoration-style:initial;text-decoration-color:initial">Mann-Whitney U Statistic: 1020.0
</span><span style="color:rgb(51,51,51);font-family:Consolas,"Courier New",monospace;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre;text-decoration-style:initial;text-decoration-color:initial">P-Value: 0.09382801322415955
</span><span style="color:rgb(51,51,51);font-family:Consolas,"Courier New",monospace;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre;text-decoration-style:initial;text-decoration-color:initial">The accepted list is random (fail to reject null hypothesis).</span> <br></div><div><br></div><div>

<span style="color:rgb(51,51,51);font-family:Consolas,"Courier New",monospace;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre;text-decoration-style:initial;text-decoration-color:initial">Kolmogorov-Smirnov Statistic: 0.3109090909090909
</span><span style="color:rgb(51,51,51);font-family:Consolas,"Courier New",monospace;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre;text-decoration-style:initial;text-decoration-color:initial">P-Value: 0.05816781698348724
</span><span style="color:rgb(51,51,51);font-family:Consolas,"Courier New",monospace;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre;text-decoration-style:initial;text-decoration-color:initial">The accepted list is random (fail to reject null hypothesis).</span>

<br></div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">_ Cody Smith _<div><a href="mailto:d00d3rs0n@gmail.com" target="_blank">d00d3rs0n@gmail.com</a></div></div></div></div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Mar 13, 2025 at 2:56 PM Russell Standish <<a href="mailto:lists@hpcoders.com.au">lists@hpcoders.com.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">A simple check you could do is check for Benford's law: <a href="https://en.wikipedia.org/wiki/Benford%27s_law" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Benford%27s_law</a><br>
<br>
On Thu, Mar 13, 2025 at 08:33:09PM +0000, Marcus Daniels wrote:<br>
> You want a Wilconxon test.  Here is an example for R.<br>
> <br>
> # Load necessary libraries<br>
> <br>
> library(ggplot2)  # For plotting<br>
> <br>
> library(stats)   # For statistical tests (base R)<br>
> <br>
>  <br>
> <br>
> # Example data (replace with your actual data)<br>
> <br>
> # admitted_ids <- c(1, 3, 5, 7, 10, 12)  # Example admitted student IDs<br>
> <br>
> # waitlisted_ids <- c(15, 18, 20, 22, 25, 30)  # Example waitlisted student IDs<br>
> <br>
>  <br>
> <br>
> # Combine data into a data frame for plotting<br>
> <br>
> data <- data.frame(<br>
> <br>
>   ID = c(admitted_ids, waitlisted_ids),<br>
> <br>
>   Status = factor(c(rep("Admitted", length(admitted_ids)),<br>
> <br>
>                     rep("Waitlisted", length(waitlisted_ids))))<br>
> <br>
> )<br>
> <br>
>  <br>
> <br>
> # 1. Plot histograms with density<br>
> <br>
> ggplot(data, aes(x = ID, fill = Status)) +<br>
> <br>
>   geom_histogram(aes(y = ..density..), alpha = 0.5, position = "identity") +<br>
> <br>
>   labs(title = "Distribution of Student IDs", x = "Student ID", y = "Density")<br>
> +<br>
> <br>
>   theme_minimal()<br>
> <br>
>  <br>
> <br>
> # 2. Box plot to compare medians and spread<br>
> <br>
> ggplot(data, aes(x = Status, y = ID, fill = Status)) +<br>
> <br>
>   geom_boxplot() +<br>
> <br>
>   labs(title = "Box Plot of Student IDs by Status", y = "Student ID") +<br>
> <br>
>   theme_minimal()<br>
> <br>
>  <br>
> <br>
> # 3. Mann-Whitney U Test (non-parametric, good for skewed data)<br>
> <br>
> mw_test <- wilcox.test(admitted_ids, waitlisted_ids, alternative = "two.sided")<br>
> <br>
> print("Mann-Whitney U Test:")<br>
> <br>
> print(mw_test)<br>
> <br>
>  <br>
> <br>
> # 4. Kolmogorov-Smirnov Test (compare distributions)<br>
> <br>
> ks_test <- ks.test(admitted_ids, waitlisted_ids)<br>
> <br>
> print("Kolmogorov-Smirnov Test:")<br>
> <br>
> print(ks_test)<br>
> <br>
>  <br>
> <br>
> # 5. Compare means<br>
> <br>
> mean_admitted <- mean(admitted_ids)<br>
> <br>
> mean_waitlisted <- mean(waitlisted_ids)<br>
> <br>
> cat("Mean ID (Admitted):", mean_admitted, "\n")<br>
> <br>
> cat("Mean ID (Waitlisted):", mean_waitlisted, "\n")<br>
> <br>
>  <br>
> <br>
> # 6. Optional: T-Test (if data is roughly normal)<br>
> <br>
> t_test <- t.test(admitted_ids, waitlisted_ids)<br>
> <br>
> print("Two-Sample T-Test:")<br>
> <br>
> print(t_test)<br>
> <br>
>  <br>
> <br>
> # 7. Quantify skewness (requires 'moments' package)<br>
> <br>
> # Install if needed: install.packages("moments")<br>
> <br>
> library(moments)<br>
> <br>
> skew_admitted <- skewness(admitted_ids)<br>
> <br>
> skew_waitlisted <- skewness(waitlisted_ids)<br>
> <br>
> cat("Skewness (Admitted):", skew_admitted, "\n")<br>
> <br>
> cat("Skewness (Waitlisted):", skew_waitlisted, "\n")<br>
> <br>
>  <br>
> <br>
> # 8. Logistic regression (modeling probability of admission)<br>
> <br>
> model <- glm(Status ~ ID, data = data, family = "binomial")<br>
> <br>
> summary(model)<br>
> <br>
>  <br>
> <br>
> From: Friam <<a href="mailto:friam-bounces@redfish.com" target="_blank">friam-bounces@redfish.com</a>> on behalf of cody dooderson<br>
> <<a href="mailto:d00d3rs0n@gmail.com" target="_blank">d00d3rs0n@gmail.com</a>><br>
> Date: Thursday, March 13, 2025 at 1:28 PM<br>
> To: The Friday Morning Applied Complexity Coffee Group <<a href="mailto:friam@redfish.com" target="_blank">friam@redfish.com</a>><br>
> Subject: [FRIAM] statistics question<br>
> <br>
> I have a question concerning preschool admissions. The kindergarten that my<br>
> daughter went to for preschool has a "random lottery" for admissions. They<br>
> published a list of all of the student ids of the students who got in and the<br>
> ones who did not and were put on a waitlist. <br>
> <br>
> She did not get in, so I decided that it was unfair and plotted the data. What<br>
> statistical tricks should I use to figure out if the lottery was random or not?<br>
> <br>
> I have attached a plot of the data in question. To me, the plot looks slightly<br>
> skewed towards the low numbers. The lower numbers are kids that signed up for<br>
> the lottery earlier and I hypothesise have  favorable connections in the<br>
> school.<br>
> <br>
>  <br>
> <br>
> [cid]<br>
> <br>
> <br>
> _ Cody Smith _<br>
> <br>
> <a href="mailto:d00d3rs0n@gmail.com" target="_blank">d00d3rs0n@gmail.com</a><br>
> <br>
<br>
<br>
<br>
<br>
<br>
> .- .-.. .-.. / ..-. --- --- - . .-. ... / .- .-. . / .-- .-. --- -. --. / ... --- -- . / .- .-. . / ..- ... . ..-. ..- .-..<br>
> FRIAM Applied Complexity Group listserv<br>
> Fridays 9a-12p Friday St. Johns Cafe   /   Thursdays 9a-12p Zoom <a href="https://bit.ly/virtualfriam" rel="noreferrer" target="_blank">https://bit.ly/virtualfriam</a><br>
> to (un)subscribe <a href="http://redfish.com/mailman/listinfo/friam_redfish.com" rel="noreferrer" target="_blank">http://redfish.com/mailman/listinfo/friam_redfish.com</a><br>
> FRIAM-COMIC <a href="http://friam-comic.blogspot.com/" rel="noreferrer" target="_blank">http://friam-comic.blogspot.com/</a><br>
> archives:  5/2017 thru present <a href="https://redfish.com/pipermail/friam_redfish.com/" rel="noreferrer" target="_blank">https://redfish.com/pipermail/friam_redfish.com/</a><br>
>   1/2003 thru 6/2021  <a href="http://friam.383.s1.nabble.com/" rel="noreferrer" target="_blank">http://friam.383.s1.nabble.com/</a><br>
<br>
<br>
-- <br>
<br>
----------------------------------------------------------------------------<br>
Dr Russell Standish                    Phone 0425 253119 (mobile)<br>
Principal, High Performance Coders     <a href="mailto:hpcoder@hpcoders.com.au" target="_blank">hpcoder@hpcoders.com.au</a><br>
                      <a href="http://www.hpcoders.com.au" rel="noreferrer" target="_blank">http://www.hpcoders.com.au</a><br>
----------------------------------------------------------------------------<br>
<br>
.- .-.. .-.. / ..-. --- --- - . .-. ... / .- .-. . / .-- .-. --- -. --. / ... --- -- . / .- .-. . / ..- ... . ..-. ..- .-..<br>
FRIAM Applied Complexity Group listserv<br>
Fridays 9a-12p Friday St. Johns Cafe   /   Thursdays 9a-12p Zoom <a href="https://bit.ly/virtualfriam" rel="noreferrer" target="_blank">https://bit.ly/virtualfriam</a><br>
to (un)subscribe <a href="http://redfish.com/mailman/listinfo/friam_redfish.com" rel="noreferrer" target="_blank">http://redfish.com/mailman/listinfo/friam_redfish.com</a><br>
FRIAM-COMIC <a href="http://friam-comic.blogspot.com/" rel="noreferrer" target="_blank">http://friam-comic.blogspot.com/</a><br>
archives:  5/2017 thru present <a href="https://redfish.com/pipermail/friam_redfish.com/" rel="noreferrer" target="_blank">https://redfish.com/pipermail/friam_redfish.com/</a><br>
  1/2003 thru 6/2021  <a href="http://friam.383.s1.nabble.com/" rel="noreferrer" target="_blank">http://friam.383.s1.nabble.com/</a><br>
</blockquote></div>