Class SurveyAnalyzer
java.lang.Object
org.episteme.social.sociology.SurveyAnalyzer
Utility class for analyzing social survey data, providing statistical methods
such as weighted averages to account for demographic sampling bias.
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionstatic RealweightedMean(double[] responses, double[] weights) Calculates the weighted arithmetic mean of a set of responses.
-
Method Details
-
weightedMean
Calculates the weighted arithmetic mean of a set of responses. Useful for correcting sample imbalances where certain groups are over- or under-represented.- Parameters:
responses- array of numerical response valuesweights- array of corresponding weights for each response- Returns:
- the weighted mean
- Throws:
IllegalArgumentException- if arrays are null, conform to different lengths, or are empty
-