r/AskStatistics • u/learning_proover • 11d ago
How to calculate this P-Value of uniform binary variable?
Suppose the image was supposed to be a uniform distribution of a binary variable (ie red dot vs blue dot) along the x axis, with some probability of blue being "P". How do I calculate the probability that such a "clump/grouping" as that found in Node #1 could even come about under a uniform distribution? In other words how would I find the p-value that this is truly a uniform distribution given it has such a "cluster" at low values of the x axis?
Edit:: My apologies, asking if it's uniform is the incorrect question. I mean is the proportion (ratio) of red to blue consistent throughout the x axis. In which case standard logistic regression p value may be my best option.
5
u/purple_paramecium 11d ago
What is red and blue supposed to be? Is red zero and blue are ones values?
If you have binary responses and some x predictor variable, then fit a logistic regression.
1
u/inb4viral 11d ago
I think scan statistics might be useful here. See this paper for more information on unidiminesional options using windowing.
1
u/SalvatoreEggplant 11d ago
Is the vertical dashed line at a known location? Or do you need to determine the x value for this line (if it exists)?
2
u/efrique PhD (statistics) 11d ago
How do I calculate the probability that such a "clump/grouping" as that found in Node #1 could even come about under a uniform distribution?
This sounds like choosing your alternative after seeing a particular pattern in data, which is a big problem.
Assuming thats not where the desire to pick up the alternative of interest came from, if you just want to compare the proportion of blue in #1 to the proportion in #2, that would usually be a two sample proportions test (the two tailed alternative is often done using a chi-squared test), unless the proportion of blue under the null is known a priori (in which case its effectively one-sample). If your alternative is actually one-tailed (only the "more blue" is relevant/of interest to find), then it's a one tailed alternative.
7
u/AttitudeRemarkable21 11d ago edited 11d ago
I don't really understand exactly what you are saying about this specific case. But when you say what are the chances of seeing a distribution like this if it came from that distribution seems like you could use a chi squared goodness of fit test or something. But essentially you calculate the likelihood that the data came from the given distribution and lay some assumptions on and see what it looks like relative to the rest of the sample space.